DressUpView.cs 46 KB

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