DressUpView.cs 45 KB

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