private static string GetTopUseHeroNames(ref COMDT_RANK_PASTSEASON_FIGHT_RECORD data, out List <COMDT_RANK_COMMON_USED_HERO> heroList) { heroList = new List <COMDT_RANK_COMMON_USED_HERO>(); for (int i = 0; i < data.dwCommonUsedHeroNum; i++) { if (data.astCommonUsedHeroInfo[i].dwHeroId != 0) { heroList.Add(data.astCommonUsedHeroInfo[i]); } } heroList.Sort(new Comparison <COMDT_RANK_COMMON_USED_HERO>(CLadderView.ComparisonHeroData)); StringBuilder builder = new StringBuilder(); int num2 = (heroList.Count <= 4) ? heroList.Count : 4; for (int j = 0; j < num2; j++) { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroList[j].dwHeroId); if (dataByKey != null) { builder.Append(StringHelper.UTF8BytesToString(ref dataByKey.szName)); builder.Append(" "); } } return(builder.ToString()); }
public static void SetMostRecentGameData(CUIFormScript form, ref COMDT_RANKDETAIL rankDetail, List <COMDT_RANK_CURSEASON_FIGHT_RECORD> dataList) { GameObject gameObject = form.transform.Find("StatPanel/RecentCon").gameObject; if (((rankDetail != null) && (dataList != null)) && ((dataList.Count > 0) && (rankDetail.dwSeasonIdx == dataList[0].dwSeasonId))) { Text component = gameObject.transform.Find("txtGameResult").GetComponent <Text>(); Text text2 = gameObject.transform.Find("txtGameTime").GetComponent <Text>(); COMDT_RANK_CURSEASON_FIGHT_RECORD data = dataList[0]; SetWinLose(component, ref data); text2.text = GetGameTime(ref data); ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(data.dwHeroId); if (dataByKey != null) { Image image = gameObject.transform.Find("heroItemCell/imageIcon").GetComponent <Image>(); image.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), form, true, false, false); image.transform.Find("Friend").gameObject.CustomSetActive(data.bTeamerNum > 1); } gameObject.CustomSetActive(true); } else { gameObject.CustomSetActive(false); } }
public override bool CheckArguments(string[] InArguments, out string OutMessage) { if (!base.CheckArguments(InArguments, out OutMessage)) { return(false); } if (CheatCommandBase.SmartConvert <ushort>(InArguments[0]) < 2014 || CheatCommandBase.SmartConvert <ushort>(InArguments[0]) > 2020) { OutMessage = "年份错误"; return(false); } if (CheatCommandBase.SmartConvert <byte>(InArguments[2]) < 1 || CheatCommandBase.SmartConvert <byte>(InArguments[2]) > 31) { OutMessage = "日期错误"; return(false); } uint HeroId = (uint)CheatCommandBase.SmartConvert <byte>(InArguments[4]); bool flag; if (HeroId == 0u) { flag = true; } else { ResHeroCfgInfo resHeroCfgInfo = GameDataMgr.heroDatabin.FindIf((ResHeroCfgInfo x) => x.dwCfgID == HeroId); flag = (resHeroCfgInfo != null); } if (!flag) { OutMessage = "错误的英雄ID"; return(false); } return(true); }
public static string GetSkinResourceName(int configID, int markID, string resName, int advancelevel = 0) { if (configID != 0 && markID != 0) { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((long)configID); if (dataByKey == null) { return(resName); } int num = resName.LastIndexOf('/'); StringBuilder stringBuilder = new StringBuilder(resName); string text = "prefab_skill_effects/hero_skill_effects/"; StringBuilder stringBuilder2 = new StringBuilder(text); stringBuilder2.AppendFormat("{0}_{1}/{2}", configID, dataByKey.szNamePinYin, markID); if (num >= 0) { stringBuilder.Remove(0, num); stringBuilder2.Append(stringBuilder); if (advancelevel > 0) { stringBuilder2.AppendFormat("_level{0}", advancelevel); } return(stringBuilder2.ToString()); } } return(resName); }
public int Compare(ResHeroCfgInfo l, ResHeroCfgInfo r) { if (l == null) { return(1); } if (r == null) { return(-1); } if (this.m_roleInfo == null) { return(-1); } switch (this.m_sortType) { case CMallSortHelper.HeroSortType.Name: return(this.CompareName(l, r)); case CMallSortHelper.HeroSortType.Coupons: return(this.CompareCoupons(l, r)); case CMallSortHelper.HeroSortType.Coin: return(this.CompareCoin(l, r)); case CMallSortHelper.HeroSortType.ReleaseTime: return(this.CompareReleaseTime(l, r)); default: return(this.CompareDefault(l, r)); } }
public static string GetJobFeature(uint heroId) { string text = string.Empty; ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId); CTextManager instance = Singleton <CTextManager> .GetInstance(); if (dataByKey != null) { string text2 = string.Empty; for (int i = 0; i < dataByKey.JobFeature.Length; i++) { text2 = CHeroInfo.GetFeatureStr(dataByKey.JobFeature[i]); if (!string.IsNullOrEmpty(text2)) { if (!string.IsNullOrEmpty(text)) { text = string.Format("{0}/{1}", text, text2); } else { text = text2; } } } } return(text); }
public void AnalyseHeroBornAndReviveAge(ref ActorPreloadTab loadInfo, int configID) { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((uint)configID); if (dataByKey != null) { AssetLoadBase item = new AssetLoadBase { assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szBorn_Age) }; string checkerKey = this.GetCheckerKey(item.assetPath, loadInfo.MarkID); if (!this.ageCheckerSet.ContainsKey(checkerKey)) { loadInfo.ageActions.Add(item); this.ageCheckerSet.Add(checkerKey, true); } AssetLoadBase base3 = new AssetLoadBase { assetPath = StringHelper.UTF8BytesToString(ref dataByKey.szRevive_Age) }; string key = this.GetCheckerKey(base3.assetPath, loadInfo.MarkID); if (!this.ageCheckerSet.ContainsKey(key)) { loadInfo.ageActions.Add(base3); this.ageCheckerSet.Add(key, true); } } }
public static string GetSkinResourceName(int configID, int markID, string resName, int advancelevel = 0) { if ((configID == 0) || (markID == 0)) { return(resName); } ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey((long)configID); if (dataByKey == null) { return(resName); } int length = resName.LastIndexOf('/'); StringBuilder builder = new StringBuilder(resName); string str = "prefab_skill_effects/hero_skill_effects/"; StringBuilder builder2 = new StringBuilder(str); builder2.AppendFormat("{0}_{1}/{2}", configID, dataByKey.szNamePinYin, markID); if (length < 0) { return(resName); } builder.Remove(0, length); builder2.Append(builder); if (advancelevel > 0) { builder2.AppendFormat("_level{0}", advancelevel); } return(builder2.ToString()); }
public static string GetJobFeature(uint heroId) { string str = string.Empty; ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId); CTextManager instance = Singleton <CTextManager> .GetInstance(); if (dataByKey != null) { string featureStr = string.Empty; for (int i = 0; i < dataByKey.JobFeature.Length; i++) { featureStr = GetFeatureStr((RES_HERO_JOB_FEATURE)dataByKey.JobFeature[i]); if (!string.IsNullOrEmpty(featureStr)) { if (!string.IsNullOrEmpty(str)) { str = string.Format("{0}/{1}", str, featureStr); } else { str = featureStr; } } } } return(str); }
public void Init(ulong playerId, COMDT_HEROINFO svrInfo) { this.cfgInfo = GameDataMgr.heroDatabin.GetDataByKey(svrInfo.stCommonInfo.dwHeroID); GameDataMgr.heroShopInfoDict.TryGetValue(svrInfo.stCommonInfo.dwHeroID, out this.shopCfgInfo); this.m_selectPageIndex = svrInfo.stCommonInfo.bSymbolPageWear; if (this.mActorValue == null) { this.mActorValue = new PropertyHelper(); } this.mActorValue.Init(svrInfo); if (this.skillInfo == null) { this.skillInfo = new CSkillData(); } this.skillInfo.InitSkillData(this.cfgInfo, svrInfo.stCommonInfo.stSkill); this.m_Proficiency = svrInfo.stCommonInfo.stProficiency.dwProficiency; this.m_ProficiencyLV = svrInfo.stCommonInfo.stProficiency.bLv; this.MaskBits = svrInfo.stCommonInfo.dwMaskBits; this.m_skinInfo.Init(svrInfo.stCommonInfo.wSkinID); this.m_talentBuyList = new byte[svrInfo.stCommonInfo.stTalent.astTalentInfo.Length]; for (int i = 0; i < svrInfo.stCommonInfo.stTalent.astTalentInfo.Length; i++) { this.m_talentBuyList[i] = svrInfo.stCommonInfo.stTalent.astTalentInfo[i].bIsBuyed; } this.m_awakeState = svrInfo.stCommonInfo.stTalent.bWakeState; this.m_awakeStepID = svrInfo.stCommonInfo.stTalent.stWakeStep.dwStepID; this.m_isStepFinish = svrInfo.stCommonInfo.stTalent.stWakeStep.bIsFinish == 1; this.m_experienceDeadLine = !this.IsExperienceHero() ? 0 : svrInfo.stCommonInfo.dwDeadLine; this.m_masterHeroFightCnt = svrInfo.stCommonInfo.dwMasterTotalFightCnt; this.m_masterHeroWinCnt = svrInfo.stCommonInfo.dwMasterTotalWinCnt; }
private void GetHeroRcmdSymbolList() { if (this.m_cfgHeroRcmdSymbolList.TryGetValue(this.m_curHeroId, ref this.m_rcmdSymbolList)) { return; } ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(this.m_curHeroId); if (dataByKey == null) { DebugHelper.Assert(false, "GetHeroRcmdSymbolList heroCfgInfo is null heroId = " + this.m_curHeroId); return; } List <uint>[] array = new List <uint> [CSymbolInfo.s_maxSymbolLevel]; HashSet <object> dataByKey2 = GameDataMgr.symbolRcmdDatabin.GetDataByKey(dataByKey.dwSymbolRcmdID); HashSet <object> .Enumerator enumerator = dataByKey2.GetEnumerator(); while (enumerator.MoveNext()) { ResSymbolRcmd resSymbolRcmd = (ResSymbolRcmd)enumerator.get_Current(); if (array[(int)(resSymbolRcmd.wSymbolLvl - 1)] == null) { array[(int)(resSymbolRcmd.wSymbolLvl - 1)] = new List <uint>(); } for (int i = 0; i < resSymbolRcmd.SymbolID.Length; i++) { if (resSymbolRcmd.SymbolID[i] > 0u) { array[(int)(resSymbolRcmd.wSymbolLvl - 1)].Add(resSymbolRcmd.SymbolID[i]); } } } this.m_cfgHeroRcmdSymbolList.Add(this.m_curHeroId, array); this.m_rcmdSymbolList = array; }
public CHeroItem(ulong objID, uint baseID, int stackCount = 0, int addTime = 0) { this.m_heroData = GameDataMgr.heroDatabin.GetDataByKey(baseID); if (this.m_heroData == null) { Debug.Log("not hero id" + baseID); return; } ResHeroShop resHeroShop = null; GameDataMgr.heroShopInfoDict.TryGetValue(baseID, out resHeroShop); this.m_type = COM_ITEM_TYPE.COM_OBJTYPE_HERO; this.m_objID = objID; this.m_baseID = baseID; this.m_name = StringHelper.UTF8BytesToString(ref this.m_heroData.szName); this.m_description = StringHelper.UTF8BytesToString(ref this.m_heroData.szHeroDesc); this.m_iconID = uint.Parse(StringHelper.UTF8BytesToString(ref this.m_heroData.szImagePath)); this.m_stackCount = stackCount; this.m_stackMax = 1; this.m_goldCoinBuy = 0u; this.m_dianQuanBuy = ((resHeroShop != null) ? resHeroShop.dwBuyCoupons : 1u); this.m_diamondBuy = ((resHeroShop != null) ? resHeroShop.dwBuyDiamond : 1u); this.m_arenaCoinBuy = ((resHeroShop != null) ? resHeroShop.dwBuyArenaCoin : 1u); this.m_burningCoinBuy = ((resHeroShop != null) ? resHeroShop.dwBuyBurnCoin : 1u); this.m_dianQuanDirectBuy = 0u; this.m_coinSale = 0u; this.m_grade = 3; this.m_isSale = 0; this.m_addTime = 0; base.ResetTime(); }
public static void UpdateRankGodTitle(ResHeroCfgInfo heroCfgInfo) { if (heroCfgInfo == null) { return; } CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(RankingSystem.s_rankingForm); if (form == null) { return; } GameObject gameObject = form.m_formWidgets[19]; if (gameObject == null) { return; } GameObject item = Utility.FindChild(gameObject, "heroItemCell"); CUICommonSystem.SetHeroItemImage(form, item, heroCfgInfo.szImagePath, enHeroHeadType.enIcon, false, false); Utility.GetComponetInChild <Text>(gameObject, "PlayerName").text = Singleton <CTextManager> .get_instance().GetText("RankGodHeroName", new string[] { heroCfgInfo.szHeroTitle, heroCfgInfo.szName }); }
private void ResetSkinList() { this.m_skinList.Clear(); Dictionary <long, object> .Enumerator enumerator = GameDataMgr.heroSkinDatabin.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <long, object> current = enumerator.get_Current(); ResHeroSkin resHeroSkin = current.get_Value() as ResHeroSkin; if (resHeroSkin != null && resHeroSkin.dwSkinID != 0u && GameDataMgr.IsSkinAvailableAtShop(resHeroSkin.dwID)) { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(resHeroSkin.dwHeroID); if (dataByKey != null && GameDataMgr.IsHeroAvailable(dataByKey.dwCfgID)) { CMallItem cMallItem = new CMallItem(resHeroSkin.dwHeroID, resHeroSkin.dwSkinID, CMallItem.IconType.Normal); if (this.m_heroJobType == enHeroJobType.All || dataByKey.bMainJob == (byte)this.m_heroJobType || dataByKey.bMinorJob == (byte)this.m_heroJobType) { if (this.m_notOwnFlag) { if (!cMallItem.Owned(false)) { this.m_skinList.Add(resHeroSkin); } } else { this.m_skinList.Add(resHeroSkin); } } } } } }
private int CompareCoupons(ResHeroCfgInfo l, ResHeroCfgInfo r) { ResHeroPromotion resPromotion = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion(); ResHeroPromotion promotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion(); stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, resPromotion); stPayInfoSet set2 = CMallSystem.GetPayInfoSetOfGood(r, promotion2); uint maxValue = uint.MaxValue; uint payValue = uint.MaxValue; for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++) { if ((((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan)) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)) && (payInfoSetOfGood.m_payInfos[i].m_payValue < maxValue)) { maxValue = payInfoSetOfGood.m_payInfos[i].m_payValue; } } for (int j = 0; j < set2.m_payInfoCount; j++) { if ((((set2.m_payInfos[j].m_payType == enPayType.Diamond) || (set2.m_payInfos[j].m_payType == enPayType.DianQuan)) || (set2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan)) && (set2.m_payInfos[j].m_payValue < payValue)) { payValue = set2.m_payInfos[j].m_payValue; } } if ((maxValue == uint.MaxValue) && this.IsDesc()) { maxValue = 0; } if ((payValue == uint.MaxValue) && this.IsDesc()) { payValue = 0; } return(maxValue.CompareTo(payValue)); }
public CHeroItem(ulong objID, uint baseID, int stackCount = 0, int addTime = 0) { this.m_heroData = GameDataMgr.heroDatabin.GetDataByKey(baseID); if (this.m_heroData == null) { Debug.Log("not hero id" + baseID); } else { base.m_type = COM_ITEM_TYPE.COM_OBJTYPE_HERO; base.m_objID = objID; base.m_baseID = baseID; base.m_name = StringHelper.UTF8BytesToString(ref this.m_heroData.szName); base.m_description = StringHelper.UTF8BytesToString(ref this.m_heroData.szHeroDesc); base.m_iconID = uint.Parse(StringHelper.UTF8BytesToString(ref this.m_heroData.szImagePath)); base.m_stackCount = stackCount; base.m_stackMax = 1; base.m_goldCoinBuy = 0; base.m_dianQuanBuy = (uint)this.m_heroData.dwBuyCoupons; base.m_diamondBuy = (uint)this.m_heroData.dwBuyDiamond; base.m_arenaCoinBuy = this.m_heroData.dwBuyArenaCoin; base.m_burningCoinBuy = (uint)this.m_heroData.dwBuyBurnCoin; base.m_dianQuanDirectBuy = 0; base.m_coinSale = 0; base.m_grade = 3; base.m_isSale = 0; base.m_addTime = 0; base.ResetTime(); } }
private void GetHeroRcmdSymbolList() { if (!this.m_cfgHeroRcmdSymbolList.TryGetValue(this.m_curHeroId, out this.m_rcmdSymbolList)) { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(this.m_curHeroId); if (dataByKey == null) { DebugHelper.Assert(false, "GetHeroRcmdSymbolList heroCfgInfo is null heroId = " + this.m_curHeroId); } else { List <uint>[] listArray = new List <uint> [CSymbolInfo.s_maxSymbolLevel]; HashSet <object> .Enumerator enumerator = GameDataMgr.symbolRcmdDatabin.GetDataByKey(dataByKey.dwSymbolRcmdID).GetEnumerator(); while (enumerator.MoveNext()) { ResSymbolRcmd current = (ResSymbolRcmd)enumerator.Current; if (listArray[current.wSymbolLvl - 1] == null) { listArray[current.wSymbolLvl - 1] = new List <uint>(); } for (int i = 0; i < current.SymbolID.Length; i++) { if (current.SymbolID[i] > 0) { listArray[current.wSymbolLvl - 1].Add(current.SymbolID[i]); } } } this.m_cfgHeroRcmdSymbolList.Add(this.m_curHeroId, listArray); this.m_rcmdSymbolList = listArray; } } }
private void RefreshHeroImage() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CSymbolSystem.s_symbolFormPath); if (null != form) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "RefreshHeroImage role is null"); if (masterRoleInfo != null) { GameObject widget = form.GetWidget(12); ResHeroCfgInfo dataByKey = null; if (masterRoleInfo.m_symbolInfo.m_selSymbolRcmdHeroId == 0) { dataByKey = GameDataMgr.heroDatabin.GetDataByKey(masterRoleInfo.GetFirstHeroId()); } else { dataByKey = GameDataMgr.heroDatabin.GetDataByKey(masterRoleInfo.m_symbolInfo.m_selSymbolRcmdHeroId); } if (dataByKey != null) { masterRoleInfo.m_symbolInfo.m_selSymbolRcmdHeroId = dataByKey.dwCfgID; this.m_curHeroId = dataByKey.dwCfgID; CUICommonSystem.SetHeroItemImage(form, widget.gameObject, dataByKey.szImagePath, enHeroHeadType.enIcon, false); GameObject obj3 = form.GetWidget(13); if (obj3 != null) { obj3.GetComponent <Text>().text = dataByKey.szName; } } } } }
private static string GetTopUseHeroNames(ref COMDT_RANK_PASTSEASON_FIGHT_RECORD data, out List <COMDT_RANK_COMMON_USED_HERO> heroList) { heroList = new List <COMDT_RANK_COMMON_USED_HERO>(); int num = 0; while ((long)num < (long)((ulong)data.dwCommonUsedHeroNum)) { if (data.astCommonUsedHeroInfo[num].dwHeroId != 0u) { heroList.Add(data.astCommonUsedHeroInfo[num]); } num++; } heroList.Sort(new Comparison <COMDT_RANK_COMMON_USED_HERO>(CLadderView.ComparisonHeroData)); StringBuilder stringBuilder = new StringBuilder(); int num2 = (heroList.get_Count() > 4) ? 4 : heroList.get_Count(); for (int i = 0; i < num2; i++) { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroList.get_Item(i).dwHeroId); if (dataByKey != null) { stringBuilder.Append(StringHelper.UTF8BytesToString(ref dataByKey.szName)); stringBuilder.Append(" "); } } return(stringBuilder.ToString()); }
private int CompareCoupons(ResHeroCfgInfo l, ResHeroCfgInfo r) { ResHeroPromotion resPromotion = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion(); ResHeroPromotion resPromotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion(); stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, resPromotion); stPayInfoSet payInfoSetOfGood2 = CMallSystem.GetPayInfoSetOfGood(r, resPromotion2); uint num = 4294967295u; uint num2 = 4294967295u; for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++) { if ((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood.m_payInfos[i].m_payValue < num) { num = payInfoSetOfGood.m_payInfos[i].m_payValue; } } for (int j = 0; j < payInfoSetOfGood2.m_payInfoCount; j++) { if ((payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood2.m_payInfos[j].m_payValue < num2) { num2 = payInfoSetOfGood2.m_payInfos[j].m_payValue; } } if (num == 4294967295u && this.IsDesc()) { num = 0u; } if (num2 == 4294967295u && this.IsDesc()) { num2 = 0u; } return(num.CompareTo(num2)); }
public static void SetGameInfoRecentPanel(CUIFormScript form, COMDT_RANKDETAIL rankDetail, List <COMDT_RANK_CURSEASON_FIGHT_RECORD> dataList) { GameObject widget = form.GetWidget(0); GameObject widget2 = form.GetWidget(14); if (rankDetail != null && dataList != null && dataList.get_Count() > 0 && rankDetail.dwSeasonIdx == dataList.get_Item(0).dwSeasonId) { Text component = form.GetWidget(7).GetComponent <Text>(); Text component2 = form.GetWidget(8).GetComponent <Text>(); COMDT_RANK_CURSEASON_FIGHT_RECORD cOMDT_RANK_CURSEASON_FIGHT_RECORD = dataList.get_Item(0); CLadderView.SetWinLose(component, ref cOMDT_RANK_CURSEASON_FIGHT_RECORD); component2.set_text(CLadderView.GetGameTime(ref cOMDT_RANK_CURSEASON_FIGHT_RECORD)); ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwHeroId); if (dataByKey != null) { Image component3 = form.GetWidget(3).GetComponent <Image>(); component3.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), form, true, false, false, false); form.GetWidget(6).CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 5); form.GetWidget(16).CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 4); form.GetWidget(17).CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 3); form.GetWidget(18).CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 2); GameObject gameObject = form.GetWidget(4).gameObject; gameObject.CustomSetActive(Convert.ToBoolean(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bIsBanPick)); } widget.CustomSetActive(true); widget2.CustomSetActive(false); } else { widget.CustomSetActive(false); widget2.CustomSetActive(true); } }
private void SetHeroItem(CMallItemWidget mallWidget, ResHeroCfgInfo heroInfo, CUIFormScript form) { Image component = mallWidget.m_icon.GetComponent <Image>(); component.color = CUIUtility.s_Color_White; string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, heroInfo.szImagePath); component.SetSprite(prefabPath, form, false, true, true); mallWidget.m_skinLabel.CustomSetActive(false); mallWidget.m_topNameLeftText.GetComponent <Text>().text = heroInfo.szName; mallWidget.m_topNameRightText.CustomSetActive(false); IHeroData data = CHeroDataFactory.CreateHeroData(heroInfo.dwCfgID); if (data != null) { ResHeroPromotion resPromotion = data.promotion(); this._payInfoTemp = CMallSystem.GetPayInfoSetOfGood(heroInfo, resPromotion); uint num = this.SetItemPriceInfo(mallWidget, ref this._payInfoTemp); this.SetItemTag(mallWidget, resPromotion, null, form); stUIEventParams eventParams = new stUIEventParams { heroId = heroInfo.dwCfgID, commonUInt64Param1 = this._curFriendUid, commonBool = this._curFriendIsSns, commonUInt32Param1 = this._curWorldId }; mallWidget.m_buyBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroView_OpenBuyHeroForFriend, eventParams); mallWidget.m_item.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.None, eventParams); } }
private void Show(CSignalTips_InBatMsg data, CUIFormScript formScript) { if (data == null || formScript == null) { return; } if (this.signal_node != null) { this.signal_node.CustomSetActive(false); } if (this.inbattlemsg_node != null) { this.inbattlemsg_node.CustomSetActive(true); } ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(data.heroID); if (dataByKey == null) { return; } if (this.leftIcon == null) { return; } this.SetHeroHeadIcon(this.leftIcon.gameObject.GetComponent <Image>(), formScript, dataByKey); Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer(); Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(data.playerID); if (hostPlayer == null || playerByUid == null) { return; } string text = (playerByUid == hostPlayer) ? CSignalTipShower.S_Bg_Green : CSignalTipShower.S_Bg_Blue; if (this.bg_icon == null) { return; } Image component = this.bg_icon.GetComponent <Image>(); if (component != null && !string.IsNullOrEmpty(text)) { component.SetSprite(text, formScript, true, false, false, false); } if (this.inbattlemsg_txt != null) { this.inbattlemsg_txt.set_text(data.content); this.inbattlemsg_txt.gameObject.CustomSetActive(true); } if (this.rightIcon != null) { this.rightIcon.CustomSetActive(false); } if (this.signal_icon != null) { this.signal_icon.CustomSetActive(false); } }
public static void OnReceiveDianQuanReward(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); SCPKG_CMD_COUPONS_REWARDINFO stCouponsRewardRsp = msg.stPkgData.stCouponsRewardRsp; bool flag = true; CPaySystem instance = Singleton <CPaySystem> .GetInstance(); instance.rewardItems.Clear(); int num = Mathf.Min(stCouponsRewardRsp.stRewardInfo.bNum, stCouponsRewardRsp.stRewardInfo.astRewardDetail.Length); for (int i = 0; i < num; i++) { if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 5) { CUICommonSystem.ShowNewHeroOrSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stHero.dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, false, null, enFormPriority.Priority1, 0, 0); flag = false; break; } if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 10) { uint num3; uint num4; CSkinInfo.ResolveHeroSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stSkin.dwSkinID, out num3, out num4); CUICommonSystem.ShowNewHeroOrSkin(num3, num4, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, false, null, enFormPriority.Priority1, 0, 0); flag = false; break; } if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 1) { if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 1) { uint dwHeroID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stHeroInfo.dwHeroID; ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwHeroID); if (dataByKey != null) { CUICommonSystem.ShowNewHeroOrSkin(dwHeroID, 0, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, dataByKey.dwChgItemCnt, 0); } } else if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 2) { uint dwSkinID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stSkinInfo.dwSkinID; uint heroId = 0; uint skinId = 0; CSkinInfo.ResolveHeroSkin(dwSkinID, out heroId, out skinId); ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId); if (heroSkin != null) { CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, heroSkin.dwChgItemCnt, 0); } } } } instance.rewardItems = CUseableManager.GetUseableListFromReward(stCouponsRewardRsp.stRewardInfo); if (flag) { Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(instance.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award"); } }
private void SetHeroHeadIcon(Image img, CUIFormScript formScript, ResHeroCfgInfo heroCfgInfo) { if (((img != null) && (formScript != null)) && (heroCfgInfo != null)) { string prefabPath = CUIUtility.s_Sprite_Dynamic_BustCircle_Dir + heroCfgInfo.szImagePath; img.SetSprite(prefabPath, formScript, true, false, false); } }
public static void InitLadderRecent(CUIFormScript form, List <COMDT_RANK_CURSEASON_FIGHT_RECORD> dataList) { CUIListScript component = form.transform.Find("Root/List").GetComponent <CUIListScript>(); if (dataList == null) { component.SetElementAmount(0); } else { int num = (dataList.get_Count() < 10) ? dataList.get_Count() : 10; component.SetElementAmount(num); for (int i = 0; i < num; i++) { CUIListElementScript elemenet = component.GetElemenet(i); COMDT_RANK_CURSEASON_FIGHT_RECORD cOMDT_RANK_CURSEASON_FIGHT_RECORD = dataList.get_Item(i); DebugHelper.Assert(cOMDT_RANK_CURSEASON_FIGHT_RECORD != null); Image component2 = elemenet.transform.Find("imageIcon").GetComponent <Image>(); Text component3 = elemenet.transform.Find("txtResult").GetComponent <Text>(); Text component4 = elemenet.transform.Find("txtBraveScore").GetComponent <Text>(); Text component5 = elemenet.transform.Find("txtTime").GetComponent <Text>(); Text component6 = elemenet.transform.Find("txtKDA").GetComponent <Text>(); CLadderView.SetWinLose(component3, ref cOMDT_RANK_CURSEASON_FIGHT_RECORD); component4.set_text(cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwAddStarScore.ToString()); component5.set_text(CLadderView.GetGameTime(ref cOMDT_RANK_CURSEASON_FIGHT_RECORD)); component6.set_text(string.Format("{0} / {1} / {2}", cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwKillNum, cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwDeadNum, cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwAssistNum)); ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(cOMDT_RANK_CURSEASON_FIGHT_RECORD.dwHeroId); if (dataByKey != null) { component2.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), form, true, false, false, false); Utility.FindChild(component2.gameObject, "FiveFriend").CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 5); Utility.FindChild(component2.gameObject, "FourFriend").CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 4); Utility.FindChild(component2.gameObject, "ThreeFriend").CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 3); Utility.FindChild(component2.gameObject, "TwoFriend").CustomSetActive(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bTeamerNum == 2); Utility.FindChild(component2.gameObject, "Bp").CustomSetActive(Convert.ToBoolean(cOMDT_RANK_CURSEASON_FIGHT_RECORD.bIsBanPick)); } for (int j = 0; j < 6; j++) { COMDT_INGAME_EQUIP_INFO cOMDT_INGAME_EQUIP_INFO = null; if (j < (int)cOMDT_RANK_CURSEASON_FIGHT_RECORD.bEquipNum) { cOMDT_INGAME_EQUIP_INFO = cOMDT_RANK_CURSEASON_FIGHT_RECORD.astEquipDetail[j]; } Image component7 = elemenet.transform.FindChild(string.Format("TianFu/TianFuIcon{0}", (j + 1).ToString())).GetComponent <Image>(); if (cOMDT_INGAME_EQUIP_INFO == null || cOMDT_INGAME_EQUIP_INFO.dwEquipID == 0u) { component7.gameObject.CustomSetActive(false); } else { component7.gameObject.CustomSetActive(true); CUICommonSystem.SetEquipIcon((ushort)cOMDT_INGAME_EQUIP_INFO.dwEquipID, component7.gameObject, form); } } } } }
private void RealIndexGetReady(bool forceUpdate = false) { if (!forceUpdate && this._curFilterJob == this._curJobView && this._curFilterMenuPage == this._curMenuPage && ((this._curFilterMenuPage == GiftCenter.MenuPage.Hero && this._curFilterHeroSortType == this._curHeroSortType) || (this._curFilterMenuPage == GiftCenter.MenuPage.Skin && this._curFilterSkinSortType == this._curSkinSortType))) { return; } this._curFilterJob = this._curJobView; this._curFilterMenuPage = this._curMenuPage; int num = 0; if (this._curMenuPage == GiftCenter.MenuPage.Skin) { this._curFilterSkinSortType = this._curSkinSortType; this.CleanSortSkinList(); for (int i = 0; i < this._skinTotalNum; i++) { ResHeroSkin resHeroSkin = this._skinList[i]; ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(resHeroSkin.dwHeroID); if (dataByKey.bMainJob == (byte)this._curJobView || dataByKey.bMinorJob == (byte)this._curJobView) { if (num < this._filterTempList.get_Count()) { this._filterTempList.set_Item(num, i); } else { this._filterTempList.Add(i); } num++; } } this._tempListNum = num; } else { this._curFilterHeroSortType = this._curHeroSortType; this.CleanSortHeroList(); for (int j = 0; j < this._heroTotalNum; j++) { ResHeroCfgInfo resHeroCfgInfo = this._heroList[j]; if (resHeroCfgInfo.bMainJob == (byte)this._curJobView || resHeroCfgInfo.bMinorJob == (byte)this._curJobView) { if (num < this._filterTempList.get_Count()) { this._filterTempList.set_Item(num, j); } else { this._filterTempList.Add(j); } num++; } } this._tempListNum = num; } }
public static string GetHeroName(uint heroId) { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId); if (dataByKey != null) { return(dataByKey.szName); } return(string.Empty); }
public CHeroCfgData(uint id) { this.m_cfgInfo = GameDataMgr.heroDatabin.GetDataByKey(id); if (this.m_cfgInfo != null) { this.m_name = StringHelper.UTF8BytesToString(ref this.m_cfgInfo.szName); this.m_imgPath = StringHelper.UTF8BytesToString(ref this.m_cfgInfo.szImagePath); this.m_tilte = StringHelper.UTF8BytesToString(ref this.m_cfgInfo.szHeroTitle); } }
private void SetHeroHeadIcon(Image img, CUIFormScript formScript, ResHeroCfgInfo heroCfgInfo) { if (img == null || formScript == null || heroCfgInfo == null) { return; } string prefabPath = CUIUtility.s_Sprite_Dynamic_BustCircle_Dir + heroCfgInfo.szImagePath; img.SetSprite(prefabPath, formScript, true, false, false, false); }