DressUpView.cs 44 KB

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