DressUpFightView.cs 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  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 && _levelCfg.subType != ConstInstanceZonesSubType.Hard3)
  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.Studio && _levelCfg.subType == ConstInstanceZonesSubType.Hard3)
  203. {
  204. ViewManager.Show<StudioFilingView>(null, ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName));
  205. }
  206. else if (_levelCfg.type == ConstInstanceZonesType.Field)
  207. {
  208. ViewManager.GoBackFrom(ViewName.DRESS_UP_FIGHT_VIEW);
  209. }
  210. else
  211. {
  212. // ViewManager.GoBackFrom(ViewName.STORY_CHAPTER_VIEW);
  213. ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, _levelCfg.chapterId);//, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW }
  214. }
  215. EquipDataCache.cacher.TakeOffAll();
  216. this.Hide();
  217. });
  218. // ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter);
  219. }
  220. private void OnClickBtnHome()
  221. {
  222. AlertUI.Show("是否返回?")
  223. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  224. {
  225. EquipDataCache.cacher.TakeOffAll();
  226. GameController.GoBackToMainView();
  227. });
  228. }
  229. private void OnClickBtnClothingShop()
  230. {
  231. ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, new object[] { null, _fightCfg.scoreType }, null, false, true);
  232. }
  233. private void OnClickListType1Item(EventContext context)
  234. {
  235. // GuideController.HideGuide();
  236. GObject typeItem = context.data as GObject;
  237. int order = (int)typeItem.data;
  238. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[order - 1];
  239. if (item1.subMenusArr.Length > 0)
  240. {
  241. this.showListType2(item1.subMenusArr);
  242. }
  243. else
  244. {
  245. if (this.showListParts(item1.type) == false)
  246. {
  247. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  248. return;
  249. }
  250. this.showListParts(item1.type);
  251. }
  252. this.hideListType1();
  253. UpdateListPartsSelected();
  254. }
  255. private void OnClickListType2Item(EventContext context)
  256. {
  257. GObject typeItem = context.data as GObject;
  258. int order = (int)typeItem.data;
  259. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[order - 1];
  260. if (this.showListParts(item2.type) == false)
  261. {
  262. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  263. return;
  264. }
  265. this.hideListType2();
  266. }
  267. private void OnClickPartsListItem(EventContext context)
  268. {
  269. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  270. {
  271. return;
  272. }
  273. GObject listItem = context.data as GObject;
  274. int id = (int)listItem.data;
  275. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  276. {
  277. this.showListParts2(id);
  278. this.hideListParts();
  279. EquipDataCache.cacher.PutOnSuitCfg(id, false, true);
  280. }
  281. else
  282. {
  283. EquipDataCache.cacher.TryCancelSuit(id);
  284. EquipDataCache.cacher.AddOrRemove(id, true);
  285. }
  286. UpdateListPartsSelected();
  287. UpdateListSuitPartsSelected();
  288. }
  289. private void OnClickSuitPartsListItem(EventContext context)
  290. {
  291. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  292. {
  293. return;
  294. }
  295. GObject listItem = (GObject)context.data as GObject;
  296. int id = (int)listItem.data;
  297. EquipDataCache.cacher.TryCancelSuit(id);
  298. EquipDataCache.cacher.AddOrRemove(id, true);
  299. UpdateListSuitPartsSelected();
  300. }
  301. private void OnLongPress(EventContext context)
  302. {
  303. LongPressGesture gesture = (LongPressGesture)context.sender;
  304. int itemId = (int)gesture.host.data;
  305. GoodsItemTipsController.ShowItemTips(itemId);
  306. }
  307. private void OnTouchPad()
  308. {
  309. if (this.currentListType == DressUpListType.List4)
  310. {
  311. this.hideListParts2();
  312. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  313. }
  314. else if (this.currentListType == DressUpListType.List3)
  315. {
  316. if (_currentList2 != null)
  317. {
  318. this.showListType2(_currentList2);
  319. }
  320. else
  321. {
  322. this.showListType1();
  323. }
  324. this.hideListParts();
  325. }
  326. else if (this.currentListType == DressUpListType.List2)
  327. {
  328. this.showListType1();
  329. this.hideListType2();
  330. }
  331. }
  332. private void OnClickBtnHint()
  333. {
  334. this.ShowTaskHint();
  335. }
  336. private void OnClickBtnDelete()
  337. {
  338. EquipDataCache.cacher.TakeOffAll();
  339. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  340. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  341. }
  342. private void OnClickBtnClose()
  343. {
  344. _ui.m_groupTaskHint.visible = false;
  345. }
  346. private void OnClickBtnNext()
  347. {
  348. if (!EquipDataCache.cacher.CheckPutOnFinish())
  349. {
  350. AlertUI.Show("只有换好衣服才能出门哦!")
  351. .SetRightButton(true, "好的");
  352. return;
  353. }
  354. int _suitId = EquipDataCache.cacher.CheckCurDressIsSuit(); ;
  355. 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)
  356. {
  357. AlertUI.Show("未穿戴必需品。").SetRightButton(true, "好的");
  358. return;
  359. }
  360. if (CardDataManager.GetCardListByRarity(0).Count > 0)
  361. {
  362. ViewManager.Show<StoryCardChoose>(_fightCfg.scoreType);
  363. }
  364. else
  365. {
  366. StartCalculateScore();
  367. }
  368. }
  369. private void StartCalculateScore()
  370. {
  371. //不可移动代码位置
  372. bool hasFightTarget = _fightCfg.targetName != null && _fightCfg.targetName.Length > 0;
  373. if (_levelCfg.type == ConstInstanceZonesType.Field)
  374. {
  375. FieldFightDataManager.Instance.CurrentCardId = InstanceZonesDataManager.currentCardId;
  376. FieldFightDataManager.Instance.CurrentScoreType = InstanceZonesDataManager.currentScoreType;
  377. FieldFightDataManager.Instance.currentLevelCfgId = InstanceZonesDataManager.currentLevelCfgId;
  378. FieldFightDataManager.Instance.equipDatas = EquipDataCache.cacher.equipDatas;
  379. }
  380. Camera camera = _sceneObject.transform.Find("Camera").gameObject.GetComponent<Camera>();
  381. EquipDataCache.cacher.nTexture = DressUpUtil.GetPrintscreenNTexture(camera);
  382. if (hasFightTarget)
  383. {
  384. ViewManager.Show(ViewName.STORY_FIGHT_TARGET_VIEW);
  385. }
  386. else
  387. {
  388. ViewManager.Show(ViewName.STORY_FIGHT_SINGLE_VIEW);
  389. }
  390. this.Hide();
  391. }
  392. private void OnClickBtnRecommend()
  393. {
  394. if (this.currentListType == DressUpListType.List4)
  395. {
  396. this.hideListParts2();
  397. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  398. }
  399. EquipDataCache.cacher.TryCancelSuit(_currentSuitId);
  400. InstanceZonesDataManager.usedRecommend = true;
  401. EquipDataCache.cacher.PutOnRecommendItems();
  402. UpdateListPartsSelected();
  403. UpdateListSuitPartsSelected();
  404. }
  405. private void InitLists()
  406. {
  407. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  408. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  409. _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
  410. listType1X = _ui.m_comListType1.target.x;
  411. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;
  412. //一级菜单
  413. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  414. }
  415. private void showListType1()
  416. {
  417. _currentList2 = null;
  418. currentListType = DressUpListType.List1;
  419. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  420. GTween.To(_ui.target.width, listType1X, 0.5f)
  421. .SetTarget(_ui.m_comListType1.target)
  422. .OnUpdate((GTweener t) =>
  423. {
  424. _ui.m_comListType1.target.x = t.value.x;
  425. });
  426. }
  427. private void hideListType1()
  428. {
  429. GTween.To(listType1X, _ui.target.width, 0.5f)
  430. .SetTarget(_ui.m_comListType1.target)
  431. .OnUpdate((GTweener t) =>
  432. {
  433. _ui.m_comListType1.target.x = t.value.x;
  434. });
  435. }
  436. private void showListType2(int[] menuStrArr = null)
  437. {
  438. currentListType = DressUpListType.List2;
  439. if (menuStrArr != null && menuStrArr.Length > 0)
  440. {
  441. int len = menuStrArr.Length;
  442. _currentList2 = menuStrArr.Clone() as int[];
  443. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  444. _ui.m_comListType2.m_listType.numItems = len;
  445. //_ui.m_listType2.ResizeToFit(_ui.m_listType2.numItems);
  446. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  447. if (_ui.m_comListType2.m_listType.height > maxHeight)
  448. {
  449. _ui.m_comListType2.m_listType.height = maxHeight;
  450. }
  451. }
  452. GTween.To(_ui.target.width, listType1X, 0.5f)
  453. .SetTarget(_ui.m_comListType2.target)
  454. .OnUpdate((GTweener t) =>
  455. {
  456. _ui.m_comListType2.target.x = t.value.x;
  457. });
  458. }
  459. private void hideListType2()
  460. {
  461. GTween.To(listType1X, _ui.target.width, 0.5f)
  462. .SetTarget(_ui.m_comListType2.target)
  463. .OnUpdate((GTweener t) =>
  464. {
  465. _ui.m_comListType2.target.x = t.value.x;
  466. });
  467. }
  468. private bool showListParts(int type, bool selectItem = false)
  469. {
  470. _currentMenuType = type;
  471. UpdatePartsListSort();
  472. if (_ui.m_partsList.m_list.numItems <= 0) return false;
  473. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  474. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;
  475. if (_ui.m_partsList.m_list.height > maxHeight)
  476. {
  477. _ui.m_partsList.m_list.height = maxHeight;
  478. }
  479. if (selectItem)
  480. {
  481. int itemId = EquipDataCache.cacher.GetItemIdBuyType(_currentMenuType);
  482. if (itemId > 0)
  483. {
  484. int index = _currentList3.IndexOf(itemId);
  485. _ui.m_partsList.m_list.ScrollToView(index);
  486. }
  487. }
  488. currentListType = DressUpListType.List3;
  489. GTween.To(_ui.target.width, partsListX, 0.5f)
  490. .SetTarget(_ui.m_partsList)
  491. .OnUpdate((GTweener t) =>
  492. {
  493. _ui.m_partsList.target.x = t.value.x;
  494. });
  495. UpdateListPartsSelected();
  496. return true;
  497. }
  498. private void OnComboBoxRarityChanged()
  499. {
  500. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  501. this.UpdatePartsListSort();
  502. }
  503. private void UpdatePartsListSort()
  504. {
  505. if (_currentMenuType == 0) return;
  506. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  507. {
  508. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  509. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  510. {
  511. _currentList3 = SuitUtil.SortSuitListByHighScore(_currentList3);
  512. }
  513. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  514. {
  515. _currentList3 = SuitUtil.SortSuitListByLowScore(_currentList3);
  516. }
  517. else
  518. {
  519. _currentList3.Reverse();
  520. }
  521. }
  522. else
  523. {
  524. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  525. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  526. {
  527. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3);
  528. }
  529. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  530. {
  531. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3);
  532. }
  533. else
  534. {
  535. _currentList3.Reverse();
  536. }
  537. }
  538. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  539. {
  540. _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3, _currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG);
  541. }
  542. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  543. {
  544. _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3, _currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG);
  545. }
  546. //必穿品放在列表最前面
  547. if (_fightCfg.needItemId > 0)
  548. {
  549. int index = _currentList3.IndexOf(_fightCfg.needItemId);
  550. if (index >= 0)
  551. {
  552. int item = _currentList3[index];
  553. _currentList3.Remove(_currentList3[index]);
  554. _currentList3.Insert(0, item);
  555. }
  556. }
  557. else if (_fightCfg.needSuitId > 0)
  558. {
  559. int index = _currentList3.IndexOf(_fightCfg.needSuitId);
  560. if (index >= 0)
  561. {
  562. int item = _currentList3[index];
  563. _currentList3.Remove(_currentList3[index]);
  564. _currentList3.Insert(0, item);
  565. }
  566. }
  567. _ui.m_partsList.m_list.RemoveChildrenToPool();
  568. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  569. }
  570. private void UpdateSuitPartsListSort()
  571. {
  572. if (_currentMenuType == 0) return;
  573. _currentList4 = new List<int>(SuitCfgManager.Instance.GetSuitItems(_currentSuitId, true));
  574. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  575. {
  576. _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4, false);
  577. }
  578. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  579. {
  580. _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4, false);
  581. }
  582. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  583. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  584. }
  585. private void hideListParts()
  586. {
  587. GTween.To(partsListX, _ui.target.width, 0.5f)
  588. .SetTarget(_ui.m_partsList)
  589. .OnUpdate((GTweener t) =>
  590. {
  591. _ui.m_partsList.target.x = t.value.x;
  592. });
  593. }
  594. private void showListParts2(int suitId)
  595. {
  596. _currentSuitId = suitId;
  597. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  598. this.UpdateSuitPartsListSort();
  599. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  600. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
  601. if (_ui.m_partsList2.m_list.height > maxHeight)
  602. {
  603. _ui.m_partsList2.m_list.height = maxHeight;
  604. }
  605. currentListType = DressUpListType.List4;
  606. GTween.To(_ui.target.width, partsListX, 0.5f)
  607. .SetTarget(_ui.m_partsList2)
  608. .OnUpdate((GTweener t) =>
  609. {
  610. _ui.m_partsList2.target.x = t.value.x;
  611. });
  612. }
  613. private void hideListParts2()
  614. {
  615. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  616. GTween.To(partsListX, _ui.target.width, 0.5f)
  617. .SetTarget(_ui.m_partsList2)
  618. .OnUpdate((GTweener t) =>
  619. {
  620. _ui.m_partsList2.target.x = t.value.x;
  621. });
  622. }
  623. private void ListType1Item(int index, GObject item)
  624. {
  625. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  626. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  627. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  628. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  629. typeItem.target.data = item1.id;
  630. typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
  631. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.id);
  632. UI_TypeItem.ProxyEnd();
  633. }
  634. private void ListType2Item(int index, GObject item)
  635. {
  636. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  637. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  638. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  639. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  640. typeItem.target.data = item2.id;
  641. var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  642. typeItem.m_imgNeed.visible = subType == item2.type;
  643. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
  644. UI_TypeItem.ProxyEnd();
  645. }
  646. private void ListPartsItem(int index, GObject item)
  647. {
  648. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  649. int id = (int)_currentList3[index];
  650. string iconRes = "";
  651. string partName = "";
  652. string ext = "png";
  653. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  654. {
  655. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  656. iconRes = suitCfg.res;
  657. partName = suitCfg.name;
  658. listItem.m_iconSelected.visible = false;
  659. listItem.m_txtScore.text = "" + SuitUtil.GetSuitScore(id);
  660. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  661. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  662. listItem.m_imgNew.visible = false;
  663. }
  664. else
  665. {
  666. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  667. iconRes = itemCfg.res;
  668. partName = itemCfg.name;
  669. listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
  670. listItem.m_txtScore.text = "" + DressUpMenuItemDataManager.GetItemScore(id);
  671. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  672. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  673. listItem.m_imgNew.visible = isNew;
  674. if (isNew)
  675. {
  676. ItemProxy.ReqSetItemRead(id).Coroutine();
  677. }
  678. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  679. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  680. }
  681. if (listItem.target.data == null)
  682. {
  683. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  684. longPressGesture.once = true;
  685. longPressGesture.onAction.Add(OnLongPress);
  686. _listLongPress.Add(longPressGesture);
  687. }
  688. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  689. listItem.m_ScoreType.url = "ui://CommonGame/kp_sx_" + _fightCfg.scoreType;
  690. listItem.m_txtTitle.text = partName;
  691. listItem.target.data = id;
  692. listItem.m_imgNeed.visible = _fightCfg.needItemId == id || _fightCfg.needSuitId == id;
  693. UI_PartsListItem.ProxyEnd();
  694. }
  695. private void ListParts2Item(int index, GObject item)
  696. {
  697. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  698. int id = (int)_currentList4[index];
  699. string iconRes = "";
  700. string partName = "";
  701. string ext = "png";
  702. if (listItem.target.data == null)
  703. {
  704. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  705. longPressGesture.once = true;
  706. longPressGesture.onAction.Add(OnLongPress);
  707. _listLongPress.Add(longPressGesture);
  708. }
  709. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  710. iconRes = itemCfg.res;
  711. partName = itemCfg.name;
  712. listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
  713. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  714. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  715. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  716. listItem.m_ScoreType.visible = true;
  717. // int mainScore;
  718. // int mainValuel;
  719. // ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
  720. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + _fightCfg.scoreType);
  721. listItem.m_txtScore.text = "" + DressUpMenuItemDataManager.GetItemScore(id, _fightCfg.scoreType);
  722. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  723. listItem.m_txtTitle.text = partName;
  724. listItem.target.data = id;
  725. // listItem.m_txtScore.visible = false;
  726. //listItem.m_ScoreType.visible = true;
  727. listItem.m_imgNeed.visible = false;
  728. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  729. listItem.m_imgNew.visible = isNew;
  730. if (isNew)
  731. {
  732. ItemProxy.ReqSetItemRead(id).Coroutine();
  733. }
  734. UI_PartsListItem.ProxyEnd();
  735. }
  736. private void UpdateListPartsSelected()
  737. {
  738. int count = _ui.m_partsList.m_list.numChildren;
  739. int suitId = EquipDataCache.cacher.CheckCurDressIsSuit();
  740. for (int i = 0; i < count; i++)
  741. {
  742. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(i));
  743. int id = (int)listItem.target.data;
  744. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  745. {
  746. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  747. }
  748. else
  749. {
  750. bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  751. bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  752. bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  753. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  754. }
  755. UI_PartsListItem.ProxyEnd();
  756. }
  757. }
  758. private void UpdateListSuitPartsSelected()
  759. {
  760. int count = _ui.m_partsList2.m_list.numChildren;
  761. int suitId = EquipDataCache.cacher.CheckCurDressIsSuit();
  762. for (int i = 0; i < count; i++)
  763. {
  764. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  765. int id = (int)listItem.target.data;
  766. bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  767. bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  768. bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  769. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  770. UI_PartsListItem.ProxyEnd();
  771. }
  772. }
  773. private void ShowTaskHint()
  774. {
  775. _ui.m_groupTaskHint.visible = true;
  776. _ui.m_txtHint.text = _levelCfg.hint;
  777. if (this._ui.m_txtHint.textHeight > this._ui.m_txtHint.textFormat.size * 2)
  778. {
  779. this._ui.m_txtHint.align = AlignType.Left;
  780. }
  781. else
  782. {
  783. this._ui.m_txtHint.align = AlignType.Center;
  784. }
  785. }
  786. private void UpdateScore()
  787. {
  788. _ui.m_txtScore.text = "" + EquipDataCache.cacher.score;
  789. // GuideController.TryGuideDressUpFightViewBtnNext(_ui.m_btnNext);
  790. }
  791. private void OnClickBtnSearch()
  792. {
  793. ViewManager.Show<DressFilterView>(false, new object[] { ViewName.DRESS_UP_VIEW });
  794. }
  795. private void OnClickBtnAutoPlay()
  796. {
  797. EquipDataCache.cacher.autoPlay = _ui.m_btnAutoPlay.selected;
  798. }
  799. // private void OnClickBtnShow()
  800. // {
  801. // Timers.inst.Remove(SetBtnShowVisable);
  802. // _ui.m_c1.selectedIndex = 0;
  803. // _ui.m_btnHide.visible = true;
  804. // _ui.m_loaShow.visible = false;
  805. // _ui.m_btnShow.visible = false;
  806. // }
  807. // private void OnClickBtnHide()
  808. // {
  809. // _ui.m_c1.selectedIndex = 1;
  810. // _ui.m_btnHide.visible = false;
  811. // _ui.m_btnShow.visible = true;
  812. // _ui.m_loaShow.visible = true;
  813. // Timers.inst.Add(2f, 1, SetBtnShowVisable);
  814. // }
  815. // private void OnClickLoaShow()
  816. // {
  817. // Timers.inst.Remove(SetBtnShowVisable);
  818. // _ui.m_btnShow.alpha = 1;
  819. // Timers.inst.Add(2f, 1, SetBtnShowVisable);
  820. // _ui.m_btnShow.enabled = true;
  821. // }
  822. // private void SetBtnShowVisable(object param)
  823. // {
  824. // _ui.m_btnShow.enabled = false;
  825. // GTween.To(1, 0, 0.3f).SetTarget(_ui.m_btnShow, TweenPropType.Alpha);
  826. // }
  827. private void OnClickComNeed()
  828. {
  829. if (_fightCfg.needItemId <= 0 && _fightCfg.needSuitId <= 0)
  830. {
  831. return;
  832. }
  833. if (_fightCfg.needSuitId > 0)
  834. {
  835. 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 });
  836. }
  837. else
  838. {
  839. // ViewManager.Show(ViewName.APPROACH_OF_ITEM_VIEW, new object[] { _ui.m_compNeed.target.data, new object[] { ViewName.DRESS_UP_FIGHT_VIEW, this.viewData }, 1 });
  840. int itemId = (int)_ui.m_compNeed.target.data;
  841. object[] sourceDatas = new object[] { itemId, new object[] { ViewName.DRESS_UP_FIGHT_VIEW, this.viewData }, 1 };
  842. GoodsItemTipsController.ShowItemTips(itemId, sourceDatas);
  843. }
  844. }
  845. private void RenderListTagItem(int index, GObject obj)
  846. {
  847. UI.CommonGame.UI_ListTagItem item = UI.CommonGame.UI_ListTagItem.Proxy(obj);
  848. string tag = _fightCfg.needTagsArr[index];
  849. int tagType = TagCfgArray.Instance.GetCfg(tag).type;
  850. item.m_txtTag.text = tag;
  851. item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
  852. UI.CommonGame.UI_ListTagItem.ProxyEnd();
  853. }
  854. private bool CheckListCount(int type)
  855. {
  856. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  857. {
  858. return DressUpMenuSuitDataManager.GetSuitIDList().Count > 0;
  859. }
  860. else
  861. {
  862. return DressUpMenuItemDataManager.getItemDatasByType(type).Count > 0;
  863. }
  864. }
  865. private void SendLog()
  866. {
  867. var levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  868. switch (levelCfg.type)
  869. {
  870. case ConstInstanceZonesType.Story:
  871. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.CHUN_ZHONG_LOU, 2);
  872. break;
  873. case ConstInstanceZonesType.Studio:
  874. StudioCfg studioCfg = StudioCfgArray.Instance.GetCfg(levelCfg.chapterId);
  875. if (studioCfg.funId == typeof(StudioMetalView).Name)
  876. {
  877. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.JIN_SHU_XIU_FU, 2);
  878. }
  879. else if (studioCfg.funId == typeof(StudioFabricView).Name)
  880. {
  881. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.ZHI_WU_XIU_FU, 2);
  882. }
  883. else if (studioCfg.funId == typeof(StudioPropertyView).Name)
  884. {
  885. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.SHU_HUA_XIU_FU, 2);
  886. }
  887. break;
  888. }
  889. }
  890. private void CheckGuide(object param)
  891. {
  892. if (GuideDataManager.IsGuideFinish(ConstGuideId.SINGLE_FIGHT) <= 0
  893. || GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0
  894. || GuideDataManager.IsGuideFinish(ConstGuideId.FIGHT_TIPS) <= 0)
  895. {
  896. UpdateToCheckGuide(null);
  897. }
  898. else
  899. {
  900. Timers.inst.Remove(CheckGuide);
  901. }
  902. }
  903. protected override void UpdateToCheckGuide(object param)
  904. {
  905. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  906. int syIndex = 0;
  907. int xzIndex = 0;
  908. int buyClothingIndex = 0;
  909. int buyClothingSubIndex = 0;
  910. int len = _ui.m_comListType1.m_listType.numChildren;
  911. for (int i = 0; i < len; i++)
  912. {
  913. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  914. if (item != null)
  915. {
  916. int menuID = (int)item.target.data;
  917. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  918. if (GuideDataManager.IsGuideFinish(ConstGuideId.SINGLE_FIGHT) <= 0 && dressUpMenuItemCfg1.type == ConstDressUpItemType.SHANG_YI)
  919. {
  920. syIndex = i;
  921. }
  922. if (GuideDataManager.IsGuideFinish(ConstGuideId.SINGLE_FIGHT) <= 0 && dressUpMenuItemCfg1.type == ConstDressUpItemType.XIA_ZHUANG)
  923. {
  924. xzIndex = i;
  925. }
  926. if (_fightCfg.needItemId > 0)
  927. {
  928. int type = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  929. if (GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0 && ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, dressUpMenuItemCfg1.id))
  930. {
  931. buyClothingIndex = i;
  932. }
  933. }
  934. }
  935. UI_TypeItem.ProxyEnd();
  936. }
  937. int len1 = _ui.m_comListType2.m_listType.numChildren;
  938. for (int i = 0; i < len1; i++)
  939. {
  940. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType2.m_listType.GetChildAt(i));
  941. if (item != null)
  942. {
  943. int menuID = (int)item.target.data;
  944. DressUpMenuItemCfg2 dressUpMenuItemCfg2 = DressUpMenuItemCfg2Array.Instance.GetCfg(menuID);
  945. var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  946. if (subType == dressUpMenuItemCfg2.type)
  947. {
  948. buyClothingSubIndex = i;
  949. }
  950. }
  951. UI_TypeItem.ProxyEnd();
  952. }
  953. int djcId = 10476;//点绛唇Id
  954. int djcIndex = 0;
  955. int buyClothingIdIndex = 0;
  956. for (int i = 0; i < _currentList3.Count; i++)
  957. {
  958. if (_currentList3[i] == djcId)
  959. {
  960. djcIndex = i;
  961. }
  962. if (_fightCfg.needItemId > 0 && _currentList3[i] == _fightCfg.needItemId)
  963. {
  964. buyClothingIdIndex = i;
  965. }
  966. }
  967. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.SINGLE_FIGHT, 3, "点击相应的分类,可以快速找到服饰。", syIndex);
  968. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.SINGLE_FIGHT, 4, "", 0, true, (int)_ui.m_partsList.m_list.y);
  969. GuideController.TryGuide(_ui.m_btnGuide, ConstGuideId.SINGLE_FIGHT, 5, "", -1, true, 0, 0, 0, false);
  970. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.SINGLE_FIGHT, 6, "接下来把裙子也换上。", xzIndex);
  971. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.SINGLE_FIGHT, 7, "", 0, true, (int)_ui.m_partsList.m_list.y);
  972. GuideController.TryGuide(_ui.m_btnNext, ConstGuideId.SINGLE_FIGHT, 8, "穿着完毕,来验证一下,换上的服饰是否符合需求。");
  973. GuideController.TryGuide(_ui.m_compNeed.target, ConstGuideId.BUY_CLOTHING, 3, "当提示有“必需品”时,需要穿上对应物品才能通关。", -1, true, 170);
  974. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.BUY_CLOTHING, 7, "按照指示就可以找到必需品啦。", buyClothingIndex);
  975. GuideController.TryGuide(_ui.m_comListType2.m_listType, ConstGuideId.BUY_CLOTHING, 8, "", buyClothingSubIndex);
  976. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.BUY_CLOTHING, 9, "点击换上吧。", buyClothingIdIndex, true, 170);
  977. GuideController.TryCompleteGuide(ConstGuideId.BUY_CLOTHING, 9);
  978. GuideController.TryGuide(_ui.m_btnHint, ConstGuideId.FIGHT_TIPS, 1, "这次换装需要获得别人的认可呢。");
  979. GuideController.TryCompleteGuide(ConstGuideId.FIGHT_TIPS, 1);
  980. }
  981. }
  982. }