DressUpView.cs 45 KB

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