DressUpFightView.cs 45 KB

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