DressUpView.cs 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132
  1. using UI.DressUp;
  2. using FairyGUI;
  3. using UnityEngine;
  4. using System.Collections.Generic;
  5. using ET;
  6. namespace GFGGame
  7. {
  8. public class DressUpView : BaseView
  9. {
  10. public const int MAX_MEMORY_STEP = 20;//最大记录步数
  11. public const int BOTTOM_BLANK = 20;
  12. public const int RIGHT_BLANK = 36;
  13. private const int SORT_BY_HIGH_RARITY = 0;
  14. private const int SORT_BY_LOW_RARITY = 1;
  15. private const int SORT_BY_GET_TIME = 2;
  16. private UI_DressUpUI _ui;
  17. private float listType1X = 0;
  18. private float partsListX = 0;
  19. private float partsListScrollingPosY = 0;
  20. private DressUpListType currentListType;
  21. /// <summary>
  22. /// 子菜单列表
  23. /// </summary>
  24. private int[] _currentList2;
  25. private GameObject _sceneObject;
  26. private List<int> _currentList3 = new List<int>();
  27. private List<int> _currentList4 = new List<int>();
  28. private int _currentMenuType;
  29. private int _currentSuitId;
  30. private bool _isNormalSuitType = false;//当前套装部件列表是否为普通动作列表
  31. private int _rarityIndex = SORT_BY_HIGH_RARITY;
  32. private UI_TypeItem listTypeItem_FreedomDress;
  33. private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
  34. private int currentIndex = 0;
  35. public override void Dispose()
  36. {
  37. if (_sceneObject != null)
  38. {
  39. PrefabManager.Instance.Restore(_sceneObject);
  40. _sceneObject = null;
  41. }
  42. for (int i = 0; i < _listLongPress.Count; i++)
  43. {
  44. _listLongPress[i].Dispose();
  45. }
  46. _listLongPress.Clear();
  47. if (_ui != null)
  48. {
  49. _ui.Dispose();
  50. _ui = null;
  51. }
  52. base.Dispose();
  53. }
  54. protected override void Init()
  55. {
  56. base.Init();
  57. packageName = UI_DressUpUI.PACKAGE_NAME;
  58. _ui = UI_DressUpUI.Create();
  59. viewCom = _ui.target;
  60. isfullScreen = true;
  61. isReturnView = true;
  62. }
  63. protected override void OnInit()
  64. {
  65. base.OnInit();
  66. _ui.m_btnLastStep.visible = true;
  67. _ui.m_btnNextStep.visible = true;
  68. _ui.m_btnSearch.visible = true;
  69. _ui.m_btnPhoto.visible = true;
  70. _ui.m_btnAction.visible = false;
  71. // _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
  72. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  73. _ui.m_partsListSearch.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  74. InitLists();
  75. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  76. _ui.m_btnHome.onClick.Add(OnClickBtnHome);
  77. _ui.m_btnLastStep.onClick.Add(OnClickBtnLastStep);
  78. _ui.m_btnNextStep.onClick.Add(OnClickBtnNextStep);
  79. _ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
  80. _ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
  81. _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
  82. // _ui.m_partsList.m_list.SetVirtual();
  83. // _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
  84. _ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
  85. // _ui.m_partsListSearch.m_list.onClickItem.Add(OnClickPartsListItem);
  86. _ui.m_touchPad.onClick.Add(OnTouchPad);
  87. _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
  88. _ui.m_btnSave.onClick.Add(OnClickBtnSave);
  89. _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
  90. _ui.m_partsListSearch.m_comboBoxRarity.onChanged.Add(OnSearchComboBoxRarityChanged);
  91. _ui.m_btnAction.onClick.Add(OnClickBtnAction);
  92. _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
  93. _ui.m_btnNext.onClick.Add(OnClickBtnNext);
  94. _ui.m_btnShow.onClick.Add(OnClickBtnShow);
  95. _ui.m_btnHide.onClick.Add(OnClickBtnHide);
  96. _ui.m_loaShow.onClick.Add(OnClickLoaShow);
  97. _ui.m_btnPhoto.onClick.Add(OnClickBtnPhoto);
  98. _ui.m_partsList2.m_comboBoxRarity.visible = false;
  99. _ui.m_partsList2.m_imgTop.visible = true;
  100. _ui.m_partsList.m_imgTop.visible = false;
  101. }
  102. private void InitLists()
  103. {
  104. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  105. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  106. _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
  107. _ui.m_partsListSearch.m_list.itemRenderer = ListPartsItem;
  108. listType1X = _ui.m_comListType1.target.x;
  109. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;// - DressUpView.RIGHT_BLANK;
  110. //一级菜单
  111. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  112. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  113. //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_comListType1.m_listType1.numItems);
  114. float maxHeight = _ui.target.height - _ui.m_comListType1.target.y - DressUpView.BOTTOM_BLANK;
  115. if (_ui.m_comListType1.m_listType.height > maxHeight)
  116. {
  117. _ui.m_comListType1.m_listType.height = maxHeight;
  118. }
  119. }
  120. protected override void AddEventListener()
  121. {
  122. base.AddEventListener();
  123. EventAgent.AddEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
  124. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  125. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdateSearch);
  126. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSearch);
  127. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  128. }
  129. protected override void OnShown()
  130. {
  131. base.OnShown();
  132. if (this.viewData != null)
  133. {
  134. _ui.m_c2.selectedIndex = (int)this.viewData;
  135. }
  136. _rarityIndex = SORT_BY_HIGH_RARITY;
  137. // MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DRESS_UP, "mp3"));
  138. _ui.m_comListType1.target.x = _ui.target.width;
  139. _ui.m_comListType2.target.x = _ui.target.width;
  140. _ui.m_partsList.target.x = _ui.target.width;
  141. _ui.m_partsList2.target.x = _ui.target.width;
  142. _ui.m_partsListSearch.target.x = _ui.target.width;
  143. this.showListType1();
  144. if (_sceneObject == null)
  145. {
  146. _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("SceneDressUp"));
  147. }
  148. MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
  149. currentIndex = CustomSuitDataManager.currentIndex;
  150. _ui.m_comboBox.items = CustomSuitDataManager.GetSuitPosItems();
  151. _ui.m_comboBox.selectedIndex = currentIndex;
  152. MyDressUpHelper.PutOnSuitSavedByPos(currentIndex);
  153. UpdateStepBtn(true);
  154. Timers.inst.AddUpdate(CheckGuide);
  155. }
  156. protected override void OnHide()
  157. {
  158. base.OnHide();
  159. listTypeItem_FreedomDress = null;
  160. // MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
  161. MyDressUpHelper.dressUpObj.TakeOffAll();
  162. DressUpMenuItemDataManager.Clear();
  163. if (_sceneObject != null)
  164. {
  165. PrefabManager.Instance.Restore(_sceneObject);
  166. _sceneObject = null;
  167. //MyDressUpHelper.dressUpObj.ClearView();
  168. }
  169. _ui.m_c2.selectedIndex = 0;
  170. Reset();
  171. Timers.inst.Remove(CheckGuide);
  172. }
  173. protected override void RemoveEventListener()
  174. {
  175. base.RemoveEventListener();
  176. EventAgent.RemoveEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
  177. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  178. EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdateSearch);
  179. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdateSearch);
  180. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  181. }
  182. private void OnClickBtnBack()
  183. {
  184. Reset();
  185. // this.Hide();
  186. //ViewManager.Show<MainUIView>();
  187. ViewManager.GoBackFrom(typeof(DressUpView).FullName);
  188. }
  189. private void OnClickBtnHome()
  190. {
  191. GameController.GoBackToMainView();
  192. Reset();
  193. }
  194. private void Reset()
  195. {
  196. DressUpMenuItemDataManager.Clear();
  197. MyDressUpHelper.ResetMemory();
  198. }
  199. private void OnClickBtnLastStep()
  200. {
  201. if (!MyDressUpHelper.OnClickBtnLastStep()) return;
  202. UpdateStepBtn(false);
  203. }
  204. private void OnClickBtnNextStep()
  205. {
  206. if (!MyDressUpHelper.OnClickBtnNextStep()) return;
  207. UpdateStepBtn(false);
  208. }
  209. private void OnComboBoxChanged()
  210. {
  211. if (_ui.m_comboBox.selectedIndex == currentIndex) return;
  212. if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
  213. {
  214. ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GOLD_CARD });
  215. _ui.m_comboBox.selectedIndex = currentIndex;
  216. return;
  217. }
  218. if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.BlackGold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold))
  219. {
  220. ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_BLACK_CARD });
  221. _ui.m_comboBox.selectedIndex = currentIndex;
  222. return;
  223. }
  224. currentIndex = _ui.m_comboBox.selectedIndex;
  225. MyDressUpHelper.PutOnSuitSavedByPos(_ui.m_comboBox.selectedIndex);
  226. UpdateStepBtn(true);
  227. }
  228. private void OnClickListType1Item(EventContext context)
  229. {
  230. GObject typeItem = (GObject)context.data as GObject;
  231. int order = (int)typeItem.data;
  232. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[order - 1];
  233. if (item1.subMenusArr.Length > 0)
  234. {
  235. this.showListType2(item1.subMenusArr);
  236. }
  237. else
  238. {
  239. if (this.showListParts(item1.type) == false)
  240. {
  241. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  242. return;
  243. }
  244. }
  245. this.hideListType1();
  246. UpdateListPartsSelected();
  247. }
  248. private void OnClickListType2Item(EventContext context)
  249. {
  250. GObject typeItem = (GObject)context.data as GObject;
  251. int order = (int)typeItem.data;
  252. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[order - 1];
  253. if (this.showListParts(item2.type) == false)
  254. {
  255. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  256. return;
  257. }
  258. this.hideListType2();
  259. }
  260. private void OnClickPartsListItem(EventContext context)
  261. {
  262. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  263. {
  264. return;
  265. }
  266. int id = (int)(context.sender as GObject).data;
  267. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  268. {
  269. partsListScrollingPosY = _ui.m_partsList.m_list.scrollPane.scrollingPosY;
  270. OnBtnNormalClick(context);
  271. }
  272. else if (_currentMenuType == ConstDressUpItemType.DONG_ZUO)
  273. {
  274. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(id);
  275. }
  276. else
  277. {
  278. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  279. }
  280. UpdateStepBtn(true, id);
  281. }
  282. private void OnBtnNormalClick(EventContext context)
  283. {
  284. // _isNormalSuitType = true;
  285. GObject gObject = context.sender as GObject;
  286. int suitId = (int)gObject.data;
  287. ShowSuitPartList(suitId, false);
  288. }
  289. private void OnBtnActionClick(EventContext context)
  290. {
  291. // _isNormalSuitType = false;
  292. GObject gObject = context.sender as GObject;
  293. int suitId = (int)gObject.data;
  294. ShowSuitPartList(suitId, true);
  295. }
  296. private void ShowSuitPartList(int suitId, bool showAction)
  297. {
  298. _isNormalSuitType = !showAction;
  299. this.showListParts2(suitId);
  300. this.hideListParts();
  301. if (showAction)
  302. {
  303. MyDressUpHelper.dressUpObj.PutOnSuitCfg(suitId, true);
  304. }
  305. else
  306. {
  307. MyDressUpHelper.dressUpObj.PutOnSuitCfg(suitId, false);
  308. }
  309. UpdateStepBtn(true);
  310. }
  311. private void OnClickSuitPartsListItem(EventContext context)
  312. {
  313. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  314. {
  315. return;
  316. }
  317. GObject listItem = (GObject)context.data as GObject;
  318. int id = (int)listItem.data;
  319. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  320. if (itemCfg != null)
  321. {
  322. if (!DressUpMenuItemDataManager.CheckHasItem(itemCfg.id))
  323. {
  324. PromptController.Instance.ShowFloatTextPrompt("还未获得这件装扮");
  325. return;
  326. }
  327. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  328. }
  329. else
  330. {
  331. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(id);
  332. }
  333. UpdateStepBtn(true);
  334. // UpdateListSuitPartsSelected();
  335. }
  336. private void UpdateStepBtn(bool isAdd, int suitId = 0)
  337. {
  338. if (isAdd)
  339. {
  340. MyDressUpHelper.AddMemoryDressup();
  341. }
  342. _ui.m_btnLastStep.enabled = MyDressUpHelper.stepIndex > 0;
  343. _ui.m_btnNextStep.enabled = MyDressUpHelper.stepIndex < MyDressUpHelper.dressMemory.Count - 1;
  344. UpdateListPartsSelected(suitId);
  345. UpdateListSuitPartsSelected();
  346. }
  347. private void OnLongPress(EventContext context)
  348. {
  349. LongPressGesture gesture = (LongPressGesture)context.sender;
  350. int itemId = (int)gesture.host.data;
  351. GoodsItemTipsController.ShowItemTips(itemId);
  352. }
  353. private void OnTouchPad()
  354. {
  355. if (this.currentListType == DressUpListType.List4)
  356. {
  357. this.hideListParts2();
  358. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  359. }
  360. else if (this.currentListType == DressUpListType.List3)
  361. {
  362. if (_currentList2 != null)
  363. {
  364. this.showListType2(_currentList2);
  365. // _ui.m_comListType2.m_listType.numItems = _ui.m_comListType2.m_listType.numItems;
  366. }
  367. else
  368. {
  369. this.showListType1();
  370. }
  371. this.hideListParts();
  372. }
  373. else if (this.currentListType == DressUpListType.List2)
  374. {
  375. this.showListType1();
  376. this.hideListType2();
  377. }
  378. else if (this.currentListType == DressUpListType.List4)
  379. {
  380. this.showListType1();
  381. this.hideListType2();
  382. }
  383. else if (this.currentListType == DressUpListType.List5)
  384. {
  385. this.showListType1();
  386. this.hideSearchListType();
  387. }
  388. // _ui.m_comListType1.m_listType.numItems = _ui.m_comListType1.m_listType.numItems;
  389. // this.ShowSubList();
  390. }
  391. private void OnClickBtnDelete()
  392. {
  393. MyDressUpHelper.dressUpObj.TakeOffAll();
  394. MyDressUpHelper.dressUpObj.AddOrRemove(ConstItemID.DEFULT_BG, false);
  395. UpdateBtnAction();
  396. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  397. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  398. UpdateStepBtn(true);
  399. }
  400. private void OnClickBtnSave()
  401. {
  402. CustomSuitDataManager.SaveCurrentSuit(_ui.m_comboBox.selectedIndex);
  403. RoleDataManager.CheckSaveDressUpBgToMainBg(MyDressUpHelper.dressUpObj.bgId);
  404. }
  405. private void OnComboBoxRarityChanged()
  406. {
  407. _rarityIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  408. this.UpdatePartsListSort();
  409. }
  410. private void OnSearchComboBoxRarityChanged()
  411. {
  412. _rarityIndex = _ui.m_partsListSearch.m_comboBoxRarity.selectedIndex;
  413. this.UpdateSearchList();
  414. }
  415. private void OnClickBtnAction()
  416. {
  417. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(201003);
  418. }
  419. private void OnClickBtnSearch()
  420. {
  421. ViewManager.Show<DressFilterView>(true);
  422. }
  423. private void showListType1()
  424. {
  425. _currentList2 = null;
  426. currentListType = DressUpListType.List1;
  427. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  428. GTween.To(_ui.target.width, listType1X, 0.5f)
  429. .SetTarget(_ui.m_comListType1.target)
  430. .OnUpdate((GTweener t) =>
  431. {
  432. _ui.m_comListType1.target.x = t.value.x;
  433. });
  434. }
  435. private void hideListType1()
  436. {
  437. GTween.To(listType1X, _ui.target.width, 0.5f)
  438. .SetTarget(_ui.m_comListType1.target)
  439. .OnUpdate((GTweener t) =>
  440. {
  441. _ui.m_comListType1.target.x = t.value.x;
  442. });
  443. }
  444. private void showListType2(int[] menuStrArr = null)
  445. {
  446. currentListType = DressUpListType.List2;
  447. if (menuStrArr != null && menuStrArr.Length > 0)
  448. {
  449. int len = menuStrArr.Length;
  450. _currentList2 = menuStrArr.Clone() as int[];
  451. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  452. _ui.m_comListType2.m_listType.numItems = len;
  453. //_ui.m_comListType2.m_listType2.ResizeToFit(_ui.m_comListType2.m_listType2.numItems);
  454. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  455. if (_ui.m_comListType2.m_listType.height > maxHeight)
  456. {
  457. _ui.m_comListType2.m_listType.height = maxHeight;
  458. }
  459. }
  460. GTween.To(_ui.target.width, listType1X, 0.5f)
  461. .SetTarget(_ui.m_comListType2.target)
  462. .OnUpdate((GTweener t) =>
  463. {
  464. _ui.m_comListType2.target.x = t.value.x;
  465. });
  466. }
  467. private void hideListType2()
  468. {
  469. GTween.To(listType1X, _ui.target.width, 0.5f)
  470. .SetTarget(_ui.m_comListType2.target)
  471. .OnUpdate((GTweener t) =>
  472. {
  473. _ui.m_comListType2.target.x = t.value.x;
  474. });
  475. }
  476. private bool showListParts(int type, bool selectItem = false)
  477. {
  478. _currentMenuType = type;
  479. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  480. {
  481. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  482. if (_rarityIndex >= SORT_BY_GET_TIME)
  483. {
  484. _rarityIndex = SORT_BY_HIGH_RARITY;
  485. }
  486. }
  487. else
  488. {
  489. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  490. }
  491. this.UpdatePartsListSort();
  492. if (_ui.m_partsList.m_list.numItems <= 0) return false;
  493. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  494. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;// - DressUpView.BOTTOM_BLANK;
  495. if (_ui.m_partsList.m_list.height > maxHeight)
  496. {
  497. _ui.m_partsList.m_list.height = maxHeight;
  498. }
  499. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  500. {
  501. _ui.m_partsList.m_list.scrollPane.SetPosY(partsListScrollingPosY, false);
  502. partsListScrollingPosY = 0;
  503. }
  504. currentListType = DressUpListType.List3;
  505. GTween.To(_ui.target.width, partsListX, 0.5f)
  506. .SetTarget(_ui.m_partsList)
  507. .OnUpdate((GTweener t) =>
  508. {
  509. _ui.m_partsList.target.x = t.value.x;
  510. });
  511. UpdateBtnAction();
  512. UpdateListPartsSelected();
  513. return true;
  514. }
  515. private void hideListParts()
  516. {
  517. // _currentMenuType = 0;
  518. UpdateBtnAction();
  519. GTween.To(partsListX, _ui.target.width, 0.5f)
  520. .SetTarget(_ui.m_partsList)
  521. .OnUpdate((GTweener t) =>
  522. {
  523. _ui.m_partsList.target.x = t.value.x;
  524. });
  525. }
  526. private void showListParts2(int suitId)
  527. {
  528. _currentSuitId = suitId;
  529. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  530. if (_rarityIndex >= SORT_BY_GET_TIME)
  531. {
  532. _rarityIndex = SORT_BY_HIGH_RARITY;
  533. }
  534. this.UpdateSuitPartsListSort();
  535. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  536. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
  537. if (_ui.m_partsList2.m_list.height > maxHeight)
  538. {
  539. _ui.m_partsList2.m_list.height = maxHeight;
  540. }
  541. currentListType = DressUpListType.List4;
  542. GTween.To(_ui.target.width, partsListX, 0.5f)
  543. .SetTarget(_ui.m_partsList2)
  544. .OnUpdate((GTweener t) =>
  545. {
  546. _ui.m_partsList2.target.x = t.value.x;
  547. });
  548. UpdateBtnAction();
  549. }
  550. private void hideListParts2()
  551. {
  552. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  553. UpdateBtnAction();
  554. GTween.To(partsListX, _ui.target.width, 0.5f)
  555. .SetTarget(_ui.m_partsList2)
  556. .OnUpdate((GTweener t) =>
  557. {
  558. _ui.m_partsList2.target.x = t.value.x;
  559. });
  560. }
  561. private void showSearchListType()
  562. {
  563. // _currentList2 = null;
  564. currentListType = DressUpListType.List5;
  565. GTween.To(_ui.target.width, partsListX, 0.5f)
  566. .SetTarget(_ui.m_partsListSearch.target)
  567. .OnUpdate((GTweener t) =>
  568. {
  569. _ui.m_partsListSearch.target.x = t.value.x;
  570. });
  571. }
  572. private void hideSearchListType()
  573. {
  574. GTween.To(partsListX, _ui.target.width, 0.5f)
  575. .SetTarget(_ui.m_partsListSearch.target)
  576. .OnUpdate((GTweener t) =>
  577. {
  578. _ui.m_partsListSearch.target.x = t.value.x;
  579. });
  580. }
  581. /****************************************************************************************************************************/
  582. private void DressResetSerch()
  583. {
  584. if (currentListType == DressUpListType.List5)
  585. {
  586. OnTouchPad();
  587. }
  588. }
  589. private void UpdateSearch(EventContext context)
  590. {
  591. if (context.data.ToString() == ConstMessage.DRESS_SEARCH)
  592. {
  593. _currentList3 = DressUpMenuItemDataManager.DressSearch();
  594. }
  595. else if (context.data.ToString() == ConstMessage.DRESS_FILTER)
  596. {
  597. _currentList3 = DressUpMenuItemDataManager.DressFilter();
  598. }
  599. ViewManager.Hide<ModalStatusView>();
  600. UpdateSearchList();
  601. if (currentListType != DressUpListType.List5)
  602. {
  603. hideListParts();
  604. hideListParts2();
  605. hideListType1();
  606. hideListType2();
  607. showSearchListType();
  608. }
  609. _currentMenuType = 0;
  610. }
  611. private void UpdateSearchList()
  612. {
  613. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  614. {
  615. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList3);
  616. }
  617. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  618. {
  619. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList3);
  620. }
  621. _currentMenuType = 0;
  622. _ui.m_partsListSearch.m_list.numItems = _currentList3.Count;
  623. }
  624. private void ListType1Item(int index, GObject item)
  625. {
  626. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  627. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  628. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  629. typeItem.m_txtname.text = item1.name;
  630. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  631. typeItem.target.data = item1.id;
  632. typeItem.m_imgNeed.visible = false;
  633. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.id);
  634. UI_TypeItem.ProxyEnd();
  635. }
  636. private void ListType2Item(int index, GObject item)
  637. {
  638. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  639. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  640. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  641. typeItem.m_txtname.text = item2.name;
  642. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  643. typeItem.target.data = item2.id;
  644. typeItem.m_imgNeed.visible = false;
  645. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
  646. UI_TypeItem.ProxyEnd();
  647. }
  648. private void ListPartsItem(int index, GObject item)
  649. {
  650. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  651. int id = (int)_currentList3[index];
  652. string iconRes = "";
  653. string partName = "";
  654. string ext = "png";
  655. listItem.m_btnAni.visible = false;
  656. Debug.Log("id:" + id + " _currentMenuType:" + _currentMenuType);
  657. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  658. {
  659. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  660. iconRes = suitCfg.res;
  661. partName = suitCfg.name;
  662. listItem.m_iconSelected.visible = false;
  663. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  664. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  665. listItem.m_ScoreType.visible = false;
  666. listItem.m_imgNew.visible = false;
  667. bool SuitHasAction = SuitCfgArray.Instance.CheckSuitHasAction(id);
  668. bool HasActionRes = DressUpMenuSuitDataManager.CheckSuitHasActionRes(id);
  669. Debug.Log("SuitHasAction:" + SuitHasAction + " HasActionRes:" + HasActionRes + " suitCfg.res" + suitCfg.aniRes);
  670. listItem.m_btnAni.visible = SuitCfgArray.Instance.CheckSuitHasAction(id) && DressUpMenuSuitDataManager.CheckSuitHasActionRes(id);
  671. // listItem.m_comAxtionSelect.m_btnNormal.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  672. // listItem.m_comAxtionSelect.m_btnAction.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  673. if (listItem.m_btnAni.data == null)
  674. {
  675. listItem.m_btnAni.onClick.Add(OnBtnActionClick);
  676. }
  677. listItem.m_btnAni.data = id;
  678. }
  679. else if (_currentMenuType == (int)ConstDressUpItemType.DONG_ZUO)
  680. {
  681. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  682. iconRes = suitCfg.res;
  683. partName = suitCfg.name;
  684. listItem.m_iconSelected.visible = false;
  685. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  686. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  687. listItem.m_ScoreType.visible = false;
  688. listItem.m_imgNew.visible = false;
  689. }
  690. else
  691. {
  692. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  693. iconRes = itemCfg.res;
  694. partName = itemCfg.name;
  695. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  696. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  697. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  698. // ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  699. listItem.m_ScoreType.visible = true;
  700. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + itemCfg.mainScore);
  701. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  702. listItem.m_imgNew.visible = isNew;
  703. if (isNew)
  704. {
  705. ItemProxy.ReqSetItemRead(id).Coroutine();
  706. }
  707. }
  708. if (listItem.m_icon.data == null)
  709. {
  710. listItem.m_icon.onClick.Add(OnClickPartsListItem);
  711. }
  712. listItem.m_icon.data = id;
  713. if (listItem.target.data == null)
  714. {
  715. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  716. longPressGesture.once = true;
  717. longPressGesture.onAction.Add(OnLongPress);
  718. _listLongPress.Add(longPressGesture);
  719. }
  720. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  721. listItem.m_txtTitle.text = partName;
  722. listItem.target.data = id;
  723. listItem.m_grpScore.visible = false;
  724. //listItem.m_ScoreType.visible = true;
  725. listItem.m_imgNeed.visible = false;
  726. UI_PartsListItem.ProxyEnd();
  727. }
  728. private void ListParts2Item(int index, GObject item)
  729. {
  730. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  731. int id = (int)_currentList4[index];
  732. string iconRes = "";
  733. string partName = "";
  734. // string ext = "png";
  735. if (listItem.target.data == null)
  736. {
  737. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  738. longPressGesture.once = true;
  739. longPressGesture.onAction.Add(OnLongPress);
  740. _listLongPress.Add(longPressGesture);
  741. }
  742. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  743. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  744. iconRes = itemCfg != null ? itemCfg.res : suitCfg.res;
  745. partName = itemCfg != null ? itemCfg.name : suitCfg.name;
  746. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  747. bool isAction = MyDressUpHelper.dressUpObj.IsAction && SuitCfgArray.Instance.CheckActionContainsItem(id, MyDressUpHelper.dressUpObj.actionId);
  748. listItem.m_iconSelected.visible = isPutOn || isAction;
  749. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, itemCfg == null);
  750. listItem.m_ScoreType.visible = false;
  751. if (itemCfg != null)
  752. {
  753. listItem.m_ScoreType.visible = true;
  754. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + itemCfg.mainScore);
  755. }
  756. listItem.m_btnAni.visible = false;
  757. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, "png");
  758. listItem.m_txtTitle.text = partName;
  759. listItem.target.data = id;
  760. listItem.m_grpScore.visible = false;
  761. //listItem.m_ScoreType.visible = true;
  762. listItem.m_imgNeed.visible = false;
  763. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  764. listItem.m_imgNew.visible = isNew;
  765. if (isNew)
  766. {
  767. ItemProxy.ReqSetItemRead(id).Coroutine();
  768. }
  769. UI_PartsListItem.ProxyEnd();
  770. }
  771. private void UpdateListPartsSelected(int selectSuitId = 0)
  772. {
  773. GList list;
  774. if (_ui.m_partsList.target.x == partsListX)
  775. {
  776. list = _ui.m_partsList.m_list;
  777. }
  778. else if (_ui.m_partsListSearch.target.x == partsListX)
  779. {
  780. list = _ui.m_partsListSearch.m_list;
  781. }
  782. else
  783. {
  784. return;
  785. }
  786. int count = list.numChildren;
  787. int suitId = MyDressUpHelper.dressUpObj.suitId;
  788. for (int i = 0; i < count; i++)
  789. {
  790. UI_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(i));
  791. int id = (int)listItem.target.data;
  792. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  793. {
  794. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  795. }
  796. else if (_currentMenuType == ConstDressUpItemType.DONG_ZUO)
  797. {
  798. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.IsAction && MyDressUpHelper.dressUpObj.actionId == id;
  799. }
  800. else
  801. {
  802. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  803. bool isAction = MyDressUpHelper.dressUpObj.IsAction && SuitCfgArray.Instance.CheckActionContainsItem(id, MyDressUpHelper.dressUpObj.actionId);
  804. listItem.m_iconSelected.visible = isPutOn || isAction;
  805. }
  806. UI_PartsListItem.ProxyEnd();
  807. }
  808. }
  809. private void UpdateListSuitPartsSelected()
  810. {
  811. int count = _ui.m_partsList2.m_list.numChildren;
  812. for (int i = 0; i < count; i++)
  813. {
  814. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  815. int id = (int)listItem.target.data;
  816. bool isSuitSelect = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//可换部件是否穿戴
  817. bool isActionSelect = MyDressUpHelper.dressUpObj.actionId == id;
  818. listItem.m_iconSelected.visible = isSuitSelect || isActionSelect;
  819. UI_PartsListItem.ProxyEnd();
  820. }
  821. }
  822. private void UpdatePartsListSort()
  823. {
  824. if (_currentMenuType == 0) return;
  825. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  826. {
  827. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  828. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  829. {
  830. _currentList3 = SuitUtil.SortSuitListByHighRarity(_currentList3);
  831. }
  832. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  833. {
  834. _currentList3 = SuitUtil.SortSuitListByLowRarity(_currentList3);
  835. }
  836. else
  837. {
  838. _currentList3.Reverse();
  839. }
  840. }
  841. else if (_currentMenuType == (int)ConstDressUpItemType.DONG_ZUO)
  842. {
  843. _currentList3 = DressUpMenuSuitDataManager.GetActionIDList();
  844. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  845. {
  846. _currentList3 = SuitUtil.SortSuitListByHighRarity(_currentList3);
  847. }
  848. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  849. {
  850. _currentList3 = SuitUtil.SortSuitListByLowRarity(_currentList3);
  851. }
  852. else
  853. {
  854. _currentList3.Reverse();
  855. }
  856. }
  857. else
  858. {
  859. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  860. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  861. {
  862. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList3);
  863. }
  864. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  865. {
  866. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList3);
  867. }
  868. else
  869. {
  870. _currentList3.Reverse();
  871. }
  872. }
  873. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  874. // {
  875. // _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3);
  876. // }
  877. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  878. // {
  879. // _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3);
  880. // }
  881. _ui.m_partsList.m_list.RemoveChildrenToPool();
  882. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  883. }
  884. private void UpdateSuitPartsListSort()
  885. {
  886. if (_currentMenuType == 0) return;
  887. if (_isNormalSuitType)
  888. {
  889. _currentList4 = new List<int>(SuitCfgArray.Instance.GetSuitItems(_currentSuitId));
  890. }
  891. else
  892. {
  893. _currentList4 = SuitCfgArray.Instance.GetOneSuitAllNotActionParts(_currentSuitId);
  894. _currentList4.Add(_currentSuitId);
  895. }
  896. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  897. // {
  898. // _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4);
  899. // }
  900. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  901. // {
  902. // _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4);
  903. // }
  904. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  905. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  906. }
  907. private void UpdateBtnAction()
  908. {
  909. // _ui.m_btnAction.visible = (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG) || this.currentListType == DressUpListType.List4;
  910. // if (_ui.m_btnAction.visible)
  911. // {
  912. //_ui.m_btnAction.grayed = !EquipDataCache.cacher.HasSuitActionRes;
  913. // }
  914. }
  915. private void OnClickBtnShow()
  916. {
  917. Timers.inst.Remove(SetBtnShowVisable);
  918. _ui.m_c1.selectedIndex = 0;
  919. _ui.m_btnHide.visible = true;
  920. _ui.m_btnShow.visible = false;
  921. _ui.m_loaShow.visible = false;
  922. }
  923. private void OnClickBtnHide()
  924. {
  925. _ui.m_c1.selectedIndex = 1;
  926. _ui.m_btnHide.visible = false;
  927. _ui.m_btnShow.visible = true;
  928. _ui.m_loaShow.visible = true;
  929. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  930. }
  931. private void OnClickLoaShow()
  932. {
  933. _ui.m_btnShow.alpha = 1;
  934. _ui.m_btnShow.enabled = true;
  935. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  936. }
  937. private void OnClickBtnPhoto()
  938. {
  939. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.PAI_ZHAO, 1);
  940. if (!ViewManager.Show<PhotographView>())
  941. {
  942. return;
  943. }
  944. _ui.target.visible = false;
  945. this._sceneObject.gameObject.SetActive(false);
  946. }
  947. private void OnClickBtnNext()
  948. {
  949. // if (!EquipDataCache.cacher.CheckPutOnFinish())
  950. // {
  951. // AlertUI.Show("只有换好衣服才能出门哦!")
  952. // .SetRightButton(true, "好的");
  953. // return;
  954. // }
  955. if (!ViewManager.Show<PhotographView>(this.viewData))
  956. {
  957. return;
  958. }
  959. _ui.target.visible = false;
  960. this._sceneObject.gameObject.SetActive(false);
  961. }
  962. private void UpdateScene()
  963. {
  964. _ui.target.visible = true;
  965. this._sceneObject.gameObject.SetActive(true);
  966. }
  967. private void SetBtnShowVisable(object param)
  968. {
  969. _ui.m_btnShow.enabled = false;
  970. GTween.To(1, 0, 0.3f).SetTarget(_ui.m_btnShow, TweenPropType.Alpha);
  971. }
  972. private bool CheckListCount(int type)
  973. {
  974. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  975. {
  976. return DressUpMenuSuitDataManager.GetSuitIDList().Count > 0;
  977. }
  978. else
  979. {
  980. return DressUpMenuItemDataManager.getItemDatasByType(type).Count > 0;
  981. }
  982. }
  983. private void CheckGuide(object param)
  984. {
  985. if (GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0
  986. || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER) <= 0)
  987. {
  988. UpdateToCheckGuide(null);
  989. }
  990. else
  991. {
  992. Timers.inst.Remove(CheckGuide);
  993. }
  994. }
  995. protected override void UpdateToCheckGuide(object param)
  996. {
  997. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  998. if (listTypeItem_FreedomDress == null && GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0)
  999. {
  1000. int len = _ui.m_comListType1.m_listType.numChildren;
  1001. for (int i = 0; i < len; i++)
  1002. {
  1003. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  1004. if (item != null)
  1005. {
  1006. int menuID = (int)item.target.data;
  1007. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  1008. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
  1009. {
  1010. listTypeItem_FreedomDress = item;
  1011. _ui.m_comListType1.m_listType.ScrollToView(i);
  1012. break;
  1013. }
  1014. }
  1015. UI_TypeItem.ProxyEnd();
  1016. }
  1017. }
  1018. if (listTypeItem_FreedomDress != null) GuideController.TryGuide(listTypeItem_FreedomDress.target, ConstGuideId.FREEDOM_DRESS, 3, "套装分类里,可以查看集齐成套的服饰,点击一键换上。");
  1019. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.FREEDOM_DRESS, 4, "", 0);
  1020. // if (_ui.m_partsList.m_list.numItems > 0)
  1021. // {
  1022. // UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(0).asCom);
  1023. // GuideController.TryGuide(listItem.m_comAxtionSelect.m_btnAction, ConstGuideId.FREEDOM_DRESS, 5, "选择特殊动作并穿上。");
  1024. // UI_PartsListItem.ProxyEnd();
  1025. // }
  1026. GuideController.TryGuide(_ui.m_btnSave, ConstGuideId.FREEDOM_DRESS, 5, "搭配好的服饰,可以保存到主界面显示。");
  1027. GuideController.TryGuide(_ui.m_btnPhoto, ConstGuideId.FREEDOM_DRESS, 6, "辛苦搭配完,去拍个照片留念呀~~");
  1028. GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.ENTER_CHAPTER, 2, "");
  1029. }
  1030. }
  1031. }