DressUpView.cs 44 KB

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