DressUpFightView.cs 65 KB

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