DressUpFightView.cs 65 KB

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