DressUpFightView.cs 65 KB

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