DressUpView.cs 45 KB

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