DressUpView.cs 44 KB

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