DressUpFightView.cs 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569
  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 DressUpFightType
  11. {
  12. public int levelID;
  13. public int teaPartID;
  14. }
  15. public class DressUpFightView : BaseView
  16. {
  17. private UI_DressUpFightUI _ui;
  18. private int _fightID;
  19. private int _levelID;
  20. private int _TeaPartyID;
  21. private float listType1X = 0;
  22. private float partsListX = 0;
  23. private float partsListScrollingPosY = 0;
  24. private DressUpListType currentListType;
  25. private int[] _currentList2;
  26. private GameObject _sceneObject;
  27. private List<int> _currentList3 = new List<int>();
  28. private List<int> _currentList4 = new List<int>();
  29. private int _currentMenuType;
  30. private int _currentSuitId;
  31. private StoryLevelCfg _levelCfg;
  32. private StoryFightCfg _fightCfg;
  33. private int scoreType = 0; //目标分数类型保存
  34. private bool _IsTeaParty = false;
  35. private const int SORT_BY_HIGH_SCORE = 0;
  36. private const int SORT_BY_LOW_SCORE = 1;
  37. private int _scoreIndex = SORT_BY_HIGH_SCORE;
  38. private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
  39. public override void Dispose()
  40. {
  41. if (_sceneObject != null)
  42. {
  43. PrefabManager.Instance.Restore(_sceneObject);
  44. _sceneObject = null;
  45. }
  46. for (int i = 0; i < _listLongPress.Count; i++)
  47. {
  48. _listLongPress[i].Dispose();
  49. }
  50. if (_ui != null)
  51. {
  52. _ui.Dispose();
  53. _ui = null;
  54. }
  55. base.Dispose();
  56. }
  57. protected override void OnInit()
  58. {
  59. base.OnInit();
  60. packageName = UI_DressUpFightUI.PACKAGE_NAME;
  61. _ui = UI_DressUpFightUI.Create();
  62. viewCom = _ui.target;
  63. isfullScreen = true;
  64. //isReturnView = true;
  65. _ui.m_btnClose.width = GRoot.inst.width;
  66. _ui.m_btnClose.height = GRoot.inst.height;
  67. _ui.m_btnClose.AddRelation(GRoot.inst, RelationType.Size);
  68. _ui.m_btnLastStep.visible = true;
  69. _ui.m_btnNextStep.visible = true;
  70. _ui.m_btnClose.visible = false;
  71. _ui.m_grpTips.visible = false;
  72. _ui.m_btnRepeal.visible = false;
  73. _ui.m_btnRenewal.visible = false;
  74. _ui.m_btnSearch.visible = true;
  75. // _ui.m_comboBox.items = new string[] { "我的套装一", "我的套装二", "我的套装三", "我的套装四", "我的套装五", "我的套装六" };
  76. _ui.m_partsList.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
  77. _ui.m_partsListSearch.m_comboBoxRarity.items = new string[] { "高分优先", "低分优先" };
  78. InitLists();
  79. _ui.m_partsList.m_comboBoxRarity.onChanged.Add(OnComboBoxRarityChanged);
  80. _ui.m_partsListSearch.m_comboBoxRarity.onChanged.Add(OnSearchComboBoxRarityChanged);
  81. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  82. _ui.m_btnHome.onClick.Add(OnClickBtnHome);
  83. // _ui.m_btnClothingShop.onClick.Add(OnClickBtnClothingShop);
  84. // _ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
  85. _ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
  86. _ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
  87. _ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
  88. _ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
  89. _ui.m_partsListSearch.m_list.onClickItem.Add(OnClickSearchPartsListItem);
  90. _ui.m_touchPad.onClick.Add(OnTouchPad);
  91. _ui.m_btnHint.onClick.Add(OnClickBtnHint);
  92. // _ui.m_btnGuide.onClick.Add(OnTouchPad);
  93. _ui.m_btnClose.onClick.Add(OnClickBtnClose);
  94. _ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
  95. _ui.m_btnNext.onClick.Add(OnClickBtnNext);
  96. _ui.m_btnRecommend.onClick.Add(OnClickBtnRecommend);
  97. _ui.m_btnSearch.onClick.Add(OnClickBtnSearch);
  98. _ui.m_btnAutoPlay.onClick.Add(OnClickBtnAutoPlay);
  99. _ui.m_btnLastStep.onClick.Add(OnClickBtnLastStep);
  100. _ui.m_btnNextStep.onClick.Add(OnClickBtnNextStep);
  101. _ui.m_btnSubmission.onClick.Add(OnClickBtnSubmission);
  102. _ui.m_compNeed.target.onClick.Add(OnClickComNeed);
  103. _ui.m_compNeed.m_listTag.itemRenderer = RenderListTagItem;
  104. // _ui.m_btnShow.onClick.Add(OnClickBtnShow);
  105. // _ui.m_btnHide.onClick.Add(OnClickBtnHide);
  106. // _ui.m_loaShow.onClick.Add(OnClickLoaShow);
  107. // _ui.m_btnHide.visible = false;
  108. // EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdatePartsListSort);
  109. _ui.m_partsList2.m_comboBoxRarity.visible = false;
  110. _ui.m_partsList2.m_imgTop.visible = true;
  111. _ui.m_partsList.m_imgTop.visible = false;
  112. }
  113. protected override void AddEventListener()
  114. {
  115. base.AddEventListener();
  116. EventAgent.AddEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
  117. EventAgent.AddEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
  118. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
  119. EventAgent.AddEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  120. EventAgent.AddEventListener(ConstMessage.TEA_PARTY_STATU, TeaPartyStatuChange);
  121. EventAgent.AddEventListener(ConstMessage.CLOTHING_SYNTHETIC_SUCCESS, UpdateNeedClothesState);
  122. // EventAgent.AddEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
  123. }
  124. protected override void RemoveEventListener()
  125. {
  126. base.RemoveEventListener();
  127. EventAgent.RemoveEventListener(ConstMessage.CARD_CHOOSE, StartCalculateScore);
  128. EventAgent.RemoveEventListener(ConstMessage.DRESS_SEARCH, UpdateSerch);
  129. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER, UpdateSerch);
  130. EventAgent.RemoveEventListener(ConstMessage.DRESS_FILTER_RESET, DressResetSerch);
  131. EventAgent.RemoveEventListener(ConstMessage.TEA_PARTY_STATU, TeaPartyStatuChange);
  132. EventAgent.RemoveEventListener(ConstMessage.CLOTHING_SYNTHETIC_SUCCESS, UpdateNeedClothesState);
  133. // EventAgent.RemoveEventListener(ConstMessage.DRESS_UP_SCORE_CHANGED, UpdateScore);
  134. }
  135. protected override void OnShown()
  136. {
  137. base.OnShown();
  138. var objData = (DressUpFightType)this.viewData;
  139. if (objData.teaPartID > 0) {
  140. _IsTeaParty = true;
  141. _TeaPartyID = objData.teaPartID;
  142. }
  143. else
  144. _IsTeaParty = false;
  145. _levelID = objData.levelID;
  146. if (!_IsTeaParty)
  147. _ui.m_c1.selectedIndex = 0;
  148. else
  149. _ui.m_c1.selectedIndex = 2;
  150. _ui.m_loaGuide.visible = true;
  151. InstanceZonesDataManager.usedRecommend = false;
  152. // _ui.m_comboBox.title = "我的套装";
  153. _ui.m_txtRecommendCount.SetVar("v1", "" + GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount)).FlushVars();
  154. _ui.m_txtRecommendCount.SetVar("v2", GlobalCfgArray.globalCfg.recommendCount.ToString()).FlushVars();
  155. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  156. _ui.m_btnAutoPlay.selected = FightDataManager.Instance.autoPlay;
  157. _ui.m_btnAutoPlay.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
  158. _ui.m_btnRecommend.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
  159. if (!_IsTeaParty) {
  160. InstanceZonesDataManager.currentLevelCfgId = _levelID;
  161. _levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  162. _fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
  163. if (_levelCfg.type == ConstInstanceZonesType.Field)
  164. {
  165. scoreType = FieldDataManager.Instance.fieldInfos.theme;
  166. _ui.m_btnAutoPlay.visible = false;
  167. }
  168. else {
  169. scoreType = _fightCfg.scoreType;
  170. }
  171. InstanceZonesDataManager.FightScene = _levelCfg.type;
  172. _ui.m_compNeed.target.visible = _fightCfg.needItemId > 0 || _fightCfg.needSuitId > 0 || _fightCfg.needTagsArr.Length > 0;
  173. UpdateNeedClothesState();
  174. }
  175. //判断日志,后续解决飞花令需要删除
  176. if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.Arena && _levelID != 0)
  177. {
  178. Debug.LogError($"text :_levelID: {_levelID}");
  179. }
  180. InstanceZonesDataManager.currentScoreType = scoreType;
  181. //一级菜单
  182. _ui.m_comListType1.m_listType.RemoveChildrenToPool();
  183. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length - 3;
  184. //_ui.m_comListType1.m_listType1.ResizeToFit(_ui.m_listType1.numItems);
  185. float maxHeight = _ui.target.height - _ui.m_comListType1.m_listType.y - DressUpView.BOTTOM_BLANK;
  186. if (_ui.m_comListType1.m_listType.height > maxHeight)
  187. {
  188. _ui.m_comListType1.m_listType.height = maxHeight;
  189. }
  190. _ui.m_comListType1.target.x = _ui.target.width;
  191. _ui.m_comListType2.target.x = _ui.target.width;
  192. _ui.m_partsList.target.x = _ui.target.width;
  193. _ui.m_partsList2.target.x = _ui.target.width;
  194. _ui.m_partsListSearch.target.x = _ui.target.width;
  195. _ui.m_scoreType.url = "ui://CommonGame/kp_sx_" + scoreType;
  196. this.showListType1();
  197. if (_sceneObject == null)
  198. {
  199. _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("SceneDressUpFight"));
  200. MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, false);
  201. MyDressUpHelper.dressUpObj.PutOnDefaultDressUpData(_IsTeaParty);
  202. if (_IsTeaParty) {
  203. foreach (var id in LeagueDataManager.Instance.RoleTeapartyInfo.TempEquipIds)
  204. {
  205. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  206. }
  207. }
  208. }
  209. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  210. UpdateStepBtn(true);
  211. UpdateScore();
  212. if (!_IsTeaParty)
  213. SendLog();
  214. else
  215. {
  216. var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(LeagueDataManager.Instance.TeaPartyId);
  217. _ui.m_txtTeaPartyName.text = teapartyRoleCfg[objData.teaPartID - 1].name;
  218. }
  219. Timers.inst.AddUpdate(CheckGuide);
  220. TeaPartyStatuChange();
  221. }
  222. protected override void OnHide()
  223. {
  224. base.OnHide();
  225. _ui.m_btnClose.visible = false;
  226. _ui.m_grpTips.visible = false;
  227. if (_sceneObject != null)
  228. {
  229. PrefabManager.Instance.Restore(_sceneObject);
  230. _sceneObject = null;
  231. }
  232. _fightCfg = null;
  233. _levelCfg = null;
  234. DressUpMenuItemDataManager.Clear();
  235. MyDressUpHelper.ResetMemory();
  236. Timers.inst.Remove(CheckGuide);
  237. }
  238. private void OnClickBtnLastStep()
  239. {
  240. if (!MyDressUpHelper.OnClickBtnLastStep()) return;
  241. UpdateStepBtn(false);
  242. }
  243. private void OnClickBtnNextStep()
  244. {
  245. if (!MyDressUpHelper.OnClickBtnNextStep()) return;
  246. UpdateStepBtn(false);
  247. }
  248. //茶话会提交搭配
  249. private void OnClickBtnSubmission()
  250. {
  251. AlertUI.Show("是否确认提交本次搭配?")
  252. .SetLeftButton(true, "取消")
  253. .SetRightButton(true, "确认", (object param) =>
  254. {
  255. ChangeTeapartyDressup();
  256. });
  257. }
  258. private async void ChangeTeapartyDressup()
  259. {
  260. DressUpData dressUpData = MyDressUpHelper.dressUpObj.DressUpDataClone();
  261. bool result = await LeagueSproxy.ChangeTeapartyDressup(RoleDataManager.roleId, _TeaPartyID, dressUpData.itemList);
  262. if (result)
  263. {
  264. backView();
  265. }
  266. }
  267. private void backView()
  268. {
  269. if (_IsTeaParty)
  270. {
  271. ViewManager.Show<LeagueTeaPartyView>();
  272. }
  273. else if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType != ConstInstanceZonesSubType.Hard3)
  274. {
  275. ViewManager.Show(StudioDataManager.Instance.VIEW_NAME, StudioDataManager.Instance.PROPERTY_SELECT_INDEX, ViewManager.GetGoBackDatas(StudioDataManager.Instance.VIEW_NAME));
  276. }
  277. else if (_levelCfg.type == ConstInstanceZonesType.Studio && _levelCfg.subType == ConstInstanceZonesSubType.Hard3)
  278. {
  279. if (StudioDataManager.Instance.IsluckyBoxFilingChapter())
  280. {
  281. ViewManager.Show<StudioFilingView>(StudioDataManager.Instance.GetLuckyBoxActivityID(), ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName));
  282. }
  283. else
  284. {
  285. ViewManager.Show<StudioFilingView>(null, ViewManager.GetGoBackDatas(typeof(StudioFilingView).FullName));
  286. }
  287. }
  288. else if (_levelCfg.type == ConstInstanceZonesType.Field)
  289. {
  290. ViewManager.GoBackFrom(typeof(DressUpFightView).FullName);
  291. }
  292. else
  293. {
  294. //ViewManager.GoBackFrom(typeof(StoryChapterView).FullName);
  295. ViewManager.Show<StoryChapterView>(_levelCfg.chapterId);//, new object[] { typeof(StoryChapterListView).FullName}
  296. }
  297. //MyDressUpHelper.dressUpObj.TakeOffAll();
  298. this.Hide();
  299. }
  300. private void OnClickBtnBack()
  301. {
  302. if (!_IsTeaParty) {
  303. AlertUI.Show("是否确定退出?")
  304. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  305. {
  306. backView();
  307. });
  308. }
  309. else {
  310. DressUpData dressUpData = MyDressUpHelper.dressUpObj.DressUpDataClone();
  311. ChangeTempCollocation(dressUpData.itemList);
  312. backView();
  313. }
  314. //ViewManager.Show<StoryChapterView>(StoryDataManager.currentChapter);
  315. }
  316. private async void ChangeTempCollocation(List<int> tempEquipIds)
  317. {
  318. bool result = await LeagueSproxy.ChangeTempCollocation(tempEquipIds);
  319. if (result)
  320. {
  321. }
  322. }
  323. private void OnClickBtnHome()
  324. {
  325. AlertUI.Show("是否返回?")
  326. .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
  327. {
  328. //MyDressUpHelper.dressUpObj.TakeOffAll();
  329. GameController.GoBackToMainView();
  330. });
  331. }
  332. private void OnClickBtnClothingShop()
  333. {
  334. ViewManager.Show<ClothingShopView>(new object[] { null, scoreType }, null, false, true);
  335. }
  336. private void OnClickListType1Item(EventContext context)
  337. {
  338. //GuideController.HideGuide();
  339. GObject typeItem = context.data as GObject;
  340. int order = (int)typeItem.data;
  341. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[order - 1];
  342. if (item1.subMenusArr.Length > 0)
  343. {
  344. this.showListType2(item1.subMenusArr);
  345. }
  346. else
  347. {
  348. if (this.showListParts(item1.type) == false)
  349. {
  350. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  351. return;
  352. }
  353. this.showListParts(item1.type);
  354. }
  355. this.hideListType1();
  356. UpdateListPartsSelected();
  357. }
  358. private void OnClickListType2Item(EventContext context)
  359. {
  360. GObject typeItem = context.data as GObject;
  361. int order = (int)typeItem.data;
  362. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[order - 1];
  363. if (this.showListParts(item2.type) == false)
  364. {
  365. PromptController.Instance.ShowFloatTextPrompt("未获得此类部件");
  366. return;
  367. }
  368. this.hideListType2();
  369. }
  370. private void OnClickSearchPartsListItem(EventContext context)
  371. {
  372. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  373. {
  374. return;
  375. }
  376. GObject listItem = context.data as GObject;
  377. int id = (int)listItem.data;
  378. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  379. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  380. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  381. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= GlobalCfgArray.globalCfg.dressLimitCount;
  382. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  383. {
  384. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  385. return;
  386. }
  387. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  388. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  389. UpdateStepBtn(true);
  390. // UpdateSearchListPartsSelected();
  391. UpdateScore();
  392. }
  393. private void OnClickPartsListItem(EventContext context)
  394. {
  395. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  396. {
  397. return;
  398. }
  399. GObject listItem = context.data as GObject;
  400. int id = (int)listItem.data;
  401. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  402. {
  403. partsListScrollingPosY = _ui.m_partsList.m_list.scrollPane.scrollingPosY;
  404. this.showListParts2(id);
  405. this.hideListParts();
  406. MyDressUpHelper.dressUpObj.PutOnItemList(MyDressUpHelper.GetSuitFightItems(id));
  407. UpdateStepBtn(true);
  408. // MyDressUpHelper.dressUpObj.PutOnSuitCfg(id, false);
  409. }
  410. else
  411. {
  412. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  413. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  414. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  415. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= GlobalCfgArray.globalCfg.dressLimitCount;
  416. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  417. {
  418. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  419. return;
  420. }
  421. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  422. UpdateStepBtn(true);
  423. }
  424. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  425. // UpdateListPartsSelected();
  426. // UpdateListSuitPartsSelected();
  427. UpdateScore();
  428. }
  429. private void OnClickSuitPartsListItem(EventContext context)
  430. {
  431. if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
  432. {
  433. return;
  434. }
  435. GObject listItem = (GObject)context.data as GObject;
  436. int id = (int)listItem.data;
  437. bool isOrnament = DressUpMenuItemCfg1Array.Instance.CheckIsOrnamentsType(id);
  438. bool isDress = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  439. bool isHasSame = MyDressUpHelper.dressUpObj.CheckSameTypeIsOn(id);
  440. bool isMaxCount = MyDressUpHelper.GetCurrentOrnamentCount() >= GlobalCfgArray.globalCfg.dressLimitCount;
  441. if (isOrnament && !isDress && !isHasSame && isMaxCount)
  442. {
  443. PromptController.Instance.ShowFloatTextPrompt("饰品穿戴数量已达上限");
  444. return;
  445. }
  446. if (!DressUpMenuItemDataManager.CheckHasItem(id))
  447. {
  448. PromptController.Instance.ShowFloatTextPrompt("还未获得这件装扮");
  449. return;
  450. }
  451. MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
  452. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  453. UpdateStepBtn(true);
  454. // UpdateListSuitPartsSelected();
  455. UpdateScore();
  456. }
  457. private void UpdateStepBtn(bool isAdd, int suitId = 0)
  458. {
  459. if (isAdd)
  460. {
  461. MyDressUpHelper.AddMemoryDressup();
  462. }
  463. _ui.m_btnLastStep.enabled = MyDressUpHelper.stepIndex > 0;
  464. _ui.m_btnNextStep.enabled = MyDressUpHelper.stepIndex < MyDressUpHelper.dressMemory.Count - 1;
  465. UpdateListPartsSelected();
  466. UpdateListSuitPartsSelected();
  467. UpdateScore();
  468. }
  469. private void OnLongPress(EventContext context)
  470. {
  471. LongPressGesture gesture = (LongPressGesture)context.sender;
  472. int itemId = (int)gesture.host.data;
  473. GoodsItemTipsController.ShowItemTips(itemId);
  474. }
  475. private void OnTouchPad()
  476. {
  477. if (this.currentListType == DressUpListType.List4)
  478. {
  479. this.hideListParts2();
  480. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  481. }
  482. else if (this.currentListType == DressUpListType.List3)
  483. {
  484. if (_currentList2 != null)
  485. {
  486. this.showListType2(_currentList2);
  487. }
  488. else
  489. {
  490. this.showListType1();
  491. }
  492. this.hideListParts();
  493. }
  494. else if (this.currentListType == DressUpListType.List2)
  495. {
  496. this.showListType1();
  497. this.hideListType2();
  498. }
  499. else if (this.currentListType == DressUpListType.List5)
  500. {
  501. this.showListType1();
  502. this.hideSearchListType();
  503. }
  504. }
  505. private void OnClickBtnHint()
  506. {
  507. this.ShowTaskHint();
  508. }
  509. private void OnClickBtnDelete()
  510. {
  511. MyDressUpHelper.dressUpObj.TakeOffAll();
  512. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  513. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  514. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  515. UpdateStepBtn(true);
  516. // UpdateListPartsSelected();
  517. // UpdateListSuitPartsSelected();
  518. }
  519. private void OnClickBtnClose()
  520. {
  521. _ui.m_btnClose.visible = false;
  522. _ui.m_grpTips.visible = false;
  523. }
  524. private void OnClickBtnNext()
  525. {
  526. // if (!MyDressUpHelper.CheckPutOnFinish())
  527. // {
  528. // AlertUI.Show("只有换好衣服才能出门哦!")
  529. // .SetRightButton(true, "好的");
  530. // return;
  531. // }
  532. if (!CheckHasNeed())
  533. {
  534. AlertUI.Show("未穿戴必需品。").SetRightButton(true, "好的");
  535. return;
  536. }
  537. var levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  538. if (RoleDataManager.power < levelCfg.power)
  539. {
  540. ItemUtil.AddPower(CheckCardOrNext);
  541. return;
  542. }
  543. CheckCardOrNext();
  544. }
  545. private bool CheckHasNeed()
  546. {
  547. int _suitId = MyDressUpHelper.dressUpObj.suitId;
  548. bool isNoSuit = _fightCfg.needSuitId > 0 && _suitId != _fightCfg.needSuitId;//需要套装但未穿套装
  549. bool isDressUpItem = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(_fightCfg.needItemId);
  550. bool isIncludeItem = _suitId > 0 && Array.IndexOf(SuitCfgArray.Instance.GetCfg(_suitId).partsArr, _fightCfg.needItemId) >= 0;
  551. bool isNoItem = _fightCfg.needItemId > 0 && !isDressUpItem && !isIncludeItem;
  552. if (isNoSuit || isNoItem)
  553. {
  554. return false;
  555. }
  556. return true;
  557. }
  558. //private void OnClickBtnPhotograph()
  559. //{
  560. // Timers.inst.StartCoroutine(ScreenShotTex());
  561. //}
  562. //private IEnumerator ScreenShotTex()
  563. //{
  564. // GameObject Role = _sceneObject.transform.Find("Role").gameObject;
  565. // GameObject CopyRoleParent = _sceneObject.transform.Find("CopyRole").gameObject;
  566. // Transform CopyRole = CopyRoleParent.transform.Find("Role");
  567. // if (CopyRole != null)
  568. // {
  569. // GameObject.DestroyImmediate(CopyRole.gameObject);
  570. // }
  571. // Transform transform = GameObject.Instantiate(Role, CopyRoleParent.transform.position, Quaternion.identity).transform;//实例化物体
  572. // transform.parent = CopyRoleParent.transform;
  573. // transform.name = "Role";
  574. // GameObject gameObject = _sceneObject.transform.Find("FightCamera").gameObject;
  575. // Camera camera = gameObject.GetComponent<Camera>();
  576. // FightDataManager.Instance.RoleTextuex = FightDataManager.Instance.GetPrintscreenNTexture(camera);
  577. // yield return new WaitForEndOfFrame();
  578. // if (CardDataManager.GetCardListByRoleType(0).Count > 0)
  579. // {
  580. // ViewManager.Show<StoryCardChoose>(scoreType);
  581. // }
  582. // else
  583. // {
  584. // StartCalculateScore();
  585. // }
  586. //}
  587. private void CheckCardOrNext()
  588. {
  589. if (CardDataManager.GetCardListByRoleType(0).Count > 0)
  590. {
  591. ViewManager.Show<StoryCardChoose>(scoreType);
  592. }
  593. else
  594. {
  595. StartCalculateScore();
  596. }
  597. }
  598. private void StartCalculateScore()
  599. {
  600. InstanceZonesDataManager.currentLevelCfgId = _levelID;
  601. //不可移动代码位置
  602. bool hasFightTarget = _fightCfg.targetName != null && _fightCfg.targetName.Length > 0;
  603. if (_levelCfg.type == ConstInstanceZonesType.Field)
  604. {
  605. FieldFightDataManager.Instance.CurrentCardId = InstanceZonesDataManager.currentCardId;
  606. FieldFightDataManager.Instance.CurrentScoreType = InstanceZonesDataManager.currentScoreType;
  607. FieldFightDataManager.Instance.currentLevelCfgId = InstanceZonesDataManager.currentLevelCfgId;
  608. }
  609. if (hasFightTarget)
  610. {
  611. ViewManager.Show<StoryFightTargetView>();
  612. }
  613. else
  614. {
  615. ViewManager.Show<StoryFightSingleView>();
  616. }
  617. this.Hide();
  618. }
  619. private void OnClickBtnRecommend()
  620. {
  621. if (this.currentListType == DressUpListType.List4)
  622. {
  623. this.hideListParts2();
  624. this.showListParts(ConstDressUpItemType.TAO_ZHUANG, true);
  625. }
  626. InstanceZonesDataManager.usedRecommend = true;
  627. // MyDressUpHelper.PutOnRecommendItems();
  628. InstanceZonesDataManager.currentLevelCfgId = _levelID;
  629. MyDressUpHelper.PutOnRecommendItems2();
  630. _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
  631. UpdateStepBtn(true);
  632. // UpdateListPartsSelected();
  633. // UpdateListSuitPartsSelected();
  634. UpdateScore();
  635. if (!CheckHasNeed())
  636. {
  637. PromptController.Instance.ShowFloatTextPrompt("未拥有必需品");
  638. }
  639. }
  640. private void InitLists()
  641. {
  642. _ui.m_comListType2.m_listType.itemRenderer = ListType2Item;
  643. _ui.m_partsList.m_list.itemRenderer = ListPartsItem;
  644. _ui.m_partsList2.m_list.itemRenderer = ListParts2Item;
  645. _ui.m_partsListSearch.m_list.itemRenderer = ListPartsItem;
  646. listType1X = _ui.m_comListType1.target.x;
  647. partsListX = _ui.m_partsList.target.x - _ui.m_partsList.target.width;
  648. //一级菜单
  649. _ui.m_comListType1.m_listType.itemRenderer = ListType1Item;
  650. }
  651. private void showListType1()
  652. {
  653. _currentList2 = null;
  654. currentListType = DressUpListType.List1;
  655. _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length - 3;
  656. GTween.To(_ui.target.width, listType1X, 0.5f)
  657. .SetTarget(_ui.m_comListType1.target)
  658. .OnUpdate((GTweener t) =>
  659. {
  660. _ui.m_comListType1.target.x = t.value.x;
  661. });
  662. }
  663. private void hideListType1()
  664. {
  665. GTween.To(listType1X, _ui.target.width, 0.5f)
  666. .SetTarget(_ui.m_comListType1.target)
  667. .OnUpdate((GTweener t) =>
  668. {
  669. _ui.m_comListType1.target.x = t.value.x;
  670. });
  671. }
  672. private void showListType2(int[] menuStrArr = null)
  673. {
  674. currentListType = DressUpListType.List2;
  675. if (menuStrArr != null && menuStrArr.Length > 0)
  676. {
  677. int len = menuStrArr.Length;
  678. _currentList2 = menuStrArr.Clone() as int[];
  679. _ui.m_comListType2.m_listType.RemoveChildrenToPool();
  680. _ui.m_comListType2.m_listType.numItems = len;
  681. //_ui.m_listType2.ResizeToFit(_ui.m_listType2.numItems);
  682. float maxHeight = _ui.target.height - _ui.m_comListType2.m_listType.y - DressUpView.BOTTOM_BLANK;
  683. if (_ui.m_comListType2.m_listType.height > maxHeight)
  684. {
  685. _ui.m_comListType2.m_listType.height = maxHeight;
  686. }
  687. }
  688. GTween.To(_ui.target.width, listType1X, 0.5f)
  689. .SetTarget(_ui.m_comListType2.target)
  690. .OnUpdate((GTweener t) =>
  691. {
  692. _ui.m_comListType2.target.x = t.value.x;
  693. });
  694. }
  695. private void hideListType2()
  696. {
  697. GTween.To(listType1X, _ui.target.width, 0.5f)
  698. .SetTarget(_ui.m_comListType2.target)
  699. .OnUpdate((GTweener t) =>
  700. {
  701. _ui.m_comListType2.target.x = t.value.x;
  702. });
  703. }
  704. private bool showListParts(int type, bool selectItem = false)
  705. {
  706. _currentMenuType = type;
  707. UpdatePartsListSort();
  708. if (_ui.m_partsList.m_list.numItems <= 0) return false;
  709. _ui.m_partsList.m_list.ResizeToFit(_ui.m_partsList.m_list.numItems);
  710. float maxHeight = _ui.m_partsList.target.height - _ui.m_partsList.m_list.y;
  711. if (_ui.m_partsList.m_list.height > maxHeight)
  712. {
  713. _ui.m_partsList.m_list.height = maxHeight;
  714. }
  715. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  716. {
  717. _ui.m_partsList.m_list.scrollPane.SetPosY(partsListScrollingPosY, false);
  718. partsListScrollingPosY = 0;
  719. }
  720. currentListType = DressUpListType.List3;
  721. GTween.To(_ui.target.width, partsListX, 0.5f)
  722. .SetTarget(_ui.m_partsList)
  723. .OnUpdate((GTweener t) =>
  724. {
  725. _ui.m_partsList.target.x = t.value.x;
  726. });
  727. UpdateListPartsSelected();
  728. return true;
  729. }
  730. private void OnComboBoxRarityChanged()
  731. {
  732. _scoreIndex = _ui.m_partsList.m_comboBoxRarity.selectedIndex;
  733. this.UpdatePartsListSort();
  734. }
  735. private void OnSearchComboBoxRarityChanged()
  736. {
  737. _scoreIndex = _ui.m_partsListSearch.m_comboBoxRarity.selectedIndex;
  738. this.UpdateSearchList();
  739. }
  740. private void UpdatePartsListSort()
  741. {
  742. if (_currentMenuType == 0) return;
  743. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  744. {
  745. _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
  746. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  747. {
  748. if (!_IsTeaParty)
  749. _currentList3 = SuitUtil.SortSuitListByHighScore(_currentList3);
  750. else
  751. _currentList3 = SuitUtil.SortTeaPartySuitByHighScore(_currentList3);
  752. }
  753. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  754. {
  755. if (!_IsTeaParty)
  756. _currentList3 = SuitUtil.SortSuitListByLowScore(_currentList3);
  757. else
  758. _currentList3 = SuitUtil.SortTeaPartySuitByLowScore(_currentList3);
  759. }
  760. else
  761. {
  762. _currentList3.Reverse();
  763. }
  764. }
  765. else
  766. {
  767. _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
  768. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  769. {
  770. if (!_IsTeaParty)
  771. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3, true);
  772. else
  773. _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByHighScore(_currentList3);
  774. }
  775. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  776. {
  777. if (!_IsTeaParty)
  778. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3, true);
  779. else
  780. _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByLowsore(_currentList3);
  781. }
  782. else
  783. {
  784. _currentList3.Reverse();
  785. }
  786. }
  787. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  788. // {
  789. // _currentList3 = DressUpMenuItemDataManager.DressSearch(_currentList3);
  790. // }
  791. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  792. // {
  793. // _currentList3 = DressUpMenuItemDataManager.DressFilter(_currentList3);
  794. // }
  795. //必穿品放在列表最前面
  796. if (_fightCfg!= null && _fightCfg.needItemId > 0)
  797. {
  798. int index = _currentList3.IndexOf(_fightCfg.needItemId);
  799. if (index >= 0)
  800. {
  801. int item = _currentList3[index];
  802. _currentList3.Remove(_currentList3[index]);
  803. _currentList3.Insert(0, item);
  804. }
  805. }
  806. else if (_fightCfg != null && _fightCfg.needSuitId > 0)
  807. {
  808. int index = _currentList3.IndexOf(_fightCfg.needSuitId);
  809. if (index >= 0)
  810. {
  811. int item = _currentList3[index];
  812. _currentList3.Remove(_currentList3[index]);
  813. _currentList3.Insert(0, item);
  814. }
  815. }
  816. _ui.m_partsList.m_list.RemoveChildrenToPool();
  817. _ui.m_partsList.m_list.numItems = _currentList3.Count;
  818. }
  819. private void UpdateSuitPartsListSort()
  820. {
  821. if (_currentMenuType == 0) return;
  822. _currentList4 = new List<int>(SuitCfgArray.Instance.GetSuitItems(_currentSuitId, true));
  823. // if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Search)
  824. // {
  825. // _currentList4 = DressUpMenuItemDataManager.DressSearch(_currentList4);
  826. // }
  827. // else if (DressUpMenuItemDataManager.dressFilterType == DressFilterType.Filter)
  828. // {
  829. // _currentList4 = DressUpMenuItemDataManager.DressFilter(_currentList4);
  830. // }
  831. _ui.m_partsList2.m_list.RemoveChildrenToPool();
  832. _ui.m_partsList2.m_list.numItems = _currentList4.Count;
  833. }
  834. private void hideListParts()
  835. {
  836. GTween.To(partsListX, _ui.target.width, 0.5f)
  837. .SetTarget(_ui.m_partsList)
  838. .OnUpdate((GTweener t) =>
  839. {
  840. _ui.m_partsList.target.x = t.value.x;
  841. });
  842. }
  843. private void showListParts2(int suitId)
  844. {
  845. _currentSuitId = suitId;
  846. _ui.m_partsList2.m_comboBoxRarity.items = new string[] { "高稀有度", "低稀有度", "最近获得" };
  847. this.UpdateSuitPartsListSort();
  848. _ui.m_partsList2.m_list.ResizeToFit(_ui.m_partsList2.m_list.numItems);
  849. float maxHeight = _ui.m_partsList2.target.height - _ui.m_partsList2.m_list.y;// - DressUpView.BOTTOM_BLANK;
  850. if (_ui.m_partsList2.m_list.height > maxHeight)
  851. {
  852. _ui.m_partsList2.m_list.height = maxHeight;
  853. }
  854. currentListType = DressUpListType.List4;
  855. GTween.To(_ui.target.width, partsListX, 0.5f)
  856. .SetTarget(_ui.m_partsList2)
  857. .OnUpdate((GTweener t) =>
  858. {
  859. _ui.m_partsList2.target.x = t.value.x;
  860. });
  861. }
  862. private void hideListParts2()
  863. {
  864. _currentMenuType = ConstDressUpItemType.TAO_ZHUANG;
  865. GTween.To(partsListX, _ui.target.width, 0.5f)
  866. .SetTarget(_ui.m_partsList2)
  867. .OnUpdate((GTweener t) =>
  868. {
  869. _ui.m_partsList2.target.x = t.value.x;
  870. });
  871. }
  872. private void showSearchListType()
  873. {
  874. // _currentList2 = null;
  875. currentListType = DressUpListType.List5;
  876. GTween.To(_ui.target.width, partsListX, 0.5f)
  877. .SetTarget(_ui.m_partsListSearch.target)
  878. .OnUpdate((GTweener t) =>
  879. {
  880. _ui.m_partsListSearch.target.x = t.value.x;
  881. });
  882. }
  883. private void hideSearchListType()
  884. {
  885. GTween.To(partsListX, _ui.target.width, 0.5f)
  886. .SetTarget(_ui.m_partsListSearch.target)
  887. .OnUpdate((GTweener t) =>
  888. {
  889. _ui.m_partsListSearch.target.x = t.value.x;
  890. });
  891. }
  892. /*****************************************************************************************************/
  893. private void DressResetSerch()
  894. {
  895. if (currentListType == DressUpListType.List5)
  896. {
  897. OnTouchPad();
  898. }
  899. }
  900. private void UpdateSerch(EventContext context)
  901. {
  902. if (context.data.ToString() == ConstMessage.DRESS_SEARCH)
  903. {
  904. _currentList3 = DressUpMenuItemDataManager.DressSearch(false);
  905. }
  906. else if (context.data.ToString() == ConstMessage.DRESS_FILTER)
  907. {
  908. _currentList3 = DressUpMenuItemDataManager.DressFilter(false);
  909. }
  910. ViewManager.Hide<ModalStatusView>();
  911. UpdateSearchList();
  912. if (currentListType != DressUpListType.List5)
  913. {
  914. hideListParts();
  915. hideListParts2();
  916. hideListType1();
  917. hideListType2();
  918. showSearchListType();
  919. }
  920. _currentMenuType = 0;
  921. }
  922. private void UpdateSearchList()
  923. {
  924. if (_scoreIndex == SORT_BY_HIGH_SCORE)
  925. {
  926. if (!_IsTeaParty)
  927. _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3, true);
  928. else
  929. _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByHighScore(_currentList3);
  930. }
  931. else if (_scoreIndex == SORT_BY_LOW_SCORE)
  932. {
  933. if (!_IsTeaParty)
  934. _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3, true);
  935. else
  936. _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByLowsore(_currentList3);
  937. }
  938. _currentMenuType = 0;
  939. _ui.m_partsListSearch.m_list.numItems = _currentList3.Count; ;
  940. }
  941. private void ListType1Item(int index, GObject item)
  942. {
  943. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  944. DressUpMenuItemCfg1 item1 = DressUpMenuItemCfg1Array.Instance.dataArray[index];
  945. typeItem.m_icon.url = "ui://DressUp/hz_fenleitu_" + item1.id;
  946. typeItem.m_txtname.text = item1.name;
  947. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
  948. typeItem.target.data = item1.id;
  949. if (!_IsTeaParty)
  950. {
  951. typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
  952. typeItem.m_itemType.selectedIndex = 0;
  953. }
  954. else
  955. typeItem.m_itemType.selectedIndex = 1;
  956. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsFirstMenuNew(item1.id);
  957. UI_TypeItem.ProxyEnd();
  958. }
  959. private void ListType2Item(int index, GObject item)
  960. {
  961. UI_TypeItem typeItem = UI_TypeItem.Proxy(item);
  962. DressUpMenuItemCfg2 item2 = DressUpMenuItemCfg2Array.Instance.dataArray[_currentList2[index] - 1];
  963. typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
  964. typeItem.m_txtname.text = item2.name;
  965. //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
  966. typeItem.target.data = item2.id;
  967. if (!_IsTeaParty) {
  968. typeItem.m_itemType.selectedIndex = 0;
  969. var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
  970. typeItem.m_imgNeed.visible = subType == item2.type;
  971. }
  972. else
  973. typeItem.m_itemType.selectedIndex = 1;
  974. typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSecondMenuNew(item2.id);
  975. UI_TypeItem.ProxyEnd();
  976. }
  977. private void ListTagItem(int index, GObject item)
  978. {
  979. string[][] tagsArr = (string[][])item.parent.data;
  980. UI_ComTagItem listItem = UI_ComTagItem.Proxy(item);
  981. int tagType = TagCfgArray.Instance.GetCfg(tagsArr[index][0]).type;
  982. UI.CommonGame.UI_ComTag itemTag = UI.CommonGame.UI_ComTag.Proxy(listItem.m_loaTag);
  983. itemTag.m_txtTag.text = tagsArr[index][0];
  984. itemTag.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
  985. itemTag.m_loaTag.scale = new Vector2(0.8f, 0.8f);
  986. UI.CommonGame.UI_ComTag.ProxyEnd();
  987. listItem.m_txtScore.text = tagsArr[index][1];
  988. UI_ComTagItem.ProxyEnd();
  989. }
  990. private void ListPartsItem(int index, GObject item)
  991. {
  992. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  993. int id = (int)_currentList3[index];
  994. string iconRes = "";
  995. string partName = "";
  996. string ext = "png";
  997. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  998. {
  999. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  1000. iconRes = suitCfg.res;
  1001. partName = suitCfg.name;
  1002. listItem.m_iconSelected.visible = false;
  1003. if (!_IsTeaParty)
  1004. {
  1005. listItem.m_txtScore.text = "" + SuitUtil.GetSuitScore(id);
  1006. listItem.m_itemType.selectedIndex = 0;
  1007. }
  1008. else
  1009. {
  1010. if (listItem.m_ListTag.data == null)
  1011. listItem.m_ListTag.itemRenderer = ListTagItem;
  1012. listItem.m_ListTag.data = suitCfg.tagsArr;
  1013. listItem.m_ListTag.numItems = suitCfg.tagsArr.Length;
  1014. listItem.m_itemType.selectedIndex = 1;
  1015. }
  1016. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false, true);
  1017. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + suitCfg.rarity;
  1018. listItem.m_imgNew.visible = false;
  1019. }
  1020. else
  1021. {
  1022. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  1023. iconRes = itemCfg.res;
  1024. partName = itemCfg.name;
  1025. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  1026. if (!_IsTeaParty) {
  1027. listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
  1028. listItem.m_itemType.selectedIndex = 0;
  1029. }
  1030. else {
  1031. if (listItem.m_ListTag.data == null)
  1032. listItem.m_ListTag.itemRenderer = ListTagItem;
  1033. listItem.m_ListTag.data = itemCfg.tagsArr;
  1034. listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
  1035. listItem.m_itemType.selectedIndex = 1;
  1036. }
  1037. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  1038. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  1039. listItem.m_imgNew.visible = isNew;
  1040. if (isNew)
  1041. {
  1042. ItemProxy.ReqSetItemRead(id).Coroutine();
  1043. }
  1044. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  1045. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  1046. }
  1047. if (listItem.target.data == null)
  1048. {
  1049. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  1050. longPressGesture.once = true;
  1051. longPressGesture.onAction.Add(OnLongPress);
  1052. _listLongPress.Add(longPressGesture);
  1053. }
  1054. listItem.m_btnAni.visible = false;
  1055. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  1056. listItem.m_ScoreType.url = "ui://CommonGame/kp_sx_" + scoreType;
  1057. listItem.m_txtTitle.text = partName;
  1058. listItem.target.data = id;
  1059. listItem.m_imgNeed.visible = _fightCfg != null && (_fightCfg.needItemId == id || _fightCfg.needSuitId == id);
  1060. UI_PartsListItem.ProxyEnd();
  1061. }
  1062. private void ListParts2Item(int index, GObject item)
  1063. {
  1064. UI_PartsListItem listItem = UI_PartsListItem.Proxy(item);
  1065. int id = (int)_currentList4[index];
  1066. string iconRes = "";
  1067. string partName = "";
  1068. string ext = "png";
  1069. if (listItem.target.data == null)
  1070. {
  1071. LongPressGesture longPressGesture = new LongPressGesture(listItem.target);
  1072. longPressGesture.once = true;
  1073. longPressGesture.onAction.Add(OnLongPress);
  1074. _listLongPress.Add(longPressGesture);
  1075. }
  1076. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(id);
  1077. iconRes = itemCfg.res;
  1078. partName = itemCfg.name;
  1079. listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
  1080. if (!_IsTeaParty) {
  1081. listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
  1082. listItem.m_itemType.selectedIndex = 0;
  1083. }
  1084. else
  1085. {
  1086. if (listItem.m_ListTag.data == null)
  1087. listItem.m_ListTag.itemRenderer = ListTagItem;
  1088. listItem.m_ListTag.data = itemCfg.tagsArr;
  1089. listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
  1090. listItem.m_itemType.selectedIndex = 1;
  1091. }
  1092. listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
  1093. RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
  1094. ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
  1095. listItem.m_ScoreType.visible = true;
  1096. // int mainScore;
  1097. // int mainValuel;
  1098. // ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
  1099. listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + scoreType);
  1100. if (!_IsTeaParty) {
  1101. listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
  1102. listItem.m_itemType.selectedIndex = 0;
  1103. }
  1104. else
  1105. {
  1106. if (listItem.m_ListTag.data == null)
  1107. {
  1108. listItem.m_ListTag.itemRenderer = ListTagItem;
  1109. }
  1110. listItem.m_ListTag.data = itemCfg.tagsArr;
  1111. listItem.m_ListTag.numItems = itemCfg.tagsArr.Length;
  1112. listItem.m_itemType.selectedIndex = 1;
  1113. }
  1114. listItem.m_icon.url = ResPathUtil.GetIconPath(iconRes, ext);
  1115. listItem.m_txtTitle.text = partName;
  1116. listItem.target.data = id;
  1117. // listItem.m_txtScore.visible = false;
  1118. //listItem.m_ScoreType.visible = true;
  1119. listItem.m_imgNeed.visible = false;
  1120. listItem.m_btnAni.visible = false;
  1121. bool isNew = DressUpMenuItemDataManager.CheckIsDressUpItemNew(id);
  1122. listItem.m_imgNew.visible = isNew;
  1123. if (isNew)
  1124. {
  1125. ItemProxy.ReqSetItemRead(id).Coroutine();
  1126. }
  1127. UI_PartsListItem.ProxyEnd();
  1128. }
  1129. private void UpdateListPartsSelected()
  1130. {
  1131. GList list;
  1132. if (_ui.m_partsList.target.x == partsListX)
  1133. {
  1134. list = _ui.m_partsList.m_list;
  1135. }
  1136. else if (_ui.m_partsListSearch.target.x == partsListX)
  1137. {
  1138. list = _ui.m_partsListSearch.m_list;
  1139. }
  1140. else
  1141. {
  1142. return;
  1143. }
  1144. int count = list.numChildren;
  1145. int suitId = MyDressUpHelper.dressUpObj.suitId;
  1146. for (int i = 0; i < count; i++)
  1147. {
  1148. UI_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(i));
  1149. int id = (int)listItem.target.data;
  1150. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  1151. {
  1152. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  1153. }
  1154. else
  1155. {
  1156. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  1157. var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
  1158. bool isSuit = !isSceneType && suitId > 0 && SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  1159. bool isSceneSuit = isSceneType && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  1160. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  1161. }
  1162. UI_PartsListItem.ProxyEnd();
  1163. }
  1164. }
  1165. private void UpdateSearchListPartsSelected()
  1166. {
  1167. int count = _ui.m_partsListSearch.m_list.numChildren;
  1168. int suitId = MyDressUpHelper.dressUpObj.suitId;
  1169. for (int i = 0; i < count; i++)
  1170. {
  1171. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsListSearch.m_list.GetChildAt(i));
  1172. int id = (int)listItem.target.data;
  1173. if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
  1174. {
  1175. listItem.m_iconSelected.visible = suitId > 0 && id == suitId;
  1176. }
  1177. else
  1178. {
  1179. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  1180. var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
  1181. bool isSuit = !isSceneType && suitId > 0 && SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  1182. bool isSceneSuit = isSceneType && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  1183. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  1184. }
  1185. UI_PartsListItem.ProxyEnd();
  1186. }
  1187. }
  1188. private void UpdateListSuitPartsSelected()
  1189. {
  1190. int count = _ui.m_partsList2.m_list.numChildren;
  1191. int suitId = MyDressUpHelper.dressUpObj.suitId;
  1192. for (int i = 0; i < count; i++)
  1193. {
  1194. UI_PartsListItem listItem = UI_PartsListItem.Proxy(_ui.m_partsList2.m_list.GetChildAt(i));
  1195. int id = (int)listItem.target.data;
  1196. bool isPutOn = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);//非套装金判断是否穿戴
  1197. var isSceneType = DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(id);
  1198. bool isSuit = !isSceneType && suitId > 0 && SuitCfgArray.Instance.GetSuitIdOfItem(id) == suitId;//非场景类, 若当前穿戴套装要判断item是否属于套装(更换场景类不会改变套装穿戴状态)
  1199. bool isSceneSuit = isSceneType && suitId > 0 && isPutOn;//场景类, 若当前穿戴套装要判断item是否属已穿戴
  1200. listItem.m_iconSelected.visible = isPutOn || isSuit || isSceneSuit;
  1201. UI_PartsListItem.ProxyEnd();
  1202. }
  1203. }
  1204. private void ShowTaskHint()
  1205. {
  1206. _ui.m_btnClose.visible = true;
  1207. _ui.m_grpTips.visible = true;
  1208. string str = "";
  1209. if (!_IsTeaParty)
  1210. str = _levelCfg.hint;
  1211. else {
  1212. var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(LeagueDataManager.Instance.TeaPartyId);
  1213. str = teapartyRoleCfg[_TeaPartyID - 1].hint;
  1214. }
  1215. _ui.m_txtHint.text = str;
  1216. if (this._ui.m_txtHint.textHeight > this._ui.m_txtHint.textFormat.size * 2)
  1217. {
  1218. this._ui.m_txtHint.align = AlignType.Left;
  1219. }
  1220. else
  1221. {
  1222. this._ui.m_txtHint.align = AlignType.Center;
  1223. }
  1224. }
  1225. private void UpdateScore()
  1226. {
  1227. if (!_IsTeaParty)
  1228. _ui.m_txtScore.text = "" + FightDataManager.Instance.GetScore(InstanceZonesDataManager.roleData).ToString();
  1229. // GuideController.TryGuideDressUpFightViewBtnNext(_ui.m_btnNext);
  1230. else
  1231. _ui.m_txtMatch.text = "" + LeagueDataManager.Instance.GetTeaPartyMatchedValue(InstanceZonesDataManager.roleData);
  1232. }
  1233. private void OnClickBtnSearch()
  1234. {
  1235. int type = 0;
  1236. if (_IsTeaParty)
  1237. type = 1;
  1238. ViewManager.Show<DressFilterView>(new object[] { 0, 0, type}, new object[] { typeof(DressUpView).FullName});
  1239. }
  1240. private void OnClickBtnAutoPlay()
  1241. {
  1242. FightDataManager.Instance.autoPlay = _ui.m_btnAutoPlay.selected;
  1243. }
  1244. private void OnClickComNeed()
  1245. {
  1246. if (_fightCfg.needItemId <= 0 && _fightCfg.needSuitId <= 0)
  1247. {
  1248. return;
  1249. }
  1250. if (_fightCfg.needSuitId > 0)
  1251. {
  1252. ViewManager.Show<SuitPartsDetailView>(_fightCfg.needSuitId, new object[] { typeof(DressUpFightView).FullName, this.viewData });
  1253. }
  1254. else
  1255. {
  1256. int itemId = (int)_ui.m_compNeed.target.data;
  1257. object[] sourceDatas = new object[] { itemId, new object[] { typeof(DressUpFightView).FullName, this.viewData }, 1 };
  1258. GoodsItemTipsController.ShowItemTips(itemId, sourceDatas);
  1259. }
  1260. }
  1261. private void RenderListTagItem(int index, GObject obj)
  1262. {
  1263. UI.CommonGame.UI_ComTag item = UI.CommonGame.UI_ComTag.Proxy(obj);
  1264. string tag = _fightCfg.needTagsArr[index];
  1265. int tagType = TagCfgArray.Instance.GetCfg(tag).type;
  1266. item.m_txtTag.text = tag;
  1267. item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tagType);
  1268. UI.CommonGame.UI_ComTag.ProxyEnd();
  1269. }
  1270. private bool CheckListCount(int type)
  1271. {
  1272. if (type == (int)ConstDressUpItemType.TAO_ZHUANG)
  1273. {
  1274. return DressUpMenuSuitDataManager.GetSuitIDList().Count > 0;
  1275. }
  1276. else
  1277. {
  1278. return DressUpMenuItemDataManager.getItemDatasByType(type).Count > 0;
  1279. }
  1280. }
  1281. private void SendLog()
  1282. {
  1283. var levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
  1284. switch (levelCfg.type)
  1285. {
  1286. case ConstInstanceZonesType.Story:
  1287. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.CHUN_ZHONG_LOU, 2);
  1288. break;
  1289. case ConstInstanceZonesType.Studio:
  1290. StudioCfg studioCfg = StudioCfgArray.Instance.GetCfg(levelCfg.chapterId);
  1291. if (studioCfg.funId == typeof(StudioMetalView).Name)
  1292. {
  1293. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.JIN_SHU_XIU_FU, 2);
  1294. }
  1295. else if (studioCfg.funId == typeof(StudioFabricView).Name)
  1296. {
  1297. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZHI_WU_XIU_FU, 2);
  1298. }
  1299. else if (studioCfg.funId == typeof(StudioPropertyView).Name)
  1300. {
  1301. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHU_HUA_XIU_FU, 2);
  1302. }
  1303. break;
  1304. }
  1305. }
  1306. private void CheckGuide(object param)
  1307. {
  1308. if (GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0
  1309. || GuideDataManager.IsGuideFinish(ConstGuideId.START_FIGHT) <= 0
  1310. || GuideDataManager.IsGuideFinish(ConstGuideId.AUTOPLAY_FIGHT) <= 0
  1311. || GuideDataManager.IsGuideFinish(ConstGuideId.CLOTHING_SYNTHETIC) <= 0)
  1312. {
  1313. UpdateToCheckGuide(null);
  1314. }
  1315. else
  1316. {
  1317. Timers.inst.Remove(CheckGuide);
  1318. }
  1319. _ui.m_loaGuide.visible = false;
  1320. }
  1321. protected override void UpdateToCheckGuide(object param)
  1322. {
  1323. if (!ViewManager.CheckIsTopView(this.viewCom) || _IsTeaParty) return;
  1324. int buyClothingIndex = 0;
  1325. int buyClothingSubIndex = 0;
  1326. int taozhuangIndex = 0;
  1327. int len = _ui.m_comListType1.m_listType.numChildren;
  1328. for (int i = 0; i < len; i++)
  1329. {
  1330. UI_TypeItem item = UI_TypeItem.Proxy(_ui.m_comListType1.m_listType.GetChildAt(i));
  1331. if (item != null)
  1332. {
  1333. int menuID = (int)item.target.data;
  1334. DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
  1335. if (GuideDataManager.IsGuideFinish(ConstGuideId.START_FIGHT) <= 0 && dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
  1336. {
  1337. taozhuangIndex = i;
  1338. break;
  1339. }
  1340. if (GuideDataManager.IsGuideFinish(ConstGuideId.BUY_CLOTHING) <= 0 && _fightCfg.needItemId > 0 && ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, dressUpMenuItemCfg1.id))
  1341. {
  1342. buyClothingIndex = i;
  1343. break;
  1344. }
  1345. }
  1346. UI_TypeItem.ProxyEnd();
  1347. }
  1348. buyClothingSubIndex = _currentList3.IndexOf(_fightCfg.needItemId);
  1349. GuideController.TryGuide(_ui.m_comListType1.m_listType, ConstGuideId.START_FIGHT, 3, "点击相应的分类,可以快速找到服饰。", taozhuangIndex);
  1350. GuideController.TryGuide(_ui.m_partsList.m_list, ConstGuideId.START_FIGHT, 4, "", 0);
  1351. GuideController.TryGuide(_ui.m_btnNext, ConstGuideId.START_FIGHT, 5, "穿着完毕,来验证一下,换上的服饰是否符合需求。");
  1352. // GuideController.TryCompleteGuide(ConstGuideId.START_FIGHT, 5);
  1353. GuideController.TryGuide(_ui.m_compNeed.target, ConstGuideId.BUY_CLOTHING, 3, "当提示有“必需品”时,需要穿上对应物品才能通关。");
  1354. GuideController.TryGuide(_ui.m_btnRecommend, ConstGuideId.BUY_CLOTHING, 7, "点击推荐搭配,可以快速穿上必须品。");
  1355. GuideController.TryGuide(_ui.m_btnAutoPlay, ConstGuideId.BUY_CLOTHING, 8, "勾选后,会自动进行比拼哦~~");
  1356. GuideController.TryCompleteGuide(ConstGuideId.BUY_CLOTHING, 8);
  1357. GuideController.TryGuide(_ui.m_btnHint, ConstGuideId.FIGHT_TIPS, 1, "这里可以看看通关提示呢~");
  1358. GuideController.TryCompleteGuide(ConstGuideId.FIGHT_TIPS, 1);
  1359. GuideController.TryGuide(_ui.m_btnRecommend, ConstGuideId.AUTOPLAY_FIGHT, 1, "", -1, true, 0, true, true);//这个引导自动完成,测试中策划要求件推荐搭配引导提前,为避免意外,没有改引导表,而是直接吧推荐搭配加到买必须品的引导力,这个引导自动完成
  1360. if (GuideDataManager.currentGuideId == GuideCfgArray.Instance.GetCfg(ConstGuideId.AUTOPLAY_FIGHT).id) {
  1361. GuideController.TryCompleteGuideIndex(ConstGuideId.AUTOPLAY_FIGHT, 1);
  1362. }
  1363. GuideController.TryCompleteGuide(ConstGuideId.AUTOPLAY_FIGHT, 1);
  1364. GuideController.TryGuide(_ui.m_compNeed.target, ConstGuideId.CLOTHING_SYNTHETIC, 1, "当提示有\"必需品\"时。需要穿上对应物品才能通关",-1,false);
  1365. GuideController.TryCompleteGuide(ConstGuideId.CLOTHING_SYNTHETIC, 6);
  1366. }
  1367. protected override void TryCompleteGuide()
  1368. {
  1369. base.TryCompleteGuide();
  1370. // GuideController.TryCompleteGuide(ConstGuideId.START_FIGHT, 5);
  1371. }
  1372. private void TeaPartyStatuChange()
  1373. {
  1374. if (_IsTeaParty && LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesGo)
  1375. {
  1376. AlertUI.Show("管理员已开启茶会,请前往挑战!")
  1377. .SetLeftButton(false).SetRightButton(true, "确定", (object data) =>
  1378. {
  1379. this.Hide();
  1380. if (LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesGo)
  1381. {
  1382. if (LeagueDataManager.Instance.RoleTeapartyInfo.Status && !LeagueDataManager.Instance.RoleTeapartyInfo.IsComplete)
  1383. {
  1384. ViewManager.Show<LeagueTeaPartyShowView>();
  1385. }
  1386. else
  1387. ViewManager.Show<LeagueTeaPartyView>();
  1388. }
  1389. });
  1390. }
  1391. }
  1392. /// <summary>
  1393. /// 更新必需品的拥有状态
  1394. /// </summary>
  1395. private void UpdateNeedClothesState()
  1396. {
  1397. if (_ui.m_compNeed.target.visible)
  1398. {
  1399. _ui.m_compNeed.m_c1.selectedIndex = 0;
  1400. if (_fightCfg.needItemId > 0)
  1401. {
  1402. _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetItemName(_fightCfg.needItemId);
  1403. _ui.m_compNeed.target.data = _fightCfg.needItemId;
  1404. _ui.m_compNeed.m_imgGot.visible = ItemDataManager.GetItemNum(_fightCfg.needItemId) > 0;
  1405. }
  1406. else if (_fightCfg.needSuitId > 0)
  1407. {
  1408. _ui.m_compNeed.m_txtNeedName.text = ItemUtil.GetSuitName(_fightCfg.needSuitId);
  1409. _ui.m_compNeed.target.data = _fightCfg.needSuitId;
  1410. _ui.m_compNeed.m_imgGot.visible = DressUpMenuSuitDataManager.CheckHaveSuit(_fightCfg.needSuitId);
  1411. }
  1412. else
  1413. {
  1414. _ui.m_compNeed.m_c1.selectedIndex = 1;
  1415. _ui.m_compNeed.m_listTag.numItems = _fightCfg.needTagsArr.Length;
  1416. _ui.m_compNeed.m_imgGot.visible = false;
  1417. }
  1418. }
  1419. }
  1420. }
  1421. }