DressUpView.cs 45 KB

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