DressUpView.cs 45 KB

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