DressUpFightView.cs 45 KB

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