DressUpView.cs 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131
  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. if(!DressUpMenuItemDataManager.CheckHasItem(itemCfg.id))
  342. {
  343. PromptController.Instance.ShowFloatTextPrompt("还未获得这件装扮");
  344. return;
  345. }
  346. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  347. }
  348. else
  349. {
  350. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(id);
  351. }
  352. UpdateStepBtn(true);
  353. // UpdateListSuitPartsSelected();
  354. }
  355. private void UpdateStepBtn(bool isAdd, int suitId = 0)
  356. {
  357. if (isAdd)
  358. {
  359. MyDressUpHelper.AddMemoryDressup();
  360. }
  361. _ui.m_btnLastStep.enabled = MyDressUpHelper.stepIndex > 0;
  362. _ui.m_btnNextStep.enabled = MyDressUpHelper.stepIndex < MyDressUpHelper.dressMemory.Count - 1;
  363. UpdateListPartsSelected(suitId);
  364. UpdateListSuitPartsSelected();
  365. }
  366. private void OnLongPress(EventContext context)
  367. {
  368. LongPressGesture gesture = (LongPressGesture)context.sender;
  369. int itemId = (int)gesture.host.data;
  370. GoodsItemTipsController.ShowItemTips(itemId);
  371. }
  372. private void OnTouchPad()
  373. {
  374. if (this.currentListType == DressUpListType.List4)
  375. {
  376. this.hideListParts2();
  377. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  378. }
  379. else if (this.currentListType == DressUpListType.List3)
  380. {
  381. if (_currentList2 != null)
  382. {
  383. this.showListType2(_currentList2);
  384. // _ui.m_comListType2.m_listType.numItems = _ui.m_comListType2.m_listType.numItems;
  385. }
  386. else
  387. {
  388. this.showListType1();
  389. }
  390. this.hideListParts();
  391. }
  392. else if (this.currentListType == DressUpListType.List2)
  393. {
  394. this.showListType1();
  395. this.hideListType2();
  396. }
  397. else if (this.currentListType == DressUpListType.List4)
  398. {
  399. this.showListType1();
  400. this.hideListType2();
  401. }
  402. else if (this.currentListType == DressUpListType.List5)
  403. {
  404. this.showListType1();
  405. this.hideSearchListType();
  406. }
  407. // _ui.m_comListType1.m_listType.numItems = _ui.m_comListType1.m_listType.numItems;
  408. // this.ShowSubList();
  409. }
  410. private void OnClickBtnDelete()
  411. {
  412. MyDressUpHelper.dressUpObj.TakeOffAll();
  413. MyDressUpHelper.dressUpObj.AddOrRemove(ConstItemID.DEFULT_BG, false);
  414. UpdateBtnAction();
  415. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  416. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  417. UpdateStepBtn(true);
  418. }
  419. private void OnClickBtnSave()
  420. {
  421. CustomSuitDataManager.SaveCurrentSuit(_ui.m_comboBox.selectedIndex);
  422. }
  423. private void OnComboBoxRarityChanged()
  424. {
  425. _rarityIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  426. this.UpdatePartsListSort();
  427. }
  428. private void OnSearchComboBoxRarityChanged()
  429. {
  430. _rarityIndex = _ui.m_partsListSearch.m_comboBoxRarity.selectedIndex;
  431. this.UpdateSearchList();
  432. }
  433. private void OnClickBtnAction()
  434. {
  435. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(201003);
  436. }
  437. private void OnClickBtnSearch()
  438. {
  439. ViewManager.Show<DressFilterView>(true, new object[] { ViewName.DRESS_UP_VIEW });
  440. }
  441. private void showListType1()
  442. {
  443. _currentList2 = null;
  444. currentListType = DressUpListType.List1;
  445. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  446. GTween.To(_ui.target.width, listType1X, 0.5f)
  447. .SetTarget(_ui.m_comListType1.target)
  448. .OnUpdate((GTweener t) =>
  449. {
  450. _ui.m_comListType1.target.x = t.value.x;
  451. });
  452. }
  453. private void hideListType1()
  454. {
  455. GTween.To(listType1X, _ui.target.width, 0.5f)
  456. .SetTarget(_ui.m_comListType1.target)
  457. .OnUpdate((GTweener t) =>
  458. {
  459. _ui.m_comListType1.target.x = t.value.x;
  460. });
  461. }
  462. private void showListType2(int[] menuStrArr = null)
  463. {
  464. currentListType = DressUpListType.List2;
  465. if (menuStrArr != null && menuStrArr.Length > 0)
  466. {
  467. int len = menuStrArr.Length;
  468. _currentList2 = menuStrArr.Clone() as int[];
  469. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  470. _ui.m_comListType2.m_listType.numItems = len;
  471. //_ui.m_comListType2.m_listType2.ResizeToFit(_ui.m_comListType2.m_listType2.numItems);
  472. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  473. if (_ui.m_comListType2.m_listType.height > maxHeight)
  474. {
  475. _ui.m_comListType2.m_listType.height = maxHeight;
  476. }
  477. }
  478. GTween.To(_ui.target.width, listType1X, 0.5f)
  479. .SetTarget(_ui.m_comListType2.target)
  480. .OnUpdate((GTweener t) =>
  481. {
  482. _ui.m_comListType2.target.x = t.value.x;
  483. });
  484. }
  485. private void hideListType2()
  486. {
  487. GTween.To(listType1X, _ui.target.width, 0.5f)
  488. .SetTarget(_ui.m_comListType2.target)
  489. .OnUpdate((GTweener t) =>
  490. {
  491. _ui.m_comListType2.target.x = t.value.x;
  492. });
  493. }
  494. private bool showListParts(int type, bool selectItem = false)
  495. {
  496. _currentMenuType = type;
  497. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  498. {
  499. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  500. if (_rarityIndex >= SORT_BY_GET_TIME)
  501. {
  502. _rarityIndex = SORT_BY_HIGH_RARITY;
  503. }
  504. }
  505. else
  506. {
  507. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  508. }
  509. this.UpdatePartsListSort();
  510. if (_ui.m_partsList.m_list.numItems <= 0) return false;
  511. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  512. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;// - DressUpView.BOTTOM_BLANK;
  513. if (_ui.m_partsList.m_list.height > maxHeight)
  514. {
  515. _ui.m_partsList.m_list.height = maxHeight;
  516. }
  517. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  518. {
  519. _ui.m_partsList.m_list.scrollPane.SetPosY(partsListScrollingPosY, false);
  520. partsListScrollingPosY = 0;
  521. }
  522. currentListType = DressUpListType.List3;
  523. GTween.To(_ui.target.width, partsListX, 0.5f)
  524. .SetTarget(_ui.m_partsList)
  525. .OnUpdate((GTweener t) =>
  526. {
  527. _ui.m_partsList.target.x = t.value.x;
  528. });
  529. UpdateBtnAction();
  530. UpdateListPartsSelected();
  531. return true;
  532. }
  533. private void hideListParts()
  534. {
  535. // _currentMenuType = 0;
  536. UpdateBtnAction();
  537. GTween.To(partsListX, _ui.target.width, 0.5f)
  538. .SetTarget(_ui.m_partsList)
  539. .OnUpdate((GTweener t) =>
  540. {
  541. _ui.m_partsList.target.x = t.value.x;
  542. });
  543. }
  544. private void showListParts2(int suitId)
  545. {
  546. _currentSuitId = suitId;
  547. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  548. if (_rarityIndex >= SORT_BY_GET_TIME)
  549. {
  550. _rarityIndex = SORT_BY_HIGH_RARITY;
  551. }
  552. this.UpdateSuitPartsListSort();
  553. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  554. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
  555. if (_ui.m_partsList2.m_list.height > maxHeight)
  556. {
  557. _ui.m_partsList2.m_list.height = maxHeight;
  558. }
  559. currentListType = DressUpListType.List4;
  560. GTween.To(_ui.target.width, partsListX, 0.5f)
  561. .SetTarget(_ui.m_partsList2)
  562. .OnUpdate((GTweener t) =>
  563. {
  564. _ui.m_partsList2.target.x = t.value.x;
  565. });
  566. UpdateBtnAction();
  567. }
  568. private void hideListParts2()
  569. {
  570. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  571. UpdateBtnAction();
  572. GTween.To(partsListX, _ui.target.width, 0.5f)
  573. .SetTarget(_ui.m_partsList2)
  574. .OnUpdate((GTweener t) =>
  575. {
  576. _ui.m_partsList2.target.x = t.value.x;
  577. });
  578. }
  579. private void showSearchListType()
  580. {
  581. // _currentList2 = null;
  582. currentListType = DressUpListType.List5;
  583. GTween.To(_ui.target.width, partsListX, 0.5f)
  584. .SetTarget(_ui.m_partsListSearch.target)
  585. .OnUpdate((GTweener t) =>
  586. {
  587. _ui.m_partsListSearch.target.x = t.value.x;
  588. });
  589. }
  590. private void hideSearchListType()
  591. {
  592. GTween.To(partsListX, _ui.target.width, 0.5f)
  593. .SetTarget(_ui.m_partsListSearch.target)
  594. .OnUpdate((GTweener t) =>
  595. {
  596. _ui.m_partsListSearch.target.x = t.value.x;
  597. });
  598. }
  599. /****************************************************************************************************************************/
  600. private void DressResetSerch()
  601. {
  602. if (currentListType == DressUpListType.List5)
  603. {
  604. OnTouchPad();
  605. }
  606. }
  607. private void UpdateSerch(EventContext context)
  608. {
  609. if (context.data.ToString() == ConstMessage.DRESS_SEARCH)
  610. {
  611. _currentList3 = DressUpMenuItemDataManager.DressSearch();
  612. }
  613. else if (context.data.ToString() == ConstMessage.DRESS_FILTER)
  614. {
  615. _currentList3 = DressUpMenuItemDataManager.DressFilter();
  616. }
  617. ViewManager.Hide<ModalStatusView>();
  618. UpdateSearchList();
  619. if (currentListType != DressUpListType.List5)
  620. {
  621. hideListParts();
  622. hideListParts2();
  623. hideListType1();
  624. hideListType2();
  625. showSearchListType();
  626. }
  627. _currentMenuType = 0;
  628. }
  629. private void UpdateSearchList()
  630. {
  631. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  632. {
  633. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList3);
  634. }
  635. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  636. {
  637. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList3);
  638. }
  639. _currentMenuType = 0;
  640. _ui.m_partsListSearch.m_list.numItems = _currentList3.Count; ;
  641. }
  642. private void ListType1Item(int index, GObject item)
  643. {
  644. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  645. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  646. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  647. typeItem.m_txtname.text = item1.name;
  648. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  649. typeItem.target.data = item1.id;
  650. typeItem.m_imgNeed.visible = false;
  651. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.id);
  652. UI_TypeItem.ProxyEnd();
  653. }
  654. private void ListType2Item(int index, GObject item)
  655. {
  656. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  657. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  658. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  659. typeItem.m_txtname.text = item2.name;
  660. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  661. typeItem.target.data = item2.id;
  662. typeItem.m_imgNeed.visible = false;
  663. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
  664. UI_TypeItem.ProxyEnd();
  665. }
  666. private void ListPartsItem(int index, GObject item)
  667. {
  668. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  669. int id = (int)_currentList3[index];
  670. string iconRes = "";
  671. string partName = "";
  672. string ext = "png";
  673. listItem.m_comAxtionSelect.target.visible = false;
  674. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  675. {
  676. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  677. iconRes = suitCfg.res;
  678. partName = suitCfg.name;
  679. listItem.m_iconSelected.visible = false;
  680. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  681. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  682. listItem.m_ScoreType.visible = false;
  683. listItem.m_imgNew.visible = false;
  684. listItem.m_comAxtionSelect.m_btnNormal.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  685. listItem.m_comAxtionSelect.m_btnAction.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  686. if (listItem.m_comAxtionSelect.m_btnNormal.data == null)
  687. {
  688. listItem.m_comAxtionSelect.m_btnNormal.onClick.Add(OnBtnNormalClick);
  689. }
  690. listItem.m_comAxtionSelect.m_btnNormal.data = id;
  691. if (listItem.m_comAxtionSelect.m_btnAction.data == null)
  692. {
  693. listItem.m_comAxtionSelect.m_btnAction.onClick.Add(OnBtnActionClick);
  694. }
  695. listItem.m_comAxtionSelect.m_btnAction.data = id;
  696. }
  697. else if (_currentMenuType == (int)ConstDressUpItemType.DONG_ZUO)
  698. {
  699. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  700. iconRes = suitCfg.res;
  701. partName = suitCfg.name;
  702. listItem.m_iconSelected.visible = false;
  703. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  704. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  705. listItem.m_ScoreType.visible = false;
  706. listItem.m_imgNew.visible = false;
  707. }
  708. else
  709. {
  710. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  711. iconRes = itemCfg.res;
  712. partName = itemCfg.name;
  713. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  714. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  715. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  716. // ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  717. listItem.m_ScoreType.visible = true;
  718. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + itemCfg.mainScore);
  719. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  720. listItem.m_imgNew.visible = isNew;
  721. if (isNew)
  722. {
  723. ItemProxy.ReqSetItemRead(id).Coroutine();
  724. }
  725. }
  726. if (listItem.target.data == null)
  727. {
  728. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  729. longPressGesture.once = true;
  730. longPressGesture.onAction.Add(OnLongPress);
  731. _listLongPress.Add(longPressGesture);
  732. }
  733. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  734. listItem.m_txtTitle.text = partName;
  735. listItem.target.data = id;
  736. listItem.m_grpScore.visible = false;
  737. //listItem.m_ScoreType.visible = true;
  738. listItem.m_imgNeed.visible = false;
  739. UI_PartsListItem.ProxyEnd();
  740. }
  741. private void ListParts2Item(int index, GObject item)
  742. {
  743. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  744. int id = (int)_currentList4[index];
  745. string iconRes = "";
  746. string partName = "";
  747. // string ext = "png";
  748. if (listItem.target.data == null)
  749. {
  750. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  751. longPressGesture.once = true;
  752. longPressGesture.onAction.Add(OnLongPress);
  753. _listLongPress.Add(longPressGesture);
  754. }
  755. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  756. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  757. iconRes = itemCfg != null ? itemCfg.res : suitCfg.res;
  758. partName = itemCfg != null ? itemCfg.name : suitCfg.name;
  759. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  760. bool isAction = MyDressUpHelper.dressUpObj.IsAction && SuitCfgArray.Instance.CheckActionContainsItem(id, MyDressUpHelper.dressUpObj.actionId);
  761. listItem.m_iconSelected.visible = isPutOn || isAction;
  762. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, itemCfg == null);
  763. listItem.m_ScoreType.visible = false;
  764. if (itemCfg != null)
  765. {
  766. listItem.m_ScoreType.visible = true;
  767. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + itemCfg.mainScore);
  768. }
  769. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, "png");
  770. listItem.m_txtTitle.text = partName;
  771. listItem.target.data = id;
  772. listItem.m_grpScore.visible = false;
  773. //listItem.m_ScoreType.visible = true;
  774. listItem.m_imgNeed.visible = false;
  775. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  776. listItem.m_imgNew.visible = isNew;
  777. if (isNew)
  778. {
  779. ItemProxy.ReqSetItemRead(id).Coroutine();
  780. }
  781. UI_PartsListItem.ProxyEnd();
  782. }
  783. private void UpdateListPartsSelected(int selectSuitId = 0)
  784. {
  785. int count = _ui.m_partsList.m_list.numChildren;
  786. int suitId = MyDressUpHelper.dressUpObj.suitId;
  787. for (int i = 0; i < count; i++)
  788. {
  789. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(i));
  790. int id = (int)listItem.target.data;
  791. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  792. {
  793. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  794. listItem.m_comAxtionSelect.target.visible = id == selectSuitId && SuitCfgArray.Instance.CheckSuitHasAction(id);
  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. }