DressUpView.cs 44 KB

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