DressUpView.cs 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  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 float partsListScrollingPosY = 0;
  20. private DressUpListType currentListType;
  21. /// <summary>
  22. /// 子菜单列表
  23. /// </summary>
  24. private int[] _currentList2;
  25. private GameObject _scenePrefab;
  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. public override void Dispose()
  37. {
  38. if (_sceneObject != null)
  39. {
  40. GameObject.Destroy(_sceneObject);
  41. _sceneObject = null;
  42. }
  43. for (int i = 0; i < _listLongPress.Count; i++)
  44. {
  45. _listLongPress[i].Dispose();
  46. }
  47. _listLongPress.Clear();
  48. if (_ui != null)
  49. {
  50. _ui.Dispose();
  51. _ui = null;
  52. }
  53. base.Dispose();
  54. }
  55. protected override void Init()
  56. {
  57. base.Init();
  58. packageName = UI_DressUpUI.PACKAGE_NAME;
  59. _ui = UI_DressUpUI.Create();
  60. viewCom = _ui.target;
  61. isfullScreen = true;
  62. _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
  63. }
  64. protected override void OnInit()
  65. {
  66. base.OnInit();
  67. _ui.m_btnLastStep.visible = true;
  68. _ui.m_btnNextStep.visible = true;
  69. _ui.m_btnSearch.visible = true;
  70. _ui.m_btnPhoto.visible = true;
  71. _ui.m_btnAction.visible = false;
  72. // _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
  73. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  74. _ui.m_partsListSearch.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  75. InitLists();
  76. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  77. _ui.m_btnHome.onClick.Add(OnClickBtnHome);
  78. _ui.m_btnLastStep.onClick.Add(OnClickBtnLastStep);
  79. _ui.m_btnNextStep.onClick.Add(OnClickBtnNextStep);
  80. _ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
  81. _ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
  82. _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
  83. // _ui.m_partsList.m_list.SetVirtual();
  84. _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
  85. _ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
  86. _ui.m_partsListSearch.m_list.onClickItem.Add(OnClickPartsListItem);
  87. _ui.m_touchPad.onClick.Add(OnTouchPad);
  88. _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
  89. _ui.m_btnSave.onClick.Add(OnClickBtnSave);
  90. _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
  91. _ui.m_partsListSearch.m_comboBoxRarity.onChanged.Add(OnSearchComboBoxRarityChanged);
  92. _ui.m_btnAction.onClick.Add(OnClickBtnAction);
  93. _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
  94. _ui.m_btnNext.onClick.Add(OnClickBtnNext);
  95. _ui.m_btnShow.onClick.Add(OnClickBtnShow);
  96. _ui.m_btnHide.onClick.Add(OnClickBtnHide);
  97. _ui.m_loaShow.onClick.Add(OnClickLoaShow);
  98. _ui.m_btnPhoto.onClick.Add(OnClickBtnPhoto);
  99. _ui.m_partsList2.m_comboBoxRarity.visible = false;
  100. _ui.m_partsList2.m_imgTop.visible = true;
  101. _ui.m_partsList.m_imgTop.visible = false;
  102. }
  103. private void InitLists()
  104. {
  105. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  106. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  107. _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
  108. _ui.m_partsListSearch.m_list.itemRenderer = ListPartsItem;
  109. listType1X = _ui.m_comListType1.target.x;
  110. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;// - DressUpView.RIGHT_BLANK;
  111. //一级菜单
  112. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  113. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  114. //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_comListType1.m_listType1.numItems);
  115. float maxHeight = _ui.target.height - _ui.m_comListType1.target.y - DressUpView.BOTTOM_BLANK;
  116. if (_ui.m_comListType1.m_listType.height > maxHeight)
  117. {
  118. _ui.m_comListType1.m_listType.height = maxHeight;
  119. }
  120. }
  121. protected override void AddEventListener()
  122. {
  123. base.AddEventListener();
  124. EventAgent.AddEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
  125. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  126. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
  127. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
  128. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  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. UpdateStepBtn(true);
  154. Timers.inst.AddUpdate(CheckGuide);
  155. }
  156. protected override void OnHide()
  157. {
  158. base.OnHide();
  159. listTypeItem_FreedomDress = null;
  160. // MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
  161. MyDressUpHelper.dressUpObj.TakeOffAll();
  162. if (_sceneObject != null)
  163. {
  164. GameObject.Destroy(_sceneObject);
  165. _sceneObject = null;
  166. }
  167. _ui.m_c2.selectedIndex = 0;
  168. Reset();
  169. Timers.inst.Remove(CheckGuide);
  170. }
  171. protected override void RemoveEventListener()
  172. {
  173. base.RemoveEventListener();
  174. EventAgent.RemoveEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
  175. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  176. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
  177. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
  178. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  179. }
  180. private void OnClickBtnBack()
  181. {
  182. Reset();
  183. // this.Hide();
  184. // ViewManager.Show(ViewName.MAINUI_VIEW);
  185. ViewManager.GoBackFrom(typeof(DressUpView).FullName);
  186. }
  187. private void OnClickBtnHome()
  188. {
  189. GameController.GoBackToMainView();
  190. Reset();
  191. }
  192. private void Reset()
  193. {
  194. DressUpMenuItemDataManager.Clear();
  195. MyDressUpHelper.ResetMemory();
  196. }
  197. private void OnClickBtnLastStep()
  198. {
  199. if (!MyDressUpHelper.OnClickBtnLastStep()) return;
  200. UpdateStepBtn(false);
  201. }
  202. private void OnClickBtnNextStep()
  203. {
  204. if (!MyDressUpHelper.OnClickBtnNextStep()) return;
  205. UpdateStepBtn(false);
  206. }
  207. private void OnComboBoxChanged()
  208. {
  209. if (_ui.m_comboBox.selectedIndex == currentIndex) return;
  210. if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
  211. {
  212. ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GOLD_CARD });
  213. _ui.m_comboBox.selectedIndex = currentIndex;
  214. return;
  215. }
  216. if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.BlackGold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold))
  217. {
  218. ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_BLACK_CARD });
  219. _ui.m_comboBox.selectedIndex = currentIndex;
  220. return;
  221. }
  222. currentIndex = _ui.m_comboBox.selectedIndex;
  223. MyDressUpHelper.PutOnSuitSavedByPos(_ui.m_comboBox.selectedIndex);
  224. UpdateStepBtn(true);
  225. }
  226. private void OnClickListType1Item(EventContext context)
  227. {
  228. GObject typeItem = (GObject)context.data as GObject;
  229. int order = (int)typeItem.data;
  230. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[order - 1];
  231. if (item1.subMenusArr.Length > 0)
  232. {
  233. this.showListType2(item1.subMenusArr);
  234. }
  235. else
  236. {
  237. if (this.showListParts(item1.type) == false)
  238. {
  239. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  240. return;
  241. }
  242. }
  243. this.hideListType1();
  244. UpdateListPartsSelected();
  245. }
  246. private void OnClickListType2Item(EventContext context)
  247. {
  248. GObject typeItem = (GObject)context.data as GObject;
  249. int order = (int)typeItem.data;
  250. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[order - 1];
  251. if (this.showListParts(item2.type) == false)
  252. {
  253. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  254. return;
  255. }
  256. this.hideListType2();
  257. }
  258. private void OnClickPartsListItem(EventContext context)
  259. {
  260. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  261. {
  262. return;
  263. }
  264. UI_PartsListItem listItem = UI_PartsListItem.Proxy(context.data as GObject);// (GObject)context.data as GObject;
  265. int id = (int)listItem.target.data;
  266. bool isDress = true;
  267. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  268. {
  269. isDress = false;
  270. partsListScrollingPosY = _ui.m_partsList.m_list.scrollPane.scrollingPosY;
  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 (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  531. {
  532. _ui.m_partsList.m_list.scrollPane.SetPosY(partsListScrollingPosY, false);
  533. partsListScrollingPosY = 0;
  534. }
  535. currentListType = DressUpListType.List3;
  536. GTween.To(_ui.target.width, partsListX, 0.5f)
  537. .SetTarget(_ui.m_partsList)
  538. .OnUpdate((GTweener t) =>
  539. {
  540. _ui.m_partsList.target.x = t.value.x;
  541. });
  542. UpdateBtnAction();
  543. UpdateListPartsSelected();
  544. return true;
  545. }
  546. private void hideListParts()
  547. {
  548. // _currentMenuType = 0;
  549. UpdateBtnAction();
  550. GTween.To(partsListX, _ui.target.width, 0.5f)
  551. .SetTarget(_ui.m_partsList)
  552. .OnUpdate((GTweener t) =>
  553. {
  554. _ui.m_partsList.target.x = t.value.x;
  555. });
  556. }
  557. private void showListParts2(int suitId)
  558. {
  559. _currentSuitId = suitId;
  560. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  561. if (_rarityIndex >= SORT_BY_GET_TIME)
  562. {
  563. _rarityIndex = SORT_BY_HIGH_RARITY;
  564. }
  565. this.UpdateSuitPartsListSort();
  566. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  567. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
  568. if (_ui.m_partsList2.m_list.height > maxHeight)
  569. {
  570. _ui.m_partsList2.m_list.height = maxHeight;
  571. }
  572. currentListType = DressUpListType.List4;
  573. GTween.To(_ui.target.width, partsListX, 0.5f)
  574. .SetTarget(_ui.m_partsList2)
  575. .OnUpdate((GTweener t) =>
  576. {
  577. _ui.m_partsList2.target.x = t.value.x;
  578. });
  579. UpdateBtnAction();
  580. }
  581. private void hideListParts2()
  582. {
  583. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  584. UpdateBtnAction();
  585. GTween.To(partsListX, _ui.target.width, 0.5f)
  586. .SetTarget(_ui.m_partsList2)
  587. .OnUpdate((GTweener t) =>
  588. {
  589. _ui.m_partsList2.target.x = t.value.x;
  590. });
  591. }
  592. private void showSearchListType()
  593. {
  594. // _currentList2 = null;
  595. currentListType = DressUpListType.List5;
  596. GTween.To(_ui.target.width, partsListX, 0.5f)
  597. .SetTarget(_ui.m_partsListSearch.target)
  598. .OnUpdate((GTweener t) =>
  599. {
  600. _ui.m_partsListSearch.target.x = t.value.x;
  601. });
  602. }
  603. private void hideSearchListType()
  604. {
  605. GTween.To(partsListX, _ui.target.width, 0.5f)
  606. .SetTarget(_ui.m_partsListSearch.target)
  607. .OnUpdate((GTweener t) =>
  608. {
  609. _ui.m_partsListSearch.target.x = t.value.x;
  610. });
  611. }
  612. /****************************************************************************************************************************/
  613. private void DressResetSerch()
  614. {
  615. if (currentListType == DressUpListType.List5)
  616. {
  617. OnTouchPad();
  618. }
  619. }
  620. private void UpdateSerch(EventContext context)
  621. {
  622. if (context.data.ToString() == ConstMessage.DRESS_SEARCH)
  623. {
  624. _currentList3 = DressUpMenuItemDataManager.DressSearch();
  625. }
  626. else if (context.data.ToString() == ConstMessage.DRESS_FILTER)
  627. {
  628. _currentList3 = DressUpMenuItemDataManager.DressFilter();
  629. }
  630. ViewManager.Hide<ModalStatusView>();
  631. UpdateSearchList();
  632. if (currentListType != DressUpListType.List5)
  633. {
  634. hideListParts();
  635. hideListParts2();
  636. hideListType1();
  637. hideListType2();
  638. showSearchListType();
  639. }
  640. _currentMenuType = 0;
  641. }
  642. private void UpdateSearchList()
  643. {
  644. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  645. {
  646. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList3);
  647. }
  648. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  649. {
  650. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList3);
  651. }
  652. _currentMenuType = 0;
  653. _ui.m_partsListSearch.m_list.numItems = _currentList3.Count; ;
  654. }
  655. private void ListType1Item(int index, GObject item)
  656. {
  657. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  658. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  659. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  660. typeItem.m_txtname.text = item1.name;
  661. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  662. typeItem.target.data = item1.id;
  663. typeItem.m_imgNeed.visible = false;
  664. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.id);
  665. UI_TypeItem.ProxyEnd();
  666. }
  667. private void ListType2Item(int index, GObject item)
  668. {
  669. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  670. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  671. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  672. typeItem.m_txtname.text = item2.name;
  673. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  674. typeItem.target.data = item2.id;
  675. typeItem.m_imgNeed.visible = false;
  676. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
  677. UI_TypeItem.ProxyEnd();
  678. }
  679. private void ListPartsItem(int index, GObject item)
  680. {
  681. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  682. int id = (int)_currentList3[index];
  683. string iconRes = "";
  684. string partName = "";
  685. string ext = "png";
  686. listItem.m_comAxtionSelect.target.visible = false;
  687. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  688. {
  689. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  690. iconRes = suitCfg.res;
  691. partName = suitCfg.name;
  692. listItem.m_iconSelected.visible = false;
  693. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  694. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  695. listItem.m_ScoreType.visible = false;
  696. listItem.m_imgNew.visible = false;
  697. listItem.m_comAxtionSelect.m_btnNormal.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  698. listItem.m_comAxtionSelect.m_btnAction.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  699. if (listItem.m_comAxtionSelect.m_btnNormal.data == null)
  700. {
  701. listItem.m_comAxtionSelect.m_btnNormal.onClick.Add(OnBtnNormalClick);
  702. }
  703. listItem.m_comAxtionSelect.m_btnNormal.data = id;
  704. if (listItem.m_comAxtionSelect.m_btnAction.data == null)
  705. {
  706. listItem.m_comAxtionSelect.m_btnAction.onClick.Add(OnBtnActionClick);
  707. }
  708. listItem.m_comAxtionSelect.m_btnAction.data = id;
  709. }
  710. else if (_currentMenuType == (int)ConstDressUpItemType.DONG_ZUO)
  711. {
  712. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  713. iconRes = suitCfg.res;
  714. partName = suitCfg.name;
  715. listItem.m_iconSelected.visible = false;
  716. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  717. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  718. listItem.m_ScoreType.visible = false;
  719. listItem.m_imgNew.visible = false;
  720. }
  721. else
  722. {
  723. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  724. iconRes = itemCfg.res;
  725. partName = itemCfg.name;
  726. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  727. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  728. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  729. // ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  730. listItem.m_ScoreType.visible = true;
  731. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + itemCfg.mainScore);
  732. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  733. listItem.m_imgNew.visible = isNew;
  734. if (isNew)
  735. {
  736. ItemProxy.ReqSetItemRead(id).Coroutine();
  737. }
  738. }
  739. if (listItem.target.data == null)
  740. {
  741. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  742. longPressGesture.once = true;
  743. longPressGesture.onAction.Add(OnLongPress);
  744. _listLongPress.Add(longPressGesture);
  745. }
  746. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  747. listItem.m_txtTitle.text = partName;
  748. listItem.target.data = id;
  749. listItem.m_grpScore.visible = false;
  750. //listItem.m_ScoreType.visible = true;
  751. listItem.m_imgNeed.visible = false;
  752. UI_PartsListItem.ProxyEnd();
  753. }
  754. private void ListParts2Item(int index, GObject item)
  755. {
  756. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  757. int id = (int)_currentList4[index];
  758. string iconRes = "";
  759. string partName = "";
  760. // string ext = "png";
  761. if (listItem.target.data == null)
  762. {
  763. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  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_icon.url = ResPathUtil.GetIconPath(iconRes, "png");
  783. listItem.m_txtTitle.text = partName;
  784. listItem.target.data = id;
  785. listItem.m_grpScore.visible = false;
  786. //listItem.m_ScoreType.visible = true;
  787. listItem.m_imgNeed.visible = false;
  788. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  789. listItem.m_imgNew.visible = isNew;
  790. if (isNew)
  791. {
  792. ItemProxy.ReqSetItemRead(id).Coroutine();
  793. }
  794. UI_PartsListItem.ProxyEnd();
  795. }
  796. private void UpdateListPartsSelected(int selectSuitId = 0)
  797. {
  798. int count = _ui.m_partsList.m_list.numChildren;
  799. int suitId = MyDressUpHelper.dressUpObj.suitId;
  800. for (int i = 0; i < count; i++)
  801. {
  802. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(i));
  803. int id = (int)listItem.target.data;
  804. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  805. {
  806. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  807. listItem.m_comAxtionSelect.target.visible = id == selectSuitId && SuitCfgArray.Instance.CheckSuitHasAction(id);
  808. }
  809. else if (_currentMenuType == ConstDressUpItemType.DONG_ZUO)
  810. {
  811. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.IsAction && MyDressUpHelper.dressUpObj.actionId == id;
  812. }
  813. else
  814. {
  815. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  816. bool isAction = MyDressUpHelper.dressUpObj.IsAction && SuitCfgArray.Instance.CheckActionContainsItem(id, MyDressUpHelper.dressUpObj.actionId);
  817. listItem.m_iconSelected.visible = isPutOn || isAction;
  818. }
  819. UI_PartsListItem.ProxyEnd();
  820. }
  821. }
  822. private void UpdateListSuitPartsSelected()
  823. {
  824. int count = _ui.m_partsList2.m_list.numChildren;
  825. for (int i = 0; i < count; i++)
  826. {
  827. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  828. int id = (int)listItem.target.data;
  829. bool isSuitSelect = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//可换部件是否穿戴
  830. bool isActionSelect = MyDressUpHelper.dressUpObj.actionId == id;
  831. listItem.m_iconSelected.visible = isSuitSelect || isActionSelect;
  832. UI_PartsListItem.ProxyEnd();
  833. }
  834. }
  835. private void UpdatePartsListSort()
  836. {
  837. if (_currentMenuType == 0) return;
  838. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  839. {
  840. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  841. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  842. {
  843. _currentList3 = SuitUtil.SortSuitListByHighRarity(_currentList3);
  844. }
  845. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  846. {
  847. _currentList3 = SuitUtil.SortSuitListByLowRarity(_currentList3);
  848. }
  849. else
  850. {
  851. _currentList3.Reverse();
  852. }
  853. }
  854. else if (_currentMenuType == (int)ConstDressUpItemType.DONG_ZUO)
  855. {
  856. _currentList3 = DressUpMenuSuitDataManager.GetActionIDList();
  857. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  858. {
  859. _currentList3 = SuitUtil.SortSuitListByHighRarity(_currentList3);
  860. }
  861. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  862. {
  863. _currentList3 = SuitUtil.SortSuitListByLowRarity(_currentList3);
  864. }
  865. else
  866. {
  867. _currentList3.Reverse();
  868. }
  869. }
  870. else
  871. {
  872. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  873. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  874. {
  875. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList3);
  876. }
  877. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  878. {
  879. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList3);
  880. }
  881. else
  882. {
  883. _currentList3.Reverse();
  884. }
  885. }
  886. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  887. // {
  888. // _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3);
  889. // }
  890. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  891. // {
  892. // _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3);
  893. // }
  894. _ui.m_partsList.m_list.RemoveChildrenToPool();
  895. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  896. }
  897. private void UpdateSuitPartsListSort()
  898. {
  899. if (_currentMenuType == 0) return;
  900. if (_isNormalSuitType)
  901. {
  902. _currentList4 = new List<int>(SuitCfgArray.Instance.GetSuitItems(_currentSuitId));
  903. }
  904. else
  905. {
  906. _currentList4 = SuitCfgArray.Instance.GetOneSuitAllNotActionParts(_currentSuitId);
  907. _currentList4.Add(_currentSuitId);
  908. }
  909. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  910. // {
  911. // _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4);
  912. // }
  913. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  914. // {
  915. // _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4);
  916. // }
  917. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  918. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  919. }
  920. private void UpdateBtnAction()
  921. {
  922. // _ui.m_btnAction.visible = (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG) || this.currentListType == DressUpListType.List4;
  923. // if (_ui.m_btnAction.visible)
  924. // {
  925. //_ui.m_btnAction.grayed = !EquipDataCache.cacher.HasSuitActionRes;
  926. // }
  927. }
  928. private void OnClickBtnShow()
  929. {
  930. Timers.inst.Remove(SetBtnShowVisable);
  931. _ui.m_c1.selectedIndex = 0;
  932. _ui.m_btnHide.visible = true;
  933. _ui.m_btnShow.visible = false;
  934. _ui.m_loaShow.visible = false;
  935. }
  936. private void OnClickBtnHide()
  937. {
  938. _ui.m_c1.selectedIndex = 1;
  939. _ui.m_btnHide.visible = false;
  940. _ui.m_btnShow.visible = true;
  941. _ui.m_loaShow.visible = true;
  942. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  943. }
  944. private void OnClickLoaShow()
  945. {
  946. _ui.m_btnShow.alpha = 1;
  947. _ui.m_btnShow.enabled = true;
  948. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  949. }
  950. private void OnClickBtnPhoto()
  951. {
  952. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.PAI_ZHAO, 1);
  953. if (!ViewManager.Show<PhotographView>())
  954. {
  955. return;
  956. }
  957. _ui.target.visible = false;
  958. this._sceneObject.gameObject.SetActive(false);
  959. }
  960. private void OnClickBtnNext()
  961. {
  962. // if (!EquipDataCache.cacher.CheckPutOnFinish())
  963. // {
  964. // AlertUI.Show("只有换好衣服才能出门哦!")
  965. // .SetRightButton(true, "好的");
  966. // return;
  967. // }
  968. if (!ViewManager.Show<PhotographView>(this.viewData))
  969. {
  970. return;
  971. }
  972. _ui.target.visible = false;
  973. this._sceneObject.gameObject.SetActive(false);
  974. }
  975. private void UpdateScene()
  976. {
  977. _ui.target.visible = true;
  978. this._sceneObject.gameObject.SetActive(true);
  979. }
  980. private void SetBtnShowVisable(object param)
  981. {
  982. _ui.m_btnShow.enabled = false;
  983. GTween.To(1, 0, 0.3f).SetTarget(_ui.m_btnShow, TweenPropType.Alpha);
  984. }
  985. private bool CheckListCount(int type)
  986. {
  987. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  988. {
  989. return DressUpMenuSuitDataManager.GetSuitIDList().Count > 0;
  990. }
  991. else
  992. {
  993. return DressUpMenuItemDataManager.getItemDatasByType(type).Count > 0;
  994. }
  995. }
  996. private void CheckGuide(object param)
  997. {
  998. if (GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0
  999. || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER) <= 0)
  1000. {
  1001. UpdateToCheckGuide(null);
  1002. }
  1003. else
  1004. {
  1005. Timers.inst.Remove(CheckGuide);
  1006. }
  1007. }
  1008. protected override void UpdateToCheckGuide(object param)
  1009. {
  1010. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  1011. if (listTypeItem_FreedomDress == null && GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0)
  1012. {
  1013. int len = _ui.m_comListType1.m_listType.numChildren;
  1014. for (int i = 0; i < len; i++)
  1015. {
  1016. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  1017. if (item != null)
  1018. {
  1019. int menuID = (int)item.target.data;
  1020. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  1021. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
  1022. {
  1023. listTypeItem_FreedomDress = item;
  1024. _ui.m_comListType1.m_listType.ScrollToView(i);
  1025. break;
  1026. }
  1027. }
  1028. UI_TypeItem.ProxyEnd();
  1029. }
  1030. }
  1031. if (listTypeItem_FreedomDress != null) GuideController.TryGuide(listTypeItem_FreedomDress.target, ConstGuideId.FREEDOM_DRESS, 3, "套装分类里,可以查看集齐成套的服饰,点击一键换上。");
  1032. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.FREEDOM_DRESS, 4, "", 0);
  1033. // if (_ui.m_partsList.m_list.numItems > 0)
  1034. // {
  1035. // UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(0).asCom);
  1036. // GuideController.TryGuide(listItem.m_comAxtionSelect.m_btnAction, ConstGuideId.FREEDOM_DRESS, 5, "选择特殊动作并穿上。");
  1037. // UI_PartsListItem.ProxyEnd();
  1038. // }
  1039. GuideController.TryGuide(_ui.m_btnSave, ConstGuideId.FREEDOM_DRESS, 5, "搭配好的服饰,可以保存到主界面显示。");
  1040. GuideController.TryGuide(_ui.m_btnPhoto, ConstGuideId.FREEDOM_DRESS, 6, "辛苦搭配完,去拍个照片留念呀~~");
  1041. GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.ENTER_CHAPTER, 2, "");
  1042. }
  1043. }
  1044. }