DressUpFightView.cs 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069
  1. using UI.DressUp;
  2. using FairyGUI;
  3. using UnityEngine;
  4. using System.Collections.Generic;
  5. using System;
  6. using ET;
  7. namespace GFGGame
  8. {
  9. public class DressUpFightView : BaseView
  10. {
  11. private UI_DressUpFightUI _ui;
  12. private int _fightID;
  13. private int _levelID;
  14. private float listType1X = 0;
  15. private float partsListX = 0;
  16. private DressUpListType currentListType;
  17. private int[] _currentList2;
  18. private GameObject _scenePrefab;
  19. private GameObject _sceneObject;
  20. private List<int> _currentList3 = new List<int>();
  21. private List<int> _currentList4 = new List<int>();
  22. private int _currentMenuType;
  23. private int _currentSuitId;
  24. private StoryLevelCfg _levelCfg;
  25. private StoryFightCfg _fightCfg;
  26. private const int SORT_BY_HIGH_SCORE = 0;
  27. private const int SORT_BY_LOW_SCORE = 1;
  28. private int _scoreIndex = SORT_BY_HIGH_SCORE;
  29. private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
  30. public override void Dispose()
  31. {
  32. if (_sceneObject != null)
  33. {
  34. GameObject.Destroy(_sceneObject);
  35. _sceneObject = null;
  36. }
  37. for (int i = 0; i < _listLongPress.Count; i++)
  38. {
  39. _listLongPress[i].Dispose();
  40. }
  41. if (_ui != null)
  42. {
  43. _ui.Dispose();
  44. _ui = null;
  45. }
  46. base.Dispose();
  47. }
  48. protected override void Init()
  49. {
  50. base.Init();
  51. packageName = UI_DressUpFightUI.PACKAGE_NAME;
  52. _ui = UI_DressUpFightUI.Create();
  53. viewCom = _ui.target;
  54. isfullScreen = true;
  55. _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
  56. _ui.m_btnClose.width = GRoot.inst.width;
  57. _ui.m_btnClose.height = GRoot.inst.height;
  58. _ui.m_btnClose.AddRelation(GRoot.inst, RelationType.Size);
  59. }
  60. protected override void OnInit()
  61. {
  62. base.OnInit();
  63. _ui.m_groupTaskHint.visible = false;
  64. _ui.m_btnRepeal.visible = false;
  65. _ui.m_btnRenewal.visible = false;
  66. _ui.m_btnSearch.visible = true;
  67. // _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
  68. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
  69. InitLists();
  70. _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
  71. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  72. _ui.m_btnHome.onClick.Add(OnClickBtnHome);
  73. // _ui.m_btnClothingShop.onClick.Add(OnClickBtnClothingShop);
  74. // _ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
  75. _ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
  76. _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
  77. _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
  78. _ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
  79. _ui.m_touchPad.onClick.Add(OnTouchPad);
  80. _ui.m_btnHint.onClick.Add(OnClickBtnHint);
  81. _ui.m_btnGuide.onClick.Add(OnTouchPad);
  82. _ui.m_btnClose.onClick.Add(OnClickBtnClose);
  83. _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
  84. _ui.m_btnNext.onClick.Add(OnClickBtnNext);
  85. _ui.m_btnRecommend.onClick.Add(OnClickBtnRecommend);
  86. _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
  87. _ui.m_btnAutoPlay.onClick.Add(OnClickBtnAutoPlay);
  88. _ui.m_compNeed.target.onClick.Add(OnClickComNeed);
  89. _ui.m_compNeed.m_listTag.itemRenderer = RenderListTagItem;
  90. // _ui.m_btnShow.onClick.Add(OnClickBtnShow);
  91. // _ui.m_btnHide.onClick.Add(OnClickBtnHide);
  92. // _ui.m_loaShow.onClick.Add(OnClickLoaShow);
  93. // _ui.m_btnHide.visible = false;
  94. // EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdatePartsListSort);
  95. _ui.m_partsList2.m_comboBoxRarity.visible = false;
  96. }
  97. protected override void AddEventListener()
  98. {
  99. base.AddEventListener();
  100. EventAgent.AddEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
  101. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  102. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
  103. EventAgent.AddEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
  104. }
  105. protected override void OnShown()
  106. {
  107. base.OnShown();
  108. InstanceZonesDataManager.usedRecommend = false;
  109. // _ui.m_comboBox.title = "我的套装";
  110. _ui.m_txtRecommendCount.SetVar("v1", "" + GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount)).FlushVars();
  111. _ui.m_txtRecommendCount.SetVar("v2", GlobalCfgArray.globalCfg.recommendCount.ToString()).FlushVars();
  112. _ui.m_btnRecommend.enabled = true;// GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount) > 0;
  113. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  114. _ui.m_btnAutoPlay.selected = EquipDataCache.cacher.autoPlay;
  115. _ui.m_btnAutoPlay.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
  116. _levelID = (int)viewData;
  117. InstanceZonesDataManager.currentLevelCfgId = _levelID;
  118. _levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  119. _fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
  120. if (_levelCfg.type == ConstInstanceZonesType.Field)
  121. {
  122. _fightCfg.scoreType = FieldDataManager.Instance.fieldInfos.theme;
  123. _ui.m_btnAutoPlay.visible = false;
  124. }
  125. _ui.m_compNeed.target.visible = _fightCfg.needItemId > 0 || _fightCfg.needSuitId > 0 || _fightCfg.needTagsArr.Length > 0;
  126. if (_ui.m_compNeed.target.visible)
  127. {
  128. _ui.m_compNeed.m_c1.selectedIndex = 0;
  129. if (_fightCfg.needItemId > 0)
  130. {
  131. _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetItemName(_fightCfg.needItemId);
  132. _ui.m_compNeed.target.data = _fightCfg.needItemId;
  133. }
  134. else if (_fightCfg.needSuitId > 0)
  135. {
  136. _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetSuitName(_fightCfg.needSuitId);
  137. _ui.m_compNeed.target.data = _fightCfg.needSuitId;
  138. }
  139. else
  140. {
  141. _ui.m_compNeed.m_c1.selectedIndex = 1;
  142. _ui.m_compNeed.m_listTag.numItems = _fightCfg.needTagsArr.Length;
  143. }
  144. }
  145. InstanceZonesDataManager.currentScoreType = _fightCfg.scoreType;
  146. //一级菜单
  147. _ui.m_comListType1.m_listType.RemoveChildrenToPool();
  148. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length - 1;
  149. //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_listType1.numItems);
  150. float maxHeight = _ui.target.height - _ui.m_comListType1.m_listType.y - DressUpView.BOTTOM_BLANK;
  151. if (_ui.m_comListType1.m_listType.height > maxHeight)
  152. {
  153. _ui.m_comListType1.m_listType.height = maxHeight;
  154. }
  155. _ui.m_comListType1.target.x = _ui.target.width;
  156. _ui.m_comListType2.target.x = _ui.target.width;
  157. _ui.m_partsList.target.x = _ui.target.width;
  158. _ui.m_partsList2.target.x = _ui.target.width;
  159. _ui.m_scoreType.url = "ui://CommonGame/kp_sx_" + _fightCfg.scoreType;
  160. this.showListType1();
  161. if (_sceneObject == null)
  162. {
  163. _sceneObject = GameObject.Instantiate(_scenePrefab);
  164. EquipDataCache.cacher.setSceneObj(_sceneObject);
  165. EquipDataCache.cacher.PutOnDefaultSuitSaved();
  166. }
  167. UpdateScore();
  168. SendLog();
  169. Timers.inst.AddUpdate(CheckGuide);
  170. }
  171. protected override void OnHide()
  172. {
  173. base.OnHide();
  174. _ui.m_groupTaskHint.visible = false;
  175. if (_sceneObject != null)
  176. {
  177. GameObject.Destroy(_sceneObject);
  178. _sceneObject = null;
  179. }
  180. _fightCfg = null;
  181. _levelCfg = null;
  182. DressUpMenuItemDataManager.Clear();
  183. Timers.inst.Remove(CheckGuide);
  184. }
  185. protected override void RemoveEventListener()
  186. {
  187. base.RemoveEventListener();
  188. EventAgent.RemoveEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
  189. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdatePartsListSort);
  190. EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdatePartsListSort);
  191. EventAgent.RemoveEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
  192. }
  193. private void OnClickBtnBack()
  194. {
  195. AlertUI.Show("是否确定退出?")
  196. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  197. {
  198. if (_levelCfg.type == ConstInstanceZonesType.Studio)
  199. {
  200. ViewManager.Show(StudioDataManager.Instance.VIEW_NAME, new object[] { StudioDataManager.Instance.TYPE_SELECT_INDEX, StudioDataManager.Instance.PROPERTY_SELECT_INDEX }, ViewManager.GetGoBackDatas(StudioDataManager.Instance.VIEW_NAME));
  201. }
  202. else if (_levelCfg.type == ConstInstanceZonesType.Field)
  203. {
  204. ViewManager.GoBackFrom(ViewName.DRESS_UP_FIGHT_VIEW);
  205. }
  206. else
  207. {
  208. // ViewManager.GoBackFrom(ViewName.STORY_CHAPTER_VIEW);
  209. ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, _levelCfg.chapterId, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW });
  210. }
  211. EquipDataCache.cacher.TakeOffAll();
  212. this.Hide();
  213. });
  214. // ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter);
  215. }
  216. private void OnClickBtnHome()
  217. {
  218. AlertUI.Show("是否返回?")
  219. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  220. {
  221. EquipDataCache.cacher.TakeOffAll();
  222. GameController.GoBackToMainView();
  223. });
  224. }
  225. private void OnClickBtnClothingShop()
  226. {
  227. ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, new object[] { null, _fightCfg.scoreType }, null, false, true);
  228. }
  229. private void OnClickListType1Item(EventContext context)
  230. {
  231. // GuideController.HideGuide();
  232. GObject typeItem = context.data as GObject;
  233. int order = (int)typeItem.data;
  234. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[order - 1];
  235. if (item1.subMenusArr.Length > 0)
  236. {
  237. this.showListType2(item1.subMenusArr);
  238. }
  239. else
  240. {
  241. if (this.showListParts(item1.type) == false)
  242. {
  243. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  244. return;
  245. }
  246. this.showListParts(item1.type);
  247. }
  248. this.hideListType1();
  249. UpdateListPartsSelected();
  250. }
  251. private void OnClickListType2Item(EventContext context)
  252. {
  253. GObject typeItem = context.data as GObject;
  254. int order = (int)typeItem.data;
  255. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[order - 1];
  256. if (this.showListParts(item2.type) == false)
  257. {
  258. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  259. return;
  260. }
  261. this.hideListType2();
  262. }
  263. private void OnClickPartsListItem(EventContext context)
  264. {
  265. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  266. {
  267. return;
  268. }
  269. GObject listItem = context.data as GObject;
  270. int id = (int)listItem.data;
  271. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  272. {
  273. this.showListParts2(id);
  274. this.hideListParts();
  275. EquipDataCache.cacher.PutOnSuitCfg(id, false, true);
  276. }
  277. else
  278. {
  279. EquipDataCache.cacher.TryCancelSuit(id);
  280. EquipDataCache.cacher.AddOrRemove(id, true);
  281. }
  282. UpdateListPartsSelected();
  283. UpdateListSuitPartsSelected();
  284. }
  285. private void OnClickSuitPartsListItem(EventContext context)
  286. {
  287. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  288. {
  289. return;
  290. }
  291. GObject listItem = (GObject)context.data as GObject;
  292. int id = (int)listItem.data;
  293. EquipDataCache.cacher.TryCancelSuit(id);
  294. EquipDataCache.cacher.AddOrRemove(id, true);
  295. UpdateListSuitPartsSelected();
  296. }
  297. private void OnLongPress(EventContext context)
  298. {
  299. LongPressGesture gesture = (LongPressGesture)context.sender;
  300. int itemId = (int)gesture.host.data;
  301. GoodsItemTipsController.ShowItemTips(itemId);
  302. }
  303. private void OnTouchPad()
  304. {
  305. if (this.currentListType == DressUpListType.List4)
  306. {
  307. this.hideListParts2();
  308. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  309. }
  310. else if (this.currentListType == DressUpListType.List3)
  311. {
  312. if (_currentList2 != null)
  313. {
  314. this.showListType2();
  315. }
  316. else
  317. {
  318. this.showListType1();
  319. }
  320. this.hideListParts();
  321. }
  322. else if (this.currentListType == DressUpListType.List2)
  323. {
  324. this.showListType1();
  325. this.hideListType2();
  326. }
  327. }
  328. private void OnClickBtnHint()
  329. {
  330. this.ShowTaskHint();
  331. }
  332. private void OnClickBtnDelete()
  333. {
  334. EquipDataCache.cacher.TakeOffAll();
  335. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  336. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  337. }
  338. private void OnClickBtnClose()
  339. {
  340. _ui.m_groupTaskHint.visible = false;
  341. }
  342. private void OnClickBtnNext()
  343. {
  344. if (!EquipDataCache.cacher.CheckPutOnFinish())
  345. {
  346. AlertUI.Show("只有换好衣服才能出门哦~")
  347. .SetRightButton(true, "好的");
  348. return;
  349. }
  350. int _suitId = DressUpMenuSuitDataManager.CheckCurDressIsSuit(); ;
  351. if (_fightCfg.needItemId > 0 && (_suitId <= 0 && EquipDataCache.cacher.equipDatas.IndexOf(_fightCfg.needItemId) < 0 || _suitId > 0 && Array.IndexOf(SuitCfgArray.Instance.GetCfg(_suitId).partsArr, _fightCfg.needItemId) < 0) || _fightCfg.needSuitId > 0 && _suitId != _fightCfg.needSuitId)
  352. {
  353. AlertUI.Show("未穿戴必须品~").SetRightButton(true, "好的");
  354. return;
  355. }
  356. if (CardDataManager.GetCardListByRarity(0).Count > 0)
  357. {
  358. ViewManager.Show<StoryCardChoose>(_fightCfg.scoreType);
  359. }
  360. else
  361. {
  362. StartCalculateScore();
  363. }
  364. }
  365. private void StartCalculateScore()
  366. {
  367. //不可移动代码位置
  368. bool hasFightTarget = _fightCfg.targetName != null && _fightCfg.targetName.Length > 0;
  369. if (_levelCfg.type == ConstInstanceZonesType.Field)
  370. {
  371. FieldFightDataManager.Instance.CurrentCardId = InstanceZonesDataManager.currentCardId;
  372. FieldFightDataManager.Instance.CurrentScoreType = InstanceZonesDataManager.currentScoreType;
  373. FieldFightDataManager.Instance.currentLevelCfgId = InstanceZonesDataManager.currentLevelCfgId;
  374. FieldFightDataManager.Instance.equipDatas = EquipDataCache.cacher.equipDatas;
  375. }
  376. if (hasFightTarget)
  377. {
  378. ViewManager.Show(ViewName.STORY_FIGHT_TARGET_VIEW);
  379. }
  380. else
  381. {
  382. ViewManager.Show(ViewName.STORY_FIGHT_SINGLE_VIEW);
  383. }
  384. this.Hide();
  385. }
  386. private void OnClickBtnRecommend()
  387. {
  388. if (this.currentListType == DressUpListType.List4)
  389. {
  390. this.hideListParts2();
  391. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  392. }
  393. EquipDataCache.cacher.TryCancelSuit(_currentSuitId);
  394. InstanceZonesDataManager.usedRecommend = true;
  395. EquipDataCache.cacher.PutOnRecommendItems();
  396. UpdateListPartsSelected();
  397. UpdateListSuitPartsSelected();
  398. }
  399. private void InitLists()
  400. {
  401. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  402. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  403. _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
  404. listType1X = _ui.m_comListType1.target.x;
  405. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;
  406. //一级菜单
  407. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  408. }
  409. private void showListType1()
  410. {
  411. _currentList2 = null;
  412. currentListType = DressUpListType.List1;
  413. GTween.To(_ui.target.width, listType1X, 0.5f)
  414. .SetTarget(_ui.m_comListType1.target)
  415. .OnUpdate((GTweener t) =>
  416. {
  417. _ui.m_comListType1.target.x = t.value.x;
  418. });
  419. }
  420. private void hideListType1()
  421. {
  422. GTween.To(listType1X, _ui.target.width, 0.5f)
  423. .SetTarget(_ui.m_comListType1.target)
  424. .OnUpdate((GTweener t) =>
  425. {
  426. _ui.m_comListType1.target.x = t.value.x;
  427. });
  428. }
  429. private void showListType2(int[] menuStrArr = null)
  430. {
  431. currentListType = DressUpListType.List2;
  432. if (menuStrArr != null && menuStrArr.Length > 0)
  433. {
  434. int len = menuStrArr.Length;
  435. _currentList2 = menuStrArr.Clone() as int[];
  436. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  437. _ui.m_comListType2.m_listType.numItems = len;
  438. //_ui.m_listType2.ResizeToFit(_ui.m_listType2.numItems);
  439. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  440. if (_ui.m_comListType2.m_listType.height > maxHeight)
  441. {
  442. _ui.m_comListType2.m_listType.height = maxHeight;
  443. }
  444. }
  445. GTween.To(_ui.target.width, listType1X, 0.5f)
  446. .SetTarget(_ui.m_comListType2.target)
  447. .OnUpdate((GTweener t) =>
  448. {
  449. _ui.m_comListType2.target.x = t.value.x;
  450. });
  451. }
  452. private void hideListType2()
  453. {
  454. GTween.To(listType1X, _ui.target.width, 0.5f)
  455. .SetTarget(_ui.m_comListType2.target)
  456. .OnUpdate((GTweener t) =>
  457. {
  458. _ui.m_comListType2.target.x = t.value.x;
  459. });
  460. }
  461. private bool showListParts(int type, bool selectItem = false)
  462. {
  463. _currentMenuType = type;
  464. UpdatePartsListSort();
  465. if (_ui.m_partsList.m_list.numItems <= 0) return false;
  466. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  467. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;
  468. if (_ui.m_partsList.m_list.height > maxHeight)
  469. {
  470. _ui.m_partsList.m_list.height = maxHeight;
  471. }
  472. if (selectItem)
  473. {
  474. int itemId = EquipDataCache.cacher.GetItemIdBuyType(_currentMenuType);
  475. if (itemId > 0)
  476. {
  477. int index = _currentList3.IndexOf(itemId);
  478. _ui.m_partsList.m_list.ScrollToView(index);
  479. }
  480. }
  481. currentListType = DressUpListType.List3;
  482. GTween.To(_ui.target.width, partsListX, 0.5f)
  483. .SetTarget(_ui.m_partsList)
  484. .OnUpdate((GTweener t) =>
  485. {
  486. _ui.m_partsList.target.x = t.value.x;
  487. });
  488. UpdateListPartsSelected();
  489. return true;
  490. }
  491. private void OnComboBoxRarityChanged()
  492. {
  493. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  494. this.UpdatePartsListSort();
  495. }
  496. private void UpdatePartsListSort()
  497. {
  498. if (_currentMenuType == 0) return;
  499. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  500. {
  501. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  502. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  503. {
  504. _currentList3 = SuitUtil.SortSuitListByHighScore(_currentList3);
  505. }
  506. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  507. {
  508. _currentList3 = SuitUtil.SortSuitListByLowScore(_currentList3);
  509. }
  510. else
  511. {
  512. _currentList3.Reverse();
  513. }
  514. }
  515. else
  516. {
  517. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  518. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  519. {
  520. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3);
  521. }
  522. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  523. {
  524. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3);
  525. }
  526. else
  527. {
  528. _currentList3.Reverse();
  529. }
  530. }
  531. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  532. {
  533. _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3, _currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG);
  534. }
  535. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  536. {
  537. _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3, _currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG);
  538. }
  539. //必穿品放在列表最前面
  540. if (_fightCfg.needItemId > 0)
  541. {
  542. int index = _currentList3.IndexOf(_fightCfg.needItemId);
  543. if (index >= 0)
  544. {
  545. int item = _currentList3[index];
  546. _currentList3.Remove(_currentList3[index]);
  547. _currentList3.Insert(0, item);
  548. }
  549. }
  550. else if (_fightCfg.needSuitId > 0)
  551. {
  552. int index = _currentList3.IndexOf(_fightCfg.needSuitId);
  553. if (index >= 0)
  554. {
  555. int item = _currentList3[index];
  556. _currentList3.Remove(_currentList3[index]);
  557. _currentList3.Insert(0, item);
  558. }
  559. }
  560. _ui.m_partsList.m_list.RemoveChildrenToPool();
  561. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  562. }
  563. private void UpdateSuitPartsListSort()
  564. {
  565. if (_currentMenuType == 0) return;
  566. _currentList4 = new List<int>(SuitCfgManager.Instance.GetSuitItems(_currentSuitId, true));
  567. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  568. {
  569. _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4, false);
  570. }
  571. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  572. {
  573. _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4, false);
  574. }
  575. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  576. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  577. }
  578. private void hideListParts()
  579. {
  580. GTween.To(partsListX, _ui.target.width, 0.5f)
  581. .SetTarget(_ui.m_partsList)
  582. .OnUpdate((GTweener t) =>
  583. {
  584. _ui.m_partsList.target.x = t.value.x;
  585. });
  586. }
  587. private void showListParts2(int suitId)
  588. {
  589. _currentSuitId = suitId;
  590. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  591. this.UpdateSuitPartsListSort();
  592. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  593. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
  594. if (_ui.m_partsList2.m_list.height > maxHeight)
  595. {
  596. _ui.m_partsList2.m_list.height = maxHeight;
  597. }
  598. currentListType = DressUpListType.List4;
  599. GTween.To(_ui.target.width, partsListX, 0.5f)
  600. .SetTarget(_ui.m_partsList2)
  601. .OnUpdate((GTweener t) =>
  602. {
  603. _ui.m_partsList2.target.x = t.value.x;
  604. });
  605. }
  606. private void hideListParts2()
  607. {
  608. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  609. GTween.To(partsListX, _ui.target.width, 0.5f)
  610. .SetTarget(_ui.m_partsList2)
  611. .OnUpdate((GTweener t) =>
  612. {
  613. _ui.m_partsList2.target.x = t.value.x;
  614. });
  615. }
  616. private void ListType1Item(int index, GObject item)
  617. {
  618. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  619. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  620. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  621. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  622. typeItem.target.data = item1.id;
  623. typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
  624. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSubtypeNew(item1.id);
  625. UI_TypeItem.ProxyEnd();
  626. }
  627. private void ListType2Item(int index, GObject item)
  628. {
  629. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  630. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  631. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  632. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  633. typeItem.target.data = item2.id;
  634. var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  635. typeItem.m_imgNeed.visible = subType == item2.type;
  636. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSubtypeNew(item2.id);
  637. UI_TypeItem.ProxyEnd();
  638. }
  639. private void ListPartsItem(int index, GObject item)
  640. {
  641. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  642. int id = (int)_currentList3[index];
  643. string iconRes = "";
  644. string partName = "";
  645. string ext = "png";
  646. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  647. {
  648. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  649. iconRes = suitCfg.res;
  650. partName = suitCfg.name;
  651. listItem.m_iconSelected.visible = false;
  652. listItem.m_txtScore.text = "" + SuitUtil.GetSuitScore(id);
  653. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  654. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  655. }
  656. else
  657. {
  658. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  659. iconRes = itemCfg.res;
  660. partName = itemCfg.name;
  661. listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
  662. listItem.m_txtScore.text = "" + DressUpMenuItemDataManager.GetItemScore(id);
  663. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  664. listItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsDressItemNew(id);
  665. DressUpMenuItemDataManager.RemoveNewDressItem(_currentMenuType, id);
  666. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  667. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
  668. }
  669. if (listItem.target.data == null)
  670. {
  671. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  672. longPressGesture.once = true;
  673. longPressGesture.onAction.Add(OnLongPress);
  674. _listLongPress.Add(longPressGesture);
  675. }
  676. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  677. listItem.m_ScoreType.url = "ui://CommonGame/kp_sx_" + _fightCfg.scoreType;
  678. listItem.m_txtTitle.text = partName;
  679. listItem.target.data = id;
  680. listItem.m_imgNeed.visible = _fightCfg.needItemId == id || _fightCfg.needSuitId == id;
  681. UI_PartsListItem.ProxyEnd();
  682. }
  683. private void ListParts2Item(int index, GObject item)
  684. {
  685. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  686. int id = (int)_currentList4[index];
  687. string iconRes = "";
  688. string partName = "";
  689. string ext = "png";
  690. if (listItem.target.data == null)
  691. {
  692. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  693. longPressGesture.once = true;
  694. longPressGesture.onAction.Add(OnLongPress);
  695. _listLongPress.Add(longPressGesture);
  696. }
  697. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  698. iconRes = itemCfg.res;
  699. partName = itemCfg.name;
  700. listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
  701. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  702. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  703. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
  704. listItem.m_ScoreType.visible = true;
  705. // int mainScore;
  706. // int mainValuel;
  707. // ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
  708. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + _fightCfg.scoreType);
  709. listItem.m_txtScore.text = "" + DressUpMenuItemDataManager.GetItemScore(id, _fightCfg.scoreType);
  710. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  711. listItem.m_txtTitle.text = partName;
  712. listItem.target.data = id;
  713. // listItem.m_txtScore.visible = false;
  714. //listItem.m_ScoreType.visible = true;
  715. listItem.m_imgNeed.visible = false;
  716. UI_PartsListItem.ProxyEnd();
  717. }
  718. private void UpdateListPartsSelected()
  719. {
  720. int count = _ui.m_partsList.m_list.numChildren;
  721. int suitId = DressUpMenuSuitDataManager.CheckCurDressIsSuit();
  722. for (int i = 0; i < count; i++)
  723. {
  724. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(i));
  725. int id = (int)listItem.target.data;
  726. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  727. {
  728. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  729. }
  730. else
  731. {
  732. bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  733. bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  734. bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  735. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  736. }
  737. UI_PartsListItem.ProxyEnd();
  738. }
  739. }
  740. private void UpdateListSuitPartsSelected()
  741. {
  742. int count = _ui.m_partsList2.m_list.numChildren;
  743. int suitId = DressUpMenuSuitDataManager.CheckCurDressIsSuit();
  744. for (int i = 0; i < count; i++)
  745. {
  746. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  747. int id = (int)listItem.target.data;
  748. bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  749. bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  750. bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  751. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  752. UI_PartsListItem.ProxyEnd();
  753. }
  754. }
  755. private void ShowTaskHint()
  756. {
  757. _ui.m_groupTaskHint.visible = true;
  758. _ui.m_txtHint.text = _levelCfg.hint;
  759. if (this._ui.m_txtHint.textHeight > this._ui.m_txtHint.textFormat.size * 2)
  760. {
  761. this._ui.m_txtHint.align = AlignType.Left;
  762. }
  763. else
  764. {
  765. this._ui.m_txtHint.align = AlignType.Center;
  766. }
  767. }
  768. private void UpdateScore()
  769. {
  770. _ui.m_txtScore.text = "" + EquipDataCache.cacher.score;
  771. // GuideController.TryGuideDressUpFightViewBtnNext(_ui.m_btnNext);
  772. }
  773. private void OnClickBtnSearch()
  774. {
  775. ViewManager.Show<DressFilterView>(false, new object[] { ViewName.DRESS_UP_VIEW });
  776. }
  777. private void OnClickBtnAutoPlay()
  778. {
  779. EquipDataCache.cacher.autoPlay = _ui.m_btnAutoPlay.selected;
  780. }
  781. // private void OnClickBtnShow()
  782. // {
  783. // Timers.inst.Remove(SetBtnShowVisable);
  784. // _ui.m_c1.selectedIndex = 0;
  785. // _ui.m_btnHide.visible = true;
  786. // _ui.m_loaShow.visible = false;
  787. // _ui.m_btnShow.visible = false;
  788. // }
  789. // private void OnClickBtnHide()
  790. // {
  791. // _ui.m_c1.selectedIndex = 1;
  792. // _ui.m_btnHide.visible = false;
  793. // _ui.m_btnShow.visible = true;
  794. // _ui.m_loaShow.visible = true;
  795. // Timers.inst.Add(2f, 1, SetBtnShowVisable);
  796. // }
  797. // private void OnClickLoaShow()
  798. // {
  799. // Timers.inst.Remove(SetBtnShowVisable);
  800. // _ui.m_btnShow.alpha = 1;
  801. // Timers.inst.Add(2f, 1, SetBtnShowVisable);
  802. // _ui.m_btnShow.enabled = true;
  803. // }
  804. // private void SetBtnShowVisable(object param)
  805. // {
  806. // _ui.m_btnShow.enabled = false;
  807. // GTween.To(1, 0, 0.3f).SetTarget(_ui.m_btnShow, TweenPropType.Alpha);
  808. // }
  809. private void OnClickComNeed()
  810. {
  811. if (_fightCfg.needItemId <= 0 && _fightCfg.needSuitId <= 0)
  812. {
  813. return;
  814. }
  815. if (_fightCfg.needSuitId > 0)
  816. {
  817. ViewManager.Show(ViewName.SUIT_GUIDE_VIEW, new object[] { _ui.m_compNeed.target.data, new object[] { ViewName.DRESS_UP_FIGHT_VIEW, this.viewData } }, new object[] { ViewName.DRESS_UP_FIGHT_VIEW, this.viewData });
  818. }
  819. else
  820. {
  821. ViewManager.Show(ViewName.APPROACH_OF_ITEM_VIEW, new object[] { _ui.m_compNeed.target.data, new object[] { ViewName.DRESS_UP_FIGHT_VIEW, this.viewData }, 1 });
  822. }
  823. }
  824. private void RenderListTagItem(int index, GObject obj)
  825. {
  826. UI.CommonGame.UI_ListTagItem item = UI.CommonGame.UI_ListTagItem.Proxy(obj);
  827. string[] tag = _fightCfg.needTagsArr[index].Split('_');
  828. item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tag[0]);
  829. item.m_txtTag.text = tag[1];
  830. UI.CommonGame.UI_ListTagItem.ProxyEnd();
  831. }
  832. private bool CheckListCount(int type)
  833. {
  834. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  835. {
  836. return DressUpMenuSuitDataManager.GetSuitIDList().Count > 0;
  837. }
  838. else
  839. {
  840. return DressUpMenuItemDataManager.getItemDatasByType(type).Count > 0;
  841. }
  842. }
  843. private void SendLog()
  844. {
  845. var levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  846. switch (levelCfg.type)
  847. {
  848. case ConstInstanceZonesType.Story:
  849. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.CHUN_ZHONG_LOU, 2);
  850. break;
  851. case ConstInstanceZonesType.Studio:
  852. StudioCfg studioCfg = StudioCfgArray.Instance.GetCfg(levelCfg.chapterId);
  853. if (studioCfg.funId == typeof(StudioMetalView).Name)
  854. {
  855. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.JIN_SHU_XIU_FU, 2);
  856. }
  857. else if (studioCfg.funId == typeof(StudioFabricView).Name)
  858. {
  859. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.ZHI_WU_XIU_FU, 2);
  860. }
  861. else if (studioCfg.funId == typeof(StudioPropertyView).Name)
  862. {
  863. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.SHU_HUA_XIU_FU, 2);
  864. }
  865. break;
  866. }
  867. }
  868. private void CheckGuide(object param)
  869. {
  870. if (GuideDataManager.IsGuideFinish(ConstGuideId.SINGLE_FIGHT) <= 0
  871. || GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0
  872. || GuideDataManager.IsGuideFinish(ConstGuideId.FIGHT_TIPS) <= 0)
  873. {
  874. UpdateToCheckGuide(null);
  875. }
  876. else
  877. {
  878. Timers.inst.Remove(CheckGuide);
  879. }
  880. }
  881. protected override void UpdateToCheckGuide(object param)
  882. {
  883. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  884. int syIndex = 0;
  885. int xzIndex = 0;
  886. int buyClothingIndex = 0;
  887. int buyClothingSubIndex = 0;
  888. int len = _ui.m_comListType1.m_listType.numChildren;
  889. for (int i = 0; i < len; i++)
  890. {
  891. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  892. if (item != null)
  893. {
  894. int menuID = (int)item.target.data;
  895. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  896. if (GuideDataManager.IsGuideFinish(ConstGuideId.SINGLE_FIGHT) <= 0 && dressUpMenuItemCfg1.type == ConstDressUpItemType.SHANG_YI)
  897. {
  898. syIndex = i;
  899. }
  900. if (GuideDataManager.IsGuideFinish(ConstGuideId.SINGLE_FIGHT) <= 0 && dressUpMenuItemCfg1.type == ConstDressUpItemType.XIA_ZHUANG)
  901. {
  902. xzIndex = i;
  903. }
  904. if (_fightCfg.needItemId > 0)
  905. {
  906. int type = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  907. if (GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0 && ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, dressUpMenuItemCfg1.id))
  908. {
  909. buyClothingIndex = i;
  910. }
  911. }
  912. }
  913. UI_TypeItem.ProxyEnd();
  914. }
  915. int len1 = _ui.m_comListType2.m_listType.numChildren;
  916. for (int i = 0; i < len1; i++)
  917. {
  918. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType2.m_listType.GetChildAt(i));
  919. if (item != null)
  920. {
  921. int menuID = (int)item.target.data;
  922. DressUpMenuItemCfg2 dressUpMenuItemCfg2 = DressUpMenuItemCfg2Array.Instance.GetCfg(menuID);
  923. var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  924. if (subType == dressUpMenuItemCfg2.type)
  925. {
  926. buyClothingSubIndex = i;
  927. }
  928. }
  929. UI_TypeItem.ProxyEnd();
  930. }
  931. int djcId = 10476;//点绛唇Id
  932. int djcIndex = 0;
  933. int buyClothingIdIndex = 0;
  934. for (int i = 0; i < _currentList3.Count; i++)
  935. {
  936. if (_currentList3[i] == djcId)
  937. {
  938. djcIndex = i;
  939. }
  940. if (_fightCfg.needItemId > 0 && _currentList3[i] == _fightCfg.needItemId)
  941. {
  942. buyClothingIdIndex = i;
  943. }
  944. }
  945. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.SINGLE_FIGHT, 3, "点击相应的分类,可以快速找到服饰。", syIndex);
  946. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.SINGLE_FIGHT, 4, "", 0, true, (int)_ui.m_partsList.m_list.y);
  947. GuideController.TryGuide(_ui.m_btnGuide, ConstGuideId.SINGLE_FIGHT, 5, "", -1, true, 0, 0, 0, false);
  948. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.SINGLE_FIGHT, 6, "接下来把裙子也换上。", xzIndex);
  949. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.SINGLE_FIGHT, 7, "", 0, true, (int)_ui.m_partsList.m_list.y);
  950. GuideController.TryGuide(_ui.m_btnNext, ConstGuideId.SINGLE_FIGHT, 8, "穿着完毕,来验证一下,换上的服饰是否符合需求。");
  951. GuideController.TryGuide(_ui.m_compNeed.target, ConstGuideId.BUY_CLOTHING, 3, "当提示有“必需品”时,需要穿上对应物品才能通关。", -1, true, 170);
  952. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.BUY_CLOTHING, 7, "按照指示就可以找到必需品啦。", buyClothingIndex);
  953. GuideController.TryGuide(_ui.m_comListType2.m_listType, ConstGuideId.BUY_CLOTHING, 8, "", buyClothingSubIndex);
  954. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.BUY_CLOTHING, 9, "点击换上吧。", buyClothingIdIndex, true, 170);
  955. GuideController.TryCompleteGuide(ConstGuideId.BUY_CLOTHING, 9);
  956. GuideController.TryGuide(_ui.m_btnHint, ConstGuideId.FIGHT_TIPS, 1, "这次换装需要获得别人的认可呢。");
  957. GuideController.TryCompleteGuide(ConstGuideId.FIGHT_TIPS, 1);
  958. }
  959. }
  960. }