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