public static void OnRankGodDetailEquipClick(CEquipInfo equipInfo, string playerName, string heroName) { CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(RankingSystem.s_rankingGodDetailForm); if (form == null) { return; } GameObject widget = form.GetWidget(0); if (widget == null) { return; } GameObject p = Utility.FindChild(widget, "Panel_EquipInfo"); Text componetInChild = Utility.GetComponetInChild <Text>(p, "heroEquipText"); Text componetInChild2 = Utility.GetComponetInChild <Text>(p, "equipNameText"); Text componetInChild3 = Utility.GetComponetInChild <Text>(p, "Panel_euipProperty/equipPropertyDescText"); componetInChild2.text = ((equipInfo != null) ? equipInfo.m_equipName : string.Empty); componetInChild3.text = ((equipInfo != null) ? equipInfo.m_equipPropertyDesc : string.Empty); componetInChild.text = Singleton <CTextManager> .get_instance().GetText("RankGodHeroEquipDesc", new string[] { playerName, heroName }); }
public void Create(ushort rootEquipID, Dictionary <ushort, CEquipInfo> equipInfoDictionary) { this.Clear(); if (rootEquipID == 0) { return; } this.m_rootEquipID = rootEquipID; CEquipInfo cEquipInfo = null; if (equipInfoDictionary.TryGetValue(rootEquipID, ref cEquipInfo)) { CEquipInfo cEquipInfo2 = null; for (int i = 0; i < cEquipInfo.m_resEquipInBattle.PreEquipID.Length; i++) { ushort num = cEquipInfo.m_resEquipInBattle.PreEquipID[i]; if (num > 0 && equipInfoDictionary.TryGetValue(num, ref cEquipInfo2) && cEquipInfo2.m_resEquipInBattle.bInvalid == 0) { this.m_2ndEquipIDs[(int)((UIntPtr)this.m_2ndEquipCount)] = num; CEquipInfo cEquipInfo3 = null; for (int j = 0; j < cEquipInfo2.m_resEquipInBattle.PreEquipID.Length; j++) { ushort num2 = cEquipInfo2.m_resEquipInBattle.PreEquipID[j]; if (num2 > 0 && equipInfoDictionary.TryGetValue(num2, ref cEquipInfo3) && cEquipInfo3.m_resEquipInBattle.bInvalid == 0) { this.m_3rdEquipIDs[(int)((UIntPtr)this.m_2ndEquipCount)][(int)((UIntPtr)this.m_3rdEquipCounts[(int)((UIntPtr)this.m_2ndEquipCount)])] = num2; this.m_3rdEquipCounts[(int)((UIntPtr)this.m_2ndEquipCount)] += 1u; } } this.m_2ndEquipCount += 1u; } } } }
private void EnableBackEquipNode(ushort equipID, Dictionary <ushort, CEquipInfo> equipInfoDictionary) { CEquipInfo info = null; if (equipInfoDictionary.TryGetValue(equipID, out info) && (info.m_backEquipIDs != null)) { for (int i = 0; i < info.m_backEquipIDs.Count; i++) { this.EnableEquipNode(info.m_backEquipIDs[i]); this.DisplayEquipLineSet(equipID, info.m_backEquipIDs[i]); this.EnableBackEquipNode(info.m_backEquipIDs[i], equipInfoDictionary); } } }
private void EnableBackEquipNode(ushort equipID, Dictionary <ushort, CEquipInfo> equipInfoDictionary) { CEquipInfo cEquipInfo = null; if (equipInfoDictionary.TryGetValue(equipID, ref cEquipInfo) && cEquipInfo.m_backEquipIDs != null) { for (int i = 0; i < cEquipInfo.m_backEquipIDs.get_Count(); i++) { this.EnableEquipNode(cEquipInfo.m_backEquipIDs.get_Item(i)); this.DisplayEquipLineSet(equipID, cEquipInfo.m_backEquipIDs.get_Item(i)); this.EnableBackEquipNode(cEquipInfo.m_backEquipIDs.get_Item(i), equipInfoDictionary); } } }
private void AppendBackEquipIDs(ushort equipID, Dictionary <ushort, CEquipInfo> equipInfoDictionary, ref uint backEquipIDTotalCount, ref ushort[] backEquipIDs) { if (equipID != 0) { CEquipInfo info = null; if ((equipInfoDictionary.TryGetValue(equipID, out info) && (info.m_backEquipIDs != null)) && (info.m_backEquipIDs.Count > 0)) { for (int i = 0; i < info.m_backEquipIDs.Count; i++) { backEquipIDs[backEquipIDTotalCount] = info.m_backEquipIDs[i]; backEquipIDTotalCount++; } } } }
private void EnablePreEquipNode(ushort equipID, Dictionary <ushort, CEquipInfo> equipInfoDictionary) { CEquipInfo info = null; if (equipInfoDictionary.TryGetValue(equipID, out info) && (info.m_resEquipInBattle != null)) { for (int i = 0; i < info.m_resEquipInBattle.PreEquipID.Length; i++) { if (info.m_resEquipInBattle.PreEquipID[i] > 0) { this.EnableEquipNode(info.m_resEquipInBattle.PreEquipID[i]); this.DisplayEquipLineSet(info.m_resEquipInBattle.PreEquipID[i], equipID); this.EnablePreEquipNode(info.m_resEquipInBattle.PreEquipID[i], equipInfoDictionary); } } } }
public int CompareTo(object obj) { CEquipInfo info = obj as CEquipInfo; if (this.m_resEquipInBattle.dwBuyPrice > info.m_resEquipInBattle.dwBuyPrice) { return(-1); } if (this.m_resEquipInBattle.dwBuyPrice == info.m_resEquipInBattle.dwBuyPrice) { if (this.m_equipID > info.m_equipID) { return(-1); } if (this.m_equipID == info.m_equipID) { return(0); } } return(1); }
public void Create(ushort rootEquipID, Dictionary <ushort, CEquipInfo> equipInfoDictionary) { this.Clear(); if (rootEquipID != 0) { this.m_rootEquipID = rootEquipID; CEquipInfo info = null; if (equipInfoDictionary.TryGetValue(rootEquipID, out info)) { for (int i = 0; i < info.m_resEquipInBattle.PreEquipID.Length; i++) { if (info.m_resEquipInBattle.PreEquipID[i] > 0) { this.m_2ndEquipIDs[this.m_2ndEquipCount] = info.m_resEquipInBattle.PreEquipID[i]; this.m_2ndEquipCount++; } } for (int j = 0; j < this.m_2ndEquipCount; j++) { CEquipInfo info2 = null; if (equipInfoDictionary.TryGetValue(this.m_2ndEquipIDs[j], out info2)) { for (int k = 0; k < info2.m_resEquipInBattle.PreEquipID.Length; k++) { if (info2.m_resEquipInBattle.PreEquipID[k] > 0) { this.m_3rdEquipIDs[j][this.m_3rdEquipCounts[j]] = info2.m_resEquipInBattle.PreEquipID[k]; this.m_3rdEquipCounts[j]++; } } } } } this.AppendBackEquipIDs(rootEquipID, equipInfoDictionary, ref this.m_backEquipCount, ref this.m_backEquipIDs); } }
public static void OnRankGodDetailTab(int tabIndex, COMDT_RANKING_LIST_ITEM_EXTRA_MASTER_HERO masterHeroInfo, uint heroId) { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(RankingSystem.s_rankingGodDetailForm); if (form != null) { GameObject widget = form.GetWidget(0); if (widget != null) { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId); if (dataByKey != null) { GameObject obj3 = Utility.FindChild(widget, "Panel_EquipInfo"); GameObject obj4 = Utility.FindChild(widget, "Panel_SymbolInfo"); string str = Utility.UTF8Convert(masterHeroInfo.stAcntInfo.szPlayerName); string szName = dataByKey.szName; obj3.CustomSetActive(false); obj4.CustomSetActive(false); if (tabIndex == 0) { obj3.CustomSetActive(true); CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(obj3, "List"); int bEquipNum = masterHeroInfo.stEquipList.bEquipNum; ushort[] defaultRecommendEquipInfo = new ushort[6]; if (bEquipNum > 0) { for (int j = 0; j < bEquipNum; j++) { defaultRecommendEquipInfo[j] = (ushort)masterHeroInfo.stEquipList.EquipID[j]; } } else { defaultRecommendEquipInfo = Singleton <CEquipSystem> .instance.GetDefaultRecommendEquipInfo(heroId); bEquipNum = defaultRecommendEquipInfo.Length; } componetInChild.SetElementAmount(bEquipNum); for (int i = 0; i < bEquipNum; i++) { GameObject gameObject = componetInChild.GetElemenet(i).gameObject; CUIEventScript component = gameObject.GetComponent <CUIEventScript>(); ushort equipID = defaultRecommendEquipInfo[i]; CEquipInfo equipInfo = Singleton <CEquipSystem> .instance.GetEquipInfo(equipID); component.m_onClickEventParams.battleEquipPar.equipInfo = Singleton <CEquipSystem> .instance.GetEquipInfo(equipID); component.m_onClickEventParams.tagStr = str; component.m_onClickEventParams.tagStr1 = szName; CUICommonSystem.SetEquipIcon(equipID, gameObject, form); } if (bEquipNum > 0) { componetInChild.SelectElement(0, true); componetInChild.GetElemenet(0).GetComponent <CUIEventScript>().OnPointerClick(null); CUIEventScript script4 = componetInChild.GetElemenet(0).GetComponent <CUIEventScript>(); Singleton <CUIEventManager> .instance.DispatchUIEvent(script4.m_onClickEventID, script4.m_onClickEventParams); } else { componetInChild.SelectElement(-1, true); } } else if (tabIndex == 1) { ListView <CSymbolItem> symbolList = new ListView <CSymbolItem>(); for (int k = 0; k < masterHeroInfo.stSymbolPageInfo.bSymbolPosNum; k++) { bool flag = false; for (int n = 0; n < symbolList.Count; n++) { if (symbolList[n].m_baseID == masterHeroInfo.stSymbolPageInfo.SymbolId[k]) { CSymbolItem local1 = symbolList[n]; local1.m_stackCount++; flag = true; break; } } if (!flag) { CSymbolItem item = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL, masterHeroInfo.stSymbolPageInfo.SymbolId[k], 1) as CSymbolItem; symbolList.Add(item); } } CSymbolWearController.SortSymbolList(ref symbolList); obj4.CustomSetActive(true); CUIListScript script5 = Utility.GetComponetInChild <CUIListScript>(obj4, "List"); script5.SetElementAmount(symbolList.Count); int num7 = 0; for (int m = 0; m < symbolList.Count; m++) { GameObject p = script5.GetElemenet(m).gameObject; Utility.GetComponetInChild <Image>(p, "imgIcon").SetSprite(symbolList[m].GetIconPath(), form, true, false, false); Utility.GetComponetInChild <Text>(p, "SymbolName").text = symbolList[m].m_name; char[] trimChars = new char[] { '\n' }; Utility.GetComponetInChild <Text>(p, "SymbolDesc").text = CSymbolSystem.GetSymbolAttString(symbolList[m], true).TrimEnd(trimChars); Utility.GetComponetInChild <Text>(p, "lblIconCount").text = string.Format("x{0}", symbolList[m].m_stackCount); num7 += symbolList[m].m_SymbolData.wLevel; } Utility.GetComponetInChild <Text>(obj4, "symbolPageLvlText").text = num7.ToString(); string[] args = new string[] { str, szName }; Utility.GetComponetInChild <Text>(obj4, "heroSymbolText").text = Singleton <CTextManager> .instance.GetText("RankGodHeroSymbolDesc", args); } } } } }
public static void OnRankGodDetailTab(int tabIndex, COMDT_RANKING_LIST_ITEM_EXTRA_MASTER_HERO masterHeroInfo, uint heroId) { CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(RankingSystem.s_rankingGodDetailForm); if (form == null) { return; } GameObject widget = form.GetWidget(0); if (widget == null) { return; } ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId); if (dataByKey == null) { return; } GameObject gameObject = Utility.FindChild(widget, "Panel_EquipInfo"); GameObject gameObject2 = Utility.FindChild(widget, "Panel_SymbolInfo"); string text = Utility.UTF8Convert(masterHeroInfo.stAcntInfo.szPlayerName); string szName = dataByKey.szName; gameObject.CustomSetActive(false); gameObject2.CustomSetActive(false); if (tabIndex == 0) { gameObject.CustomSetActive(true); CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(gameObject, "List"); int num = (int)masterHeroInfo.stEquipList.bEquipNum; ushort[] array = new ushort[6]; if (num > 0) { for (int i = 0; i < num; i++) { array[i] = (ushort)masterHeroInfo.stEquipList.EquipID[i]; } } else { ResRecommendEquipInBattle defaultRecommendEquipInfo = Singleton <CEquipSystem> .get_instance().GetDefaultRecommendEquipInfo(heroId, 1u); if (defaultRecommendEquipInfo != null) { array = defaultRecommendEquipInfo.RecommendEquipID; } num = array.Length; } componetInChild.SetElementAmount(num); for (int j = 0; j < num; j++) { GameObject gameObject3 = componetInChild.GetElemenet(j).gameObject; CUIEventScript component = gameObject3.GetComponent <CUIEventScript>(); ushort num2 = array[j]; CEquipInfo equipInfo = CEquipSystem.GetEquipInfo(num2); component.m_onClickEventParams.battleEquipPar.equipInfo = CEquipSystem.GetEquipInfo(num2); component.m_onClickEventParams.tagStr = text; component.m_onClickEventParams.tagStr1 = szName; CUICommonSystem.SetEquipIcon(num2, gameObject3, form); } if (num > 0) { componetInChild.SelectElement(0, true); componetInChild.GetElemenet(0).GetComponent <CUIEventScript>().OnPointerClick(null); CUIEventScript component2 = componetInChild.GetElemenet(0).GetComponent <CUIEventScript>(); Singleton <CUIEventManager> .get_instance().DispatchUIEvent(component2.m_onClickEventID, component2.m_onClickEventParams); } else { componetInChild.SelectElement(-1, true); } } else if (tabIndex == 1) { ListView <CSymbolItem> listView = new ListView <CSymbolItem>(); for (int k = 0; k < (int)masterHeroInfo.stSymbolPageInfo.bSymbolPosNum; k++) { bool flag = false; for (int l = 0; l < listView.get_Count(); l++) { if (listView.get_Item(l).m_baseID == masterHeroInfo.stSymbolPageInfo.SymbolId[k]) { listView.get_Item(l).m_stackCount++; flag = true; break; } } if (!flag) { CSymbolItem cSymbolItem = CUseableManager.CreateUseable(5, masterHeroInfo.stSymbolPageInfo.SymbolId[k], 1) as CSymbolItem; listView.Add(cSymbolItem); } } CSymbolWearController.SortSymbolList(ref listView); gameObject2.CustomSetActive(true); CUIListScript componetInChild2 = Utility.GetComponetInChild <CUIListScript>(gameObject2, "List"); componetInChild2.SetElementAmount(listView.get_Count()); int num3 = 0; for (int m = 0; m < listView.get_Count(); m++) { GameObject gameObject4 = componetInChild2.GetElemenet(m).gameObject; Image componetInChild3 = Utility.GetComponetInChild <Image>(gameObject4, "imgIcon"); componetInChild3.SetSprite(listView.get_Item(m).GetIconPath(), form, true, false, false, false); Text componetInChild4 = Utility.GetComponetInChild <Text>(gameObject4, "SymbolName"); componetInChild4.text = listView.get_Item(m).m_name; Text componetInChild5 = Utility.GetComponetInChild <Text>(gameObject4, "SymbolDesc"); componetInChild5.text = CSymbolSystem.GetSymbolAttString(listView.get_Item(m), true).TrimEnd(new char[] { '\n' }); Text componetInChild6 = Utility.GetComponetInChild <Text>(gameObject4, "lblIconCount"); componetInChild6.text = string.Format("x{0}", listView.get_Item(m).m_stackCount); num3 += (int)listView.get_Item(m).m_SymbolData.wLevel *listView.get_Item(m).m_stackCount; } Utility.GetComponetInChild <Text>(gameObject2, "symbolPageLvlText").text = num3.ToString(); Utility.GetComponetInChild <Text>(gameObject2, "heroSymbolText").text = Singleton <CTextManager> .get_instance().GetText("RankGodHeroSymbolDesc", new string[] { text, szName }); } }