DressUpView.cs 46 KB

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