DressUpFightView.cs 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082
  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(_currentList2);
  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 = EquipDataCache.cacher.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. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
  414. GTween.To(_ui.target.width, listType1X, 0.5f)
  415. .SetTarget(_ui.m_comListType1.target)
  416. .OnUpdate((GTweener t) =>
  417. {
  418. _ui.m_comListType1.target.x = t.value.x;
  419. });
  420. }
  421. private void hideListType1()
  422. {
  423. GTween.To(listType1X, _ui.target.width, 0.5f)
  424. .SetTarget(_ui.m_comListType1.target)
  425. .OnUpdate((GTweener t) =>
  426. {
  427. _ui.m_comListType1.target.x = t.value.x;
  428. });
  429. }
  430. private void showListType2(int[] menuStrArr = null)
  431. {
  432. currentListType = DressUpListType.List2;
  433. if (menuStrArr != null && menuStrArr.Length > 0)
  434. {
  435. int len = menuStrArr.Length;
  436. _currentList2 = menuStrArr.Clone() as int[];
  437. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  438. _ui.m_comListType2.m_listType.numItems = len;
  439. //_ui.m_listType2.ResizeToFit(_ui.m_listType2.numItems);
  440. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  441. if (_ui.m_comListType2.m_listType.height > maxHeight)
  442. {
  443. _ui.m_comListType2.m_listType.height = maxHeight;
  444. }
  445. }
  446. GTween.To(_ui.target.width, listType1X, 0.5f)
  447. .SetTarget(_ui.m_comListType2.target)
  448. .OnUpdate((GTweener t) =>
  449. {
  450. _ui.m_comListType2.target.x = t.value.x;
  451. });
  452. }
  453. private void hideListType2()
  454. {
  455. GTween.To(listType1X, _ui.target.width, 0.5f)
  456. .SetTarget(_ui.m_comListType2.target)
  457. .OnUpdate((GTweener t) =>
  458. {
  459. _ui.m_comListType2.target.x = t.value.x;
  460. });
  461. }
  462. private bool showListParts(int type, bool selectItem = false)
  463. {
  464. _currentMenuType = type;
  465. UpdatePartsListSort();
  466. if (_ui.m_partsList.m_list.numItems <= 0) return false;
  467. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  468. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;
  469. if (_ui.m_partsList.m_list.height > maxHeight)
  470. {
  471. _ui.m_partsList.m_list.height = maxHeight;
  472. }
  473. if (selectItem)
  474. {
  475. int itemId = EquipDataCache.cacher.GetItemIdBuyType(_currentMenuType);
  476. if (itemId > 0)
  477. {
  478. int index = _currentList3.IndexOf(itemId);
  479. _ui.m_partsList.m_list.ScrollToView(index);
  480. }
  481. }
  482. currentListType = DressUpListType.List3;
  483. GTween.To(_ui.target.width, partsListX, 0.5f)
  484. .SetTarget(_ui.m_partsList)
  485. .OnUpdate((GTweener t) =>
  486. {
  487. _ui.m_partsList.target.x = t.value.x;
  488. });
  489. UpdateListPartsSelected();
  490. return true;
  491. }
  492. private void OnComboBoxRarityChanged()
  493. {
  494. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  495. this.UpdatePartsListSort();
  496. }
  497. private void UpdatePartsListSort()
  498. {
  499. if (_currentMenuType == 0) return;
  500. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  501. {
  502. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  503. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  504. {
  505. _currentList3 = SuitUtil.SortSuitListByHighScore(_currentList3);
  506. }
  507. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  508. {
  509. _currentList3 = SuitUtil.SortSuitListByLowScore(_currentList3);
  510. }
  511. else
  512. {
  513. _currentList3.Reverse();
  514. }
  515. }
  516. else
  517. {
  518. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  519. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  520. {
  521. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3);
  522. }
  523. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  524. {
  525. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3);
  526. }
  527. else
  528. {
  529. _currentList3.Reverse();
  530. }
  531. }
  532. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  533. {
  534. _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3, _currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG);
  535. }
  536. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  537. {
  538. _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3, _currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG);
  539. }
  540. //必穿品放在列表最前面
  541. if (_fightCfg.needItemId > 0)
  542. {
  543. int index = _currentList3.IndexOf(_fightCfg.needItemId);
  544. if (index >= 0)
  545. {
  546. int item = _currentList3[index];
  547. _currentList3.Remove(_currentList3[index]);
  548. _currentList3.Insert(0, item);
  549. }
  550. }
  551. else if (_fightCfg.needSuitId > 0)
  552. {
  553. int index = _currentList3.IndexOf(_fightCfg.needSuitId);
  554. if (index >= 0)
  555. {
  556. int item = _currentList3[index];
  557. _currentList3.Remove(_currentList3[index]);
  558. _currentList3.Insert(0, item);
  559. }
  560. }
  561. _ui.m_partsList.m_list.RemoveChildrenToPool();
  562. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  563. }
  564. private void UpdateSuitPartsListSort()
  565. {
  566. if (_currentMenuType == 0) return;
  567. _currentList4 = new List<int>(SuitCfgManager.Instance.GetSuitItems(_currentSuitId, true));
  568. if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  569. {
  570. _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4, false);
  571. }
  572. else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  573. {
  574. _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4, false);
  575. }
  576. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  577. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  578. }
  579. private void hideListParts()
  580. {
  581. GTween.To(partsListX, _ui.target.width, 0.5f)
  582. .SetTarget(_ui.m_partsList)
  583. .OnUpdate((GTweener t) =>
  584. {
  585. _ui.m_partsList.target.x = t.value.x;
  586. });
  587. }
  588. private void showListParts2(int suitId)
  589. {
  590. _currentSuitId = suitId;
  591. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  592. this.UpdateSuitPartsListSort();
  593. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  594. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
  595. if (_ui.m_partsList2.m_list.height > maxHeight)
  596. {
  597. _ui.m_partsList2.m_list.height = maxHeight;
  598. }
  599. currentListType = DressUpListType.List4;
  600. GTween.To(_ui.target.width, partsListX, 0.5f)
  601. .SetTarget(_ui.m_partsList2)
  602. .OnUpdate((GTweener t) =>
  603. {
  604. _ui.m_partsList2.target.x = t.value.x;
  605. });
  606. }
  607. private void hideListParts2()
  608. {
  609. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  610. GTween.To(partsListX, _ui.target.width, 0.5f)
  611. .SetTarget(_ui.m_partsList2)
  612. .OnUpdate((GTweener t) =>
  613. {
  614. _ui.m_partsList2.target.x = t.value.x;
  615. });
  616. }
  617. private void ListType1Item(int index, GObject item)
  618. {
  619. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  620. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  621. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  622. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  623. typeItem.target.data = item1.id;
  624. typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
  625. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.id);
  626. UI_TypeItem.ProxyEnd();
  627. }
  628. private void ListType2Item(int index, GObject item)
  629. {
  630. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  631. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  632. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  633. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  634. typeItem.target.data = item2.id;
  635. var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  636. typeItem.m_imgNeed.visible = subType == item2.type;
  637. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
  638. UI_TypeItem.ProxyEnd();
  639. }
  640. private void ListPartsItem(int index, GObject item)
  641. {
  642. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  643. int id = (int)_currentList3[index];
  644. string iconRes = "";
  645. string partName = "";
  646. string ext = "png";
  647. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  648. {
  649. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  650. iconRes = suitCfg.res;
  651. partName = suitCfg.name;
  652. listItem.m_iconSelected.visible = false;
  653. listItem.m_txtScore.text = "" + SuitUtil.GetSuitScore(id);
  654. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  655. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  656. listItem.m_imgNew.visible = false;
  657. }
  658. else
  659. {
  660. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  661. iconRes = itemCfg.res;
  662. partName = itemCfg.name;
  663. listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
  664. listItem.m_txtScore.text = "" + DressUpMenuItemDataManager.GetItemScore(id);
  665. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  666. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  667. listItem.m_imgNew.visible = isNew;
  668. if (isNew)
  669. {
  670. ItemProxy.ReqSetItemRead(id).Coroutine();
  671. }
  672. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  673. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  674. }
  675. if (listItem.target.data == null)
  676. {
  677. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  678. longPressGesture.once = true;
  679. longPressGesture.onAction.Add(OnLongPress);
  680. _listLongPress.Add(longPressGesture);
  681. }
  682. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  683. listItem.m_ScoreType.url = "ui://CommonGame/kp_sx_" + _fightCfg.scoreType;
  684. listItem.m_txtTitle.text = partName;
  685. listItem.target.data = id;
  686. listItem.m_imgNeed.visible = _fightCfg.needItemId == id || _fightCfg.needSuitId == id;
  687. UI_PartsListItem.ProxyEnd();
  688. }
  689. private void ListParts2Item(int index, GObject item)
  690. {
  691. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  692. int id = (int)_currentList4[index];
  693. string iconRes = "";
  694. string partName = "";
  695. string ext = "png";
  696. if (listItem.target.data == null)
  697. {
  698. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  699. longPressGesture.once = true;
  700. longPressGesture.onAction.Add(OnLongPress);
  701. _listLongPress.Add(longPressGesture);
  702. }
  703. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  704. iconRes = itemCfg.res;
  705. partName = itemCfg.name;
  706. listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
  707. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  708. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  709. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  710. listItem.m_ScoreType.visible = true;
  711. // int mainScore;
  712. // int mainValuel;
  713. // ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
  714. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + _fightCfg.scoreType);
  715. listItem.m_txtScore.text = "" + DressUpMenuItemDataManager.GetItemScore(id, _fightCfg.scoreType);
  716. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  717. listItem.m_txtTitle.text = partName;
  718. listItem.target.data = id;
  719. // listItem.m_txtScore.visible = false;
  720. //listItem.m_ScoreType.visible = true;
  721. listItem.m_imgNeed.visible = false;
  722. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  723. listItem.m_imgNew.visible = isNew;
  724. if (isNew)
  725. {
  726. ItemProxy.ReqSetItemRead(id).Coroutine();
  727. }
  728. UI_PartsListItem.ProxyEnd();
  729. }
  730. private void UpdateListPartsSelected()
  731. {
  732. int count = _ui.m_partsList.m_list.numChildren;
  733. int suitId = EquipDataCache.cacher.CheckCurDressIsSuit();
  734. for (int i = 0; i < count; i++)
  735. {
  736. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList.m_list.GetChildAt(i));
  737. int id = (int)listItem.target.data;
  738. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  739. {
  740. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  741. }
  742. else
  743. {
  744. bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  745. bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  746. bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  747. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  748. }
  749. UI_PartsListItem.ProxyEnd();
  750. }
  751. }
  752. private void UpdateListSuitPartsSelected()
  753. {
  754. int count = _ui.m_partsList2.m_list.numChildren;
  755. int suitId = EquipDataCache.cacher.CheckCurDressIsSuit();
  756. for (int i = 0; i < count; i++)
  757. {
  758. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  759. int id = (int)listItem.target.data;
  760. bool isPutOn = EquipDataCache.cacher.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  761. bool isSuit = !DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && SuitCfgManager.Instance.GetItemSuitId(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  762. bool isSceneSuit = DressUpMenuItemDataManager.CheckIsSceneType(id) && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  763. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  764. UI_PartsListItem.ProxyEnd();
  765. }
  766. }
  767. private void ShowTaskHint()
  768. {
  769. _ui.m_groupTaskHint.visible = true;
  770. _ui.m_txtHint.text = _levelCfg.hint;
  771. if (this._ui.m_txtHint.textHeight > this._ui.m_txtHint.textFormat.size * 2)
  772. {
  773. this._ui.m_txtHint.align = AlignType.Left;
  774. }
  775. else
  776. {
  777. this._ui.m_txtHint.align = AlignType.Center;
  778. }
  779. }
  780. private void UpdateScore()
  781. {
  782. _ui.m_txtScore.text = "" + EquipDataCache.cacher.score;
  783. // GuideController.TryGuideDressUpFightViewBtnNext(_ui.m_btnNext);
  784. }
  785. private void OnClickBtnSearch()
  786. {
  787. ViewManager.Show<DressFilterView>(false, new object[] { ViewName.DRESS_UP_VIEW });
  788. }
  789. private void OnClickBtnAutoPlay()
  790. {
  791. EquipDataCache.cacher.autoPlay = _ui.m_btnAutoPlay.selected;
  792. }
  793. // private void OnClickBtnShow()
  794. // {
  795. // Timers.inst.Remove(SetBtnShowVisable);
  796. // _ui.m_c1.selectedIndex = 0;
  797. // _ui.m_btnHide.visible = true;
  798. // _ui.m_loaShow.visible = false;
  799. // _ui.m_btnShow.visible = false;
  800. // }
  801. // private void OnClickBtnHide()
  802. // {
  803. // _ui.m_c1.selectedIndex = 1;
  804. // _ui.m_btnHide.visible = false;
  805. // _ui.m_btnShow.visible = true;
  806. // _ui.m_loaShow.visible = true;
  807. // Timers.inst.Add(2f, 1, SetBtnShowVisable);
  808. // }
  809. // private void OnClickLoaShow()
  810. // {
  811. // Timers.inst.Remove(SetBtnShowVisable);
  812. // _ui.m_btnShow.alpha = 1;
  813. // Timers.inst.Add(2f, 1, SetBtnShowVisable);
  814. // _ui.m_btnShow.enabled = true;
  815. // }
  816. // private void SetBtnShowVisable(object param)
  817. // {
  818. // _ui.m_btnShow.enabled = false;
  819. // GTween.To(1, 0, 0.3f).SetTarget(_ui.m_btnShow, TweenPropType.Alpha);
  820. // }
  821. private void OnClickComNeed()
  822. {
  823. if (_fightCfg.needItemId <= 0 && _fightCfg.needSuitId <= 0)
  824. {
  825. return;
  826. }
  827. if (_fightCfg.needSuitId > 0)
  828. {
  829. 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 });
  830. }
  831. else
  832. {
  833. // ViewManager.Show(ViewName.APPROACH_OF_ITEM_VIEW, new object[] { _ui.m_compNeed.target.data, new object[] { ViewName.DRESS_UP_FIGHT_VIEW, this.viewData }, 1 });
  834. int itemId = (int)_ui.m_compNeed.target.data;
  835. object[] sourceDatas = new object[] { itemId, new object[] { ViewName.DRESS_UP_FIGHT_VIEW, this.viewData }, 1 };
  836. GoodsItemTipsController.ShowItemTips(itemId, sourceDatas);
  837. }
  838. }
  839. private void RenderListTagItem(int index, GObject obj)
  840. {
  841. UI.CommonGame.UI_ListTagItem item = UI.CommonGame.UI_ListTagItem.Proxy(obj);
  842. string tag = _fightCfg.needTagsArr[index];
  843. int tagType = TagCfgArray.Instance.GetCfg(tag).type;
  844. item.m_txtTag.text = tag;
  845. item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
  846. UI.CommonGame.UI_ListTagItem.ProxyEnd();
  847. }
  848. private bool CheckListCount(int type)
  849. {
  850. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  851. {
  852. return DressUpMenuSuitDataManager.GetSuitIDList().Count > 0;
  853. }
  854. else
  855. {
  856. return DressUpMenuItemDataManager.getItemDatasByType(type).Count > 0;
  857. }
  858. }
  859. private void SendLog()
  860. {
  861. var levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  862. switch (levelCfg.type)
  863. {
  864. case ConstInstanceZonesType.Story:
  865. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.CHUN_ZHONG_LOU, 2);
  866. break;
  867. case ConstInstanceZonesType.Studio:
  868. StudioCfg studioCfg = StudioCfgArray.Instance.GetCfg(levelCfg.chapterId);
  869. if (studioCfg.funId == typeof(StudioMetalView).Name)
  870. {
  871. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.JIN_SHU_XIU_FU, 2);
  872. }
  873. else if (studioCfg.funId == typeof(StudioFabricView).Name)
  874. {
  875. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.ZHI_WU_XIU_FU, 2);
  876. }
  877. else if (studioCfg.funId == typeof(StudioPropertyView).Name)
  878. {
  879. LogServerHelper.SendNodeLog((int)PlayParticipationEnum.SHU_HUA_XIU_FU, 2);
  880. }
  881. break;
  882. }
  883. }
  884. private void CheckGuide(object param)
  885. {
  886. if (GuideDataManager.IsGuideFinish(ConstGuideId.SINGLE_FIGHT) <= 0
  887. || GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0
  888. || GuideDataManager.IsGuideFinish(ConstGuideId.FIGHT_TIPS) <= 0)
  889. {
  890. UpdateToCheckGuide(null);
  891. }
  892. else
  893. {
  894. Timers.inst.Remove(CheckGuide);
  895. }
  896. }
  897. protected override void UpdateToCheckGuide(object param)
  898. {
  899. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  900. int syIndex = 0;
  901. int xzIndex = 0;
  902. int buyClothingIndex = 0;
  903. int buyClothingSubIndex = 0;
  904. int len = _ui.m_comListType1.m_listType.numChildren;
  905. for (int i = 0; i < len; i++)
  906. {
  907. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  908. if (item != null)
  909. {
  910. int menuID = (int)item.target.data;
  911. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  912. if (GuideDataManager.IsGuideFinish(ConstGuideId.SINGLE_FIGHT) <= 0 && dressUpMenuItemCfg1.type == ConstDressUpItemType.SHANG_YI)
  913. {
  914. syIndex = i;
  915. }
  916. if (GuideDataManager.IsGuideFinish(ConstGuideId.SINGLE_FIGHT) <= 0 && dressUpMenuItemCfg1.type == ConstDressUpItemType.XIA_ZHUANG)
  917. {
  918. xzIndex = i;
  919. }
  920. if (_fightCfg.needItemId > 0)
  921. {
  922. int type = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  923. if (GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0 && ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, dressUpMenuItemCfg1.id))
  924. {
  925. buyClothingIndex = i;
  926. }
  927. }
  928. }
  929. UI_TypeItem.ProxyEnd();
  930. }
  931. int len1 = _ui.m_comListType2.m_listType.numChildren;
  932. for (int i = 0; i < len1; i++)
  933. {
  934. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType2.m_listType.GetChildAt(i));
  935. if (item != null)
  936. {
  937. int menuID = (int)item.target.data;
  938. DressUpMenuItemCfg2 dressUpMenuItemCfg2 = DressUpMenuItemCfg2Array.Instance.GetCfg(menuID);
  939. var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  940. if (subType == dressUpMenuItemCfg2.type)
  941. {
  942. buyClothingSubIndex = i;
  943. }
  944. }
  945. UI_TypeItem.ProxyEnd();
  946. }
  947. int djcId = 10476;//点绛唇Id
  948. int djcIndex = 0;
  949. int buyClothingIdIndex = 0;
  950. for (int i = 0; i < _currentList3.Count; i++)
  951. {
  952. if (_currentList3[i] == djcId)
  953. {
  954. djcIndex = i;
  955. }
  956. if (_fightCfg.needItemId > 0 && _currentList3[i] == _fightCfg.needItemId)
  957. {
  958. buyClothingIdIndex = i;
  959. }
  960. }
  961. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.SINGLE_FIGHT, 3, "点击相应的分类,可以快速找到服饰。", syIndex);
  962. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.SINGLE_FIGHT, 4, "", 0, true, (int)_ui.m_partsList.m_list.y);
  963. GuideController.TryGuide(_ui.m_btnGuide, ConstGuideId.SINGLE_FIGHT, 5, "", -1, true, 0, 0, 0, false);
  964. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.SINGLE_FIGHT, 6, "接下来把裙子也换上。", xzIndex);
  965. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.SINGLE_FIGHT, 7, "", 0, true, (int)_ui.m_partsList.m_list.y);
  966. GuideController.TryGuide(_ui.m_btnNext, ConstGuideId.SINGLE_FIGHT, 8, "穿着完毕,来验证一下,换上的服饰是否符合需求。");
  967. GuideController.TryGuide(_ui.m_compNeed.target, ConstGuideId.BUY_CLOTHING, 3, "当提示有“必需品”时,需要穿上对应物品才能通关。", -1, true, 170);
  968. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.BUY_CLOTHING, 7, "按照指示就可以找到必需品啦。", buyClothingIndex);
  969. GuideController.TryGuide(_ui.m_comListType2.m_listType, ConstGuideId.BUY_CLOTHING, 8, "", buyClothingSubIndex);
  970. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.BUY_CLOTHING, 9, "点击换上吧。", buyClothingIdIndex, true, 170);
  971. GuideController.TryCompleteGuide(ConstGuideId.BUY_CLOTHING, 9);
  972. GuideController.TryGuide(_ui.m_btnHint, ConstGuideId.FIGHT_TIPS, 1, "这次换装需要获得别人的认可呢。");
  973. GuideController.TryCompleteGuide(ConstGuideId.FIGHT_TIPS, 1);
  974. }
  975. }
  976. }