DressUpView.cs 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  1. using UI.DressUp;
  2. using FairyGUI;
  3. using UnityEngine;
  4. using System.Collections.Generic;
  5. using ET;
  6. using System;
  7. namespace GFGGame
  8. {
  9. public class DressUpView : BaseView
  10. {
  11. public const int MAX_MEMORY_STEP = 20;//最大记录步数
  12. public const int BOTTOM_BLANK = 20;
  13. public const int RIGHT_BLANK = 36;
  14. private const int SORT_BY_HIGH_RARITY = 0;
  15. private const int SORT_BY_LOW_RARITY = 1;
  16. private const int SORT_BY_GET_TIME = 2;
  17. private UI_DressUpUI _ui;
  18. private float listType1X = 0;
  19. private float partsListX = 0;
  20. private float partsListScrollingPosY = 0;
  21. private DressUpListType currentListType;
  22. /// <summary>
  23. /// 子菜单列表
  24. /// </summary>
  25. private int[] _currentList2;
  26. private GameObject _sceneObject;
  27. private List<int> _currentList3 = new List<int>();
  28. private List<int> _currentList4 = new List<int>();
  29. private int _currentMenuType;
  30. private int _currentSuitId;
  31. private bool _isNormalSuitType = false;//当前套装部件列表是否为普通动作列表
  32. private int _rarityIndex = SORT_BY_HIGH_RARITY;
  33. private UI_TypeItem listTypeItem_FreedomDress;
  34. private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
  35. private int currentIndex = 0;
  36. //用于记录任意列表是否滚动,来阻断长按事件
  37. private bool listScrolled = false;
  38. //用来阻断长按后的点击事件
  39. private bool longPressed = false;
  40. public override void Dispose()
  41. {
  42. if (_sceneObject != null)
  43. {
  44. PrefabManager.Instance.Restore(_sceneObject);
  45. _sceneObject = null;
  46. }
  47. for (int i = 0; i < _listLongPress.Count; i++)
  48. {
  49. _listLongPress[i].Dispose();
  50. }
  51. _listLongPress.Clear();
  52. if (_ui != null)
  53. {
  54. _ui.Dispose();
  55. _ui = null;
  56. }
  57. base.Dispose();
  58. }
  59. protected override void Init()
  60. {
  61. base.Init();
  62. packageName = UI_DressUpUI.PACKAGE_NAME;
  63. _ui = UI_DressUpUI.Create();
  64. viewCom = _ui.target;
  65. isfullScreen = true;
  66. isReturnView = true;
  67. }
  68. protected override void OnInit()
  69. {
  70. base.OnInit();
  71. _ui.m_btnLastStep.visible = true;
  72. _ui.m_btnNextStep.visible = true;
  73. _ui.m_btnSearch.visible = true;
  74. _ui.m_btnPhoto.visible = true;
  75. _ui.m_btnAction.visible = false;
  76. // _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
  77. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  78. _ui.m_partsListSearch.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  79. InitLists();
  80. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  81. _ui.m_btnHome.onClick.Add(OnClickBtnHome);
  82. _ui.m_btnLastStep.onClick.Add(OnClickBtnLastStep);
  83. _ui.m_btnNextStep.onClick.Add(OnClickBtnNextStep);
  84. _ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
  85. _ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
  86. _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
  87. // _ui.m_partsList.m_list.SetVirtual();
  88. // _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
  89. _ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
  90. // _ui.m_partsListSearch.m_list.onClickItem.Add(OnClickPartsListItem);
  91. _ui.m_touchPad.onClick.Add(OnTouchPad);
  92. _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
  93. _ui.m_btnSave.onClick.Add(OnClickBtnSave);
  94. _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
  95. _ui.m_partsListSearch.m_comboBoxRarity.onChanged.Add(OnSearchComboBoxRarityChanged);
  96. _ui.m_btnAction.onClick.Add(OnClickBtnAction);
  97. _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
  98. _ui.m_btnNext.onClick.Add(OnClickBtnNext);
  99. _ui.m_btnShow.onClick.Add(OnClickBtnShow);
  100. _ui.m_btnHide.onClick.Add(OnClickBtnHide);
  101. _ui.m_loaShow.onClick.Add(OnClickLoaShow);
  102. _ui.m_btnPhoto.onClick.Add(OnClickBtnPhoto);
  103. _ui.m_partsList2.m_comboBoxRarity.visible = false;
  104. _ui.m_partsList2.m_imgTop.visible = true;
  105. _ui.m_partsList.m_imgTop.visible = false;
  106. _ui.m_partsList.m_list.scrollPane.onScroll.Add(OnListScroll);
  107. GRoot.inst.onTouchBegin.Add(onTouchBegin);
  108. }
  109. private void onTouchBegin(EventContext context)
  110. {
  111. //LogUtil.LogEditor("onTouchBegin");
  112. listScrolled = false;
  113. longPressed = false;
  114. }
  115. private void OnListScroll(EventContext context)
  116. {
  117. //LogUtil.LogEditor("OnListScroll");
  118. listScrolled = true;
  119. }
  120. private void InitLists()
  121. {
  122. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  123. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  124. _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
  125. _ui.m_partsListSearch.m_list.itemRenderer = ListPartsItem;
  126. listType1X = _ui.m_comListType1.target.x;
  127. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;// - DressUpView.RIGHT_BLANK;
  128. //一级菜单
  129. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  130. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  131. //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_comListType1.m_listType1.numItems);
  132. float maxHeight = _ui.target.height - _ui.m_comListType1.target.y - DressUpView.BOTTOM_BLANK;
  133. if (_ui.m_comListType1.m_listType.height > maxHeight)
  134. {
  135. _ui.m_comListType1.m_listType.height = maxHeight;
  136. }
  137. }
  138. protected override void AddEventListener()
  139. {
  140. base.AddEventListener();
  141. EventAgent.AddEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
  142. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  143. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdateSearch);
  144. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSearch);
  145. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  146. }
  147. protected override void OnShown()
  148. {
  149. base.OnShown();
  150. if (this.viewData != null)
  151. {
  152. _ui.m_c2.selectedIndex = (int)this.viewData;
  153. }
  154. _rarityIndex = SORT_BY_HIGH_RARITY;
  155. // MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DRESS_UP, "mp3"));
  156. _ui.m_comListType1.target.x = _ui.target.width;
  157. _ui.m_comListType2.target.x = _ui.target.width;
  158. _ui.m_partsList.target.x = _ui.target.width;
  159. _ui.m_partsList2.target.x = _ui.target.width;
  160. _ui.m_partsListSearch.target.x = _ui.target.width;
  161. this.showListType1();
  162. if (_sceneObject == null)
  163. {
  164. _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("SceneDressUp"));
  165. }
  166. MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, true, null, true, ScaleGestureController.Instance.UpdatePos);
  167. currentIndex = CustomSuitDataManager.currentIndex;
  168. _ui.m_comboBox.items = CustomSuitDataManager.GetSuitPosItems();
  169. _ui.m_comboBox.selectedIndex = currentIndex;
  170. MyDressUpHelper.PutOnSuitSavedByPos(currentIndex);
  171. UpdateStepBtn(true);
  172. Timers.inst.AddUpdate(CheckGuide);
  173. ScaleGestureController.Instance.target = _sceneObject.transform;
  174. ScaleGestureController.Instance.uiSize = _ui.target.size;
  175. }
  176. protected override void OnHide()
  177. {
  178. base.OnHide();
  179. listTypeItem_FreedomDress = null;
  180. // MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
  181. MyDressUpHelper.dressUpObj.TakeOffAll();
  182. DressUpMenuItemDataManager.Clear();
  183. if (_sceneObject != null)
  184. {
  185. PrefabManager.Instance.Restore(_sceneObject);
  186. _sceneObject = null;
  187. //MyDressUpHelper.dressUpObj.ClearView();
  188. }
  189. _ui.m_c2.selectedIndex = 0;
  190. Reset();
  191. Timers.inst.Remove(CheckGuide);
  192. ScaleGestureController.Instance.target = null;
  193. // 清空服装过滤界面选择
  194. EventAgent.DispatchEvent(ConstMessage.DRESS_FILTER_RESET_ALL);
  195. }
  196. protected override void RemoveEventListener()
  197. {
  198. base.RemoveEventListener();
  199. EventAgent.RemoveEventListener(ConstMessage.CLOSE_PHOTOGRAPHVIEW, UpdateScene);
  200. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  201. EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdateSearch);
  202. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdateSearch);
  203. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  204. }
  205. private void OnClickBtnBack()
  206. {
  207. Reset();
  208. // this.Hide();
  209. //ViewManager.Show<MainUIView>();
  210. ViewManager.GoBackFrom(typeof(DressUpView).FullName);
  211. }
  212. private void OnClickBtnHome()
  213. {
  214. GameController.GoBackToMainView();
  215. Reset();
  216. }
  217. private void Reset()
  218. {
  219. DressUpMenuItemDataManager.Clear();
  220. MyDressUpHelper.ResetMemory();
  221. }
  222. private void OnClickBtnLastStep()
  223. {
  224. if (!MyDressUpHelper.OnClickBtnLastStep()) return;
  225. UpdateStepBtn(false);
  226. }
  227. private void OnClickBtnNextStep()
  228. {
  229. if (!MyDressUpHelper.OnClickBtnNextStep()) return;
  230. UpdateStepBtn(false);
  231. }
  232. private void OnComboBoxChanged()
  233. {
  234. if (_ui.m_comboBox.selectedIndex == currentIndex) return;
  235. if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
  236. {
  237. ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GOLD_CARD });
  238. _ui.m_comboBox.selectedIndex = currentIndex;
  239. return;
  240. }
  241. if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.BlackGold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold))
  242. {
  243. ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_BLACK_CARD });
  244. _ui.m_comboBox.selectedIndex = currentIndex;
  245. return;
  246. }
  247. currentIndex = _ui.m_comboBox.selectedIndex;
  248. MyDressUpHelper.PutOnSuitSavedByPos(_ui.m_comboBox.selectedIndex);
  249. UpdateStepBtn(true);
  250. }
  251. private void OnClickListType1Item(EventContext context)
  252. {
  253. GObject typeItem = (GObject)context.data as GObject;
  254. int order = (int)typeItem.data;
  255. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[order - 1];
  256. if (item1.subMenusArr.Length > 0)
  257. {
  258. this.showListType2(item1.subMenusArr);
  259. }
  260. else
  261. {
  262. if (this.showListParts(item1.type) == false)
  263. {
  264. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  265. return;
  266. }
  267. }
  268. this.hideListType1();
  269. UpdateListPartsSelected();
  270. }
  271. private void OnClickListType2Item(EventContext context)
  272. {
  273. GObject typeItem = (GObject)context.data as GObject;
  274. int order = (int)typeItem.data;
  275. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[order - 1];
  276. if (this.showListParts(item2.type) == false)
  277. {
  278. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  279. return;
  280. }
  281. this.hideListType2();
  282. }
  283. private void OnClickPartsListItem(EventContext context)
  284. {
  285. //LogUtil.LogEditor("OnClickPartsListItem");
  286. if (longPressed) return;
  287. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  288. {
  289. return;
  290. }
  291. int id = (int)(context.sender as GObject).data;
  292. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  293. {
  294. partsListScrollingPosY = _ui.m_partsList.m_list.scrollPane.scrollingPosY;
  295. OnBtnNormalClick(context);
  296. }
  297. else if (_currentMenuType == ConstDressUpItemType.DONG_ZUO)
  298. {
  299. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(id);
  300. }
  301. else
  302. {
  303. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  304. }
  305. UpdateStepBtn(true, id);
  306. }
  307. private void OnBtnNormalClick(EventContext context)
  308. {
  309. // _isNormalSuitType = true;
  310. GObject gObject = context.sender as GObject;
  311. int suitId = (int)gObject.data;
  312. ShowSuitPartList(suitId, false);
  313. }
  314. private void OnBtnActionClick(EventContext context)
  315. {
  316. if (longPressed) return;
  317. // _isNormalSuitType = false;
  318. GObject gObject = context.sender as GObject;
  319. int suitId = (int)gObject.data;
  320. partsListScrollingPosY = _ui.m_partsList.m_list.scrollPane.scrollingPosY;
  321. ShowSuitPartList(suitId, true);
  322. }
  323. private void ShowSuitPartList(int suitId, bool showAction)
  324. {
  325. _isNormalSuitType = !showAction;
  326. this.showListParts2(suitId);
  327. this.hideListParts();
  328. if (showAction)
  329. {
  330. MyDressUpHelper.dressUpObj.PutOnSuitCfg(suitId, true);
  331. }
  332. else
  333. {
  334. MyDressUpHelper.dressUpObj.PutOnSuitCfg(suitId, false);
  335. }
  336. UpdateStepBtn(true);
  337. }
  338. private void OnClickSuitPartsListItem(EventContext context)
  339. {
  340. if (longPressed) return;
  341. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  342. {
  343. return;
  344. }
  345. GObject listItem = (GObject)context.data as GObject;
  346. int id = (int)listItem.data;
  347. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  348. if (itemCfg != null)
  349. {
  350. if (!DressUpMenuItemDataManager.CheckHasItem(itemCfg.id))
  351. {
  352. PromptController.Instance.ShowFloatTextPrompt("还未获得这件装扮");
  353. return;
  354. }
  355. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  356. }
  357. else
  358. {
  359. MyDressUpHelper.dressUpObj.PutOnOrTakeOffAction(id);
  360. }
  361. UpdateStepBtn(true);
  362. // UpdateListSuitPartsSelected();
  363. }
  364. private void UpdateStepBtn(bool isAdd, int suitId = 0)
  365. {
  366. if (isAdd)
  367. {
  368. MyDressUpHelper.AddMemoryDressup();
  369. }
  370. _ui.m_btnLastStep.enabled = MyDressUpHelper.stepIndex > 0;
  371. _ui.m_btnNextStep.enabled = MyDressUpHelper.stepIndex < MyDressUpHelper.dressMemory.Count - 1;
  372. UpdateListPartsSelected(suitId);
  373. UpdateListSuitPartsSelected();
  374. }
  375. private void OnLongPress(EventContext context)
  376. {
  377. //LogUtil.LogEditor($"OnLongPress {listScrolled}");
  378. if (listScrolled) return;
  379. longPressed = true;
  380. LongPressGesture gesture = (LongPressGesture)context.sender;
  381. int itemId = (int)gesture.host.data;
  382. GoodsItemTipsController.ShowItemTips(itemId);
  383. }
  384. private void OnTouchPad()
  385. {
  386. if (this.currentListType == DressUpListType.List4)
  387. {
  388. this.hideListParts2();
  389. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  390. }
  391. else if (this.currentListType == DressUpListType.List3)
  392. {
  393. if (_currentList2 != null)
  394. {
  395. this.showListType2(_currentList2);
  396. // _ui.m_comListType2.m_listType.numItems = _ui.m_comListType2.m_listType.numItems;
  397. }
  398. else
  399. {
  400. this.showListType1();
  401. }
  402. this.hideListParts();
  403. }
  404. else if (this.currentListType == DressUpListType.List2)
  405. {
  406. this.showListType1();
  407. this.hideListType2();
  408. }
  409. else if (this.currentListType == DressUpListType.List4)
  410. {
  411. this.showListType1();
  412. this.hideListType2();
  413. }
  414. else if (this.currentListType == DressUpListType.List5)
  415. {
  416. this.showListType1();
  417. this.hideSearchListType();
  418. }
  419. // _ui.m_comListType1.m_listType.numItems = _ui.m_comListType1.m_listType.numItems;
  420. // this.ShowSubList();
  421. }
  422. private void OnClickBtnDelete()
  423. {
  424. MyDressUpHelper.dressUpObj.TakeOffAll();
  425. MyDressUpHelper.dressUpObj.AddOrRemove(ConstItemID.DEFULT_BG, false);
  426. UpdateBtnAction();
  427. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  428. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  429. UpdateStepBtn(true);
  430. }
  431. private void OnClickBtnSave()
  432. {
  433. CustomSuitDataManager.SaveCurrentSuit(_ui.m_comboBox.selectedIndex);
  434. RoleDataManager.CheckSaveDressUpBgToMainBg(MyDressUpHelper.dressUpObj.bgId);
  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);
  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 UpdateSearch(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_btnAni.visible = false;
  687. Debug.Log("id:" + id + " _currentMenuType:" + _currentMenuType);
  688. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  689. {
  690. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  691. iconRes = suitCfg.res;
  692. partName = suitCfg.name;
  693. listItem.m_iconSelected.visible = false;
  694. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  695. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  696. listItem.m_ScoreType.visible = false;
  697. listItem.m_imgNew.visible = false;
  698. bool SuitHasAction = SuitCfgArray.Instance.CheckSuitHasAction(id);
  699. bool HasActionRes = DressUpMenuSuitDataManager.CheckSuitHasActionRes(id);
  700. Debug.Log("SuitHasAction:" + SuitHasAction + " HasActionRes:" + HasActionRes + " suitCfg.res" + suitCfg.aniRes);
  701. listItem.m_btnAni.visible = SuitCfgArray.Instance.CheckSuitHasAction(id) && DressUpMenuSuitDataManager.CheckSuitHasActionRes(id);
  702. // listItem.m_comAxtionSelect.m_btnNormal.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  703. // listItem.m_comAxtionSelect.m_btnAction.icon = ResPathUtil.GetIconPath(suitCfg.res, ext);
  704. if (listItem.m_btnAni.data == null)
  705. {
  706. listItem.m_btnAni.onClick.Add(OnBtnActionClick);
  707. }
  708. listItem.m_btnAni.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.m_icon.data == null)
  740. {
  741. listItem.m_icon.onClick.Add(OnClickPartsListItem);
  742. }
  743. listItem.m_icon.data = id;
  744. if (listItem.target.data == null)
  745. {
  746. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  747. longPressGesture.trigger = GameConfig.LongPressGestureTrigger;
  748. longPressGesture.once = true;
  749. longPressGesture.onAction.Add(OnLongPress);
  750. _listLongPress.Add(longPressGesture);
  751. }
  752. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  753. listItem.m_txtTitle.text = partName;
  754. listItem.target.data = id;
  755. listItem.m_grpScore.visible = false;
  756. //listItem.m_ScoreType.visible = true;
  757. listItem.m_imgNeed.visible = false;
  758. UI_PartsListItem.ProxyEnd();
  759. }
  760. private void ListParts2Item(int index, GObject item)
  761. {
  762. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  763. int id = (int)_currentList4[index];
  764. string iconRes = "";
  765. string partName = "";
  766. // string ext = "png";
  767. if (listItem.target.data == null)
  768. {
  769. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  770. longPressGesture.trigger = GameConfig.LongPressGestureTrigger;
  771. longPressGesture.once = true;
  772. longPressGesture.onAction.Add(OnLongPress);
  773. _listLongPress.Add(longPressGesture);
  774. }
  775. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  776. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  777. iconRes = itemCfg != null ? itemCfg.res : suitCfg.res;
  778. partName = itemCfg != null ? itemCfg.name : suitCfg.name;
  779. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  780. bool isAction = MyDressUpHelper.dressUpObj.IsAction && SuitCfgArray.Instance.CheckActionContainsItem(id, MyDressUpHelper.dressUpObj.actionId);
  781. listItem.m_iconSelected.visible = isPutOn || isAction;
  782. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, itemCfg == null);
  783. listItem.m_ScoreType.visible = false;
  784. if (itemCfg != null)
  785. {
  786. listItem.m_ScoreType.visible = true;
  787. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + itemCfg.mainScore);
  788. }
  789. listItem.m_btnAni.visible = false;
  790. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, "png");
  791. listItem.m_txtTitle.text = partName;
  792. listItem.target.data = id;
  793. listItem.m_grpScore.visible = false;
  794. //listItem.m_ScoreType.visible = true;
  795. listItem.m_imgNeed.visible = false;
  796. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  797. listItem.m_imgNew.visible = isNew;
  798. if (isNew)
  799. {
  800. ItemProxy.ReqSetItemRead(id).Coroutine();
  801. }
  802. UI_PartsListItem.ProxyEnd();
  803. }
  804. private void UpdateListPartsSelected(int selectSuitId = 0)
  805. {
  806. GList list;
  807. if (_ui.m_partsList.target.x == partsListX)
  808. {
  809. list = _ui.m_partsList.m_list;
  810. }
  811. else if (_ui.m_partsListSearch.target.x == partsListX)
  812. {
  813. list = _ui.m_partsListSearch.m_list;
  814. }
  815. else
  816. {
  817. return;
  818. }
  819. int count = list.numChildren;
  820. int suitId = MyDressUpHelper.dressUpObj.suitId;
  821. for (int i = 0; i < count; i++)
  822. {
  823. UI_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(i));
  824. int id = (int)listItem.target.data;
  825. if (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG)
  826. {
  827. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  828. }
  829. else if (_currentMenuType == ConstDressUpItemType.DONG_ZUO)
  830. {
  831. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.IsAction && MyDressUpHelper.dressUpObj.actionId == id;
  832. }
  833. else
  834. {
  835. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  836. bool isAction = MyDressUpHelper.dressUpObj.IsAction && SuitCfgArray.Instance.CheckActionContainsItem(id, MyDressUpHelper.dressUpObj.actionId);
  837. listItem.m_iconSelected.visible = isPutOn || isAction;
  838. }
  839. UI_PartsListItem.ProxyEnd();
  840. }
  841. }
  842. private void UpdateListSuitPartsSelected()
  843. {
  844. int count = _ui.m_partsList2.m_list.numChildren;
  845. for (int i = 0; i < count; i++)
  846. {
  847. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  848. int id = (int)listItem.target.data;
  849. bool isSuitSelect = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//可换部件是否穿戴
  850. bool isActionSelect = MyDressUpHelper.dressUpObj.actionId == id;
  851. listItem.m_iconSelected.visible = isSuitSelect || isActionSelect;
  852. UI_PartsListItem.ProxyEnd();
  853. }
  854. }
  855. private void UpdatePartsListSort()
  856. {
  857. if (_currentMenuType == 0) return;
  858. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  859. {
  860. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  861. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  862. {
  863. _currentList3 = SuitUtil.SortSuitListByHighRarity(_currentList3);
  864. }
  865. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  866. {
  867. _currentList3 = SuitUtil.SortSuitListByLowRarity(_currentList3);
  868. }
  869. else
  870. {
  871. _currentList3.Reverse();
  872. }
  873. }
  874. else if (_currentMenuType == (int)ConstDressUpItemType.DONG_ZUO)
  875. {
  876. _currentList3 = DressUpMenuSuitDataManager.GetActionIDList();
  877. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  878. {
  879. _currentList3 = SuitUtil.SortSuitListByHighRarity(_currentList3);
  880. }
  881. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  882. {
  883. _currentList3 = SuitUtil.SortSuitListByLowRarity(_currentList3);
  884. }
  885. else
  886. {
  887. _currentList3.Reverse();
  888. }
  889. }
  890. else
  891. {
  892. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  893. if (_rarityIndex == SORT_BY_HIGH_RARITY)
  894. {
  895. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighRarity(_currentList3);
  896. }
  897. else if (_rarityIndex == SORT_BY_LOW_RARITY)
  898. {
  899. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowRarity(_currentList3);
  900. }
  901. else
  902. {
  903. _currentList3.Reverse();
  904. }
  905. }
  906. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  907. // {
  908. // _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3);
  909. // }
  910. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  911. // {
  912. // _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3);
  913. // }
  914. _ui.m_partsList.m_list.RemoveChildrenToPool();
  915. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  916. }
  917. private void UpdateSuitPartsListSort()
  918. {
  919. if (_currentMenuType == 0) return;
  920. if (_isNormalSuitType)
  921. {
  922. _currentList4 = new List<int>(SuitCfgArray.Instance.GetSuitItems(_currentSuitId));
  923. }
  924. else
  925. {
  926. _currentList4 = SuitCfgArray.Instance.GetOneSuitAllNotActionParts(_currentSuitId);
  927. _currentList4.Add(_currentSuitId);
  928. }
  929. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  930. // {
  931. // _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4);
  932. // }
  933. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  934. // {
  935. // _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4);
  936. // }
  937. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  938. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  939. }
  940. private void UpdateBtnAction()
  941. {
  942. // _ui.m_btnAction.visible = (_currentMenuType == ConstDressUpItemType.TAO_ZHUANG) || this.currentListType == DressUpListType.List4;
  943. // if (_ui.m_btnAction.visible)
  944. // {
  945. //_ui.m_btnAction.grayed = !EquipDataCache.cacher.HasSuitActionRes;
  946. // }
  947. }
  948. private void OnClickBtnShow()
  949. {
  950. Timers.inst.Remove(SetBtnShowVisable);
  951. _ui.m_c1.selectedIndex = 0;
  952. _ui.m_btnHide.visible = true;
  953. _ui.m_btnShow.visible = false;
  954. _ui.m_loaShow.visible = false;
  955. }
  956. private void OnClickBtnHide()
  957. {
  958. _ui.m_c1.selectedIndex = 1;
  959. _ui.m_btnHide.visible = false;
  960. _ui.m_btnShow.visible = true;
  961. _ui.m_loaShow.visible = true;
  962. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  963. }
  964. private void OnClickLoaShow()
  965. {
  966. _ui.m_btnShow.alpha = 1;
  967. _ui.m_btnShow.enabled = true;
  968. Timers.inst.Add(2f, 1, SetBtnShowVisable);
  969. }
  970. private void OnClickBtnPhoto()
  971. {
  972. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.PAI_ZHAO, 1);
  973. if (!ViewManager.Show<PhotographView>())
  974. {
  975. return;
  976. }
  977. _ui.target.visible = false;
  978. this._sceneObject.gameObject.SetActive(false);
  979. }
  980. private void OnClickBtnNext()
  981. {
  982. // if (!EquipDataCache.cacher.CheckPutOnFinish())
  983. // {
  984. // AlertUI.Show("只有换好衣服才能出门哦!")
  985. // .SetRightButton(true, "好的");
  986. // return;
  987. // }
  988. if (!ViewManager.Show<PhotographView>(this.viewData))
  989. {
  990. return;
  991. }
  992. _ui.target.visible = false;
  993. this._sceneObject.gameObject.SetActive(false);
  994. }
  995. private void UpdateScene()
  996. {
  997. _ui.target.visible = true;
  998. this._sceneObject.gameObject.SetActive(true);
  999. }
  1000. private void SetBtnShowVisable(object param)
  1001. {
  1002. _ui.m_btnShow.enabled = false;
  1003. GTween.To(1, 0, 0.3f).SetTarget(_ui.m_btnShow, TweenPropType.Alpha);
  1004. }
  1005. private bool CheckListCount(int type)
  1006. {
  1007. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  1008. {
  1009. return DressUpMenuSuitDataManager.GetSuitIDList().Count > 0;
  1010. }
  1011. else
  1012. {
  1013. return DressUpMenuItemDataManager.getItemDatasByType(type).Count > 0;
  1014. }
  1015. }
  1016. private void CheckGuide(object param)
  1017. {
  1018. if (GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0
  1019. || GuideDataManager.IsGuideFinish(ConstGuideId.ENTER_CHAPTER) <= 0)
  1020. {
  1021. UpdateToCheckGuide(null);
  1022. }
  1023. else
  1024. {
  1025. Timers.inst.Remove(CheckGuide);
  1026. }
  1027. }
  1028. protected override void UpdateToCheckGuide(object param)
  1029. {
  1030. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  1031. if (listTypeItem_FreedomDress == null && GuideDataManager.IsGuideFinish(ConstGuideId.FREEDOM_DRESS) <= 0)
  1032. {
  1033. int len = _ui.m_comListType1.m_listType.numChildren;
  1034. for (int i = 0; i < len; i++)
  1035. {
  1036. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  1037. if (item != null)
  1038. {
  1039. int menuID = (int)item.target.data;
  1040. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  1041. if (dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
  1042. {
  1043. listTypeItem_FreedomDress = item;
  1044. _ui.m_comListType1.m_listType.ScrollToView(i);
  1045. break;
  1046. }
  1047. }
  1048. UI_TypeItem.ProxyEnd();
  1049. }
  1050. }
  1051. if (listTypeItem_FreedomDress != null) GuideController.TryGuide(listTypeItem_FreedomDress.target, ConstGuideId.FREEDOM_DRESS, 3, "套装分类里,可以查看集齐成套的服饰,点击一键换上。");
  1052. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.FREEDOM_DRESS, 4, "", 0);
  1053. // if (_ui.m_partsList.m_list.numItems > 0)
  1054. // {
  1055. // UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(0).asCom);
  1056. // GuideController.TryGuide(listItem.m_comAxtionSelect.m_btnAction, ConstGuideId.FREEDOM_DRESS, 5, "选择特殊动作并穿上。");
  1057. // UI_PartsListItem.ProxyEnd();
  1058. // }
  1059. GuideController.TryGuide(_ui.m_btnSave, ConstGuideId.FREEDOM_DRESS, 5, "搭配好的服饰,可以保存到主界面显示。");
  1060. GuideController.TryGuide(_ui.m_btnPhoto, ConstGuideId.FREEDOM_DRESS, 6, "辛苦搭配完,去拍个照片留念呀~~");
  1061. GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.ENTER_CHAPTER, 2, "");
  1062. }
  1063. }
  1064. }