public void LoadConfig() { Dictionary <long, object> .Enumerator enumerator = GameDataMgr.recruimentReward.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <long, object> current = enumerator.get_Current(); ResRecruitmentReward resRecruitmentReward = (ResRecruitmentReward)current.get_Value(); if (!this.m_rewardConfig.Contains(resRecruitmentReward)) { this.m_rewardConfig.Add(resRecruitmentReward); } if (resRecruitmentReward.bRecruimentType == 1 && resRecruitmentReward.bRewardBit == 5) { this.SuperReward = null; this.SuperReward = new CFriendRecruit.RecruitReward(resRecruitmentReward.wID, CFriendRecruit.RewardState.Normal); } } this.InitData(); for (int i = 0; i < this.m_zhaoMuZhe.get_Count(); i++) { CFriendRecruit.RecruitData data = this.m_zhaoMuZhe.get_Item(i); this.ParseConfig(data); } this.ParseConfig(this.m_beiZhaoMuZhe); }
public void ResetReward() { for (int i = 0; i < this.RewardList.get_Count(); i++) { CFriendRecruit.RecruitReward recruitReward = this.RewardList.get_Item(i); recruitReward.state = CFriendRecruit.RewardState.Normal; } Singleton <EventRouter> .GetInstance().BroadCastEvent("FRDataChange"); }
public static CFriendRecruit.RecruitReward GetReward(ushort rewardID, ListView <CFriendRecruit.RecruitReward> list) { for (int i = 0; i < list.get_Count(); i++) { CFriendRecruit.RecruitReward recruitReward = list.get_Item(i); if (recruitReward != null && recruitReward.rewardID == rewardID) { return(recruitReward); } } return(null); }
public bool IsGetAllReward() { for (int i = 0; i < this.RewardList.get_Count(); i++) { CFriendRecruit.RecruitReward recruitReward = this.RewardList.get_Item(i); if (recruitReward != null && recruitReward.state != CFriendRecruit.RewardState.Getted && recruitReward.state != CFriendRecruit.RewardState.Keling) { return(false); } } return(true); }
public void Clear() { this._userInfo = null; for (int i = 0; i < this.RewardList.get_Count(); i++) { CFriendRecruit.RecruitReward recruitReward = this.RewardList.get_Item(i); if (recruitReward != null) { recruitReward.Clear(); } } this.RewardList.Clear(); }
public void SetReward(ushort rewardID, CFriendRecruit.RewardState state) { CFriendRecruit.RecruitReward reward = this.GetReward(rewardID); if (reward == null) { this.RewardList.Add(new CFriendRecruit.RecruitReward(rewardID, state)); } else { reward.state = state; } Singleton <EventRouter> .GetInstance().BroadCastEvent("FRDataChange"); }
public void CheckCanGetReward(CFriendRecruit.RecruitData data) { for (int i = 0; i < data.RewardList.get_Count(); i++) { CFriendRecruit.RecruitReward recruitReward = data.RewardList.get_Item(i); if (recruitReward.state == CFriendRecruit.RewardState.Normal) { ResRecruitmentReward cfgReward = this.GetCfgReward(recruitReward.rewardID); if (cfgReward != null && data.userInfo != null && data.userInfo.dwPvpLvl >= cfgReward.dwLevel) { recruitReward.state = CFriendRecruit.RewardState.Keling; } } } }
public void ParseConfig(CFriendRecruit.RecruitData data) { for (int i = 0; i < this.m_rewardConfig.get_Count(); i++) { ResRecruitmentReward resRecruitmentReward = this.m_rewardConfig.get_Item(i); if (data.type == resRecruitmentReward.bRecruimentType) { CFriendRecruit.RecruitReward reward = data.GetReward(resRecruitmentReward.wID); if (reward == null || reward.state != CFriendRecruit.RewardState.Getted) { data.SetReward(resRecruitmentReward.wID, CFriendRecruit.RewardState.Normal); } } } }
public void ShowZhaomuZhe_Item(GameObject com, CFriendRecruit.RecruitData info) { if (info.userInfo != null) { com.transform.FindChild("user/hasData").gameObject.CustomSetActive(true); com.transform.FindChild("user/null").gameObject.CustomSetActive(false); com.transform.FindChild("user/hasData/Level").gameObject.CustomSetActive(true); CUIHttpImageScript component = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>(); UT.SetHttpImage(component, info.userInfo.szHeadUrl); Text component2 = com.transform.FindChild("user/hasData/Level").GetComponent <Text>(); component2.text = string.Format("Lv.{0}", info.userInfo.dwPvpLvl); GameObject gameObject = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage/NobeIcon").gameObject; if (gameObject) { MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject.GetComponent <Image>(), (int)info.userInfo.stGameVip.dwCurLevel, false); } Text component3 = com.transform.FindChild("user/hasData/NameGroup/Name").GetComponent <Text>(); string text = UT.Bytes2String(info.userInfo.szUserName); if (component3 != null) { component3.text = text; } GameObject gameObject2 = com.transform.FindChild("user/hasData/NameGroup/Gender").gameObject; FriendShower.ShowGender(gameObject2, info.userInfo.bGender); } else { com.transform.FindChild("user/hasData").gameObject.CustomSetActive(false); com.transform.FindChild("user/null").gameObject.CustomSetActive(true); } CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath); int num = Math.Min(this.zhaomuzheRewardCount, info.RewardList.get_Count()); for (int i = 0; i < num; i++) { Transform transform = com.transform.FindChild(string.Format("reward_{0}", i)); DebugHelper.Assert(transform != null, "rewardNodeTS not null..."); if (!(transform == null)) { CFriendRecruit.RecruitReward recruitReward = info.RewardList.get_Item(i); this.Show_Award(transform.gameObject, info.ullUid, info.dwLogicWorldId, 1, recruitReward.rewardID, recruitReward.state, form, true); } } }
public void SetRecruiterRewardBits(uint m_dwRecruiterRewardBits) { this.m_dwRecruiterRewardBits = m_dwRecruiterRewardBits; for (int i = 0; i < this.m_beiZhaoMuZhe.RewardList.get_Count(); i++) { CFriendRecruit.RecruitReward recruitReward = this.m_beiZhaoMuZhe.RewardList.get_Item(i); if (this.HasGetBeiZhaoMuZheReward((int)recruitReward.cfg.bRewardBit)) { recruitReward.state = CFriendRecruit.RewardState.Getted; } else if (this.m_beiZhaoMuZhe.userInfo != null && this.m_beiZhaoMuZhe.userInfo.dwPvpLvl >= recruitReward.cfg.dwLevel) { recruitReward.state = CFriendRecruit.RewardState.Keling; } else { recruitReward.state = CFriendRecruit.RewardState.Normal; } } }
public void CheckBeiZhaoMuZheReward() { if (this.m_beiZhaoMuZhe == null || this.m_beiZhaoMuZhe.userInfo == null) { return; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo(); for (int i = 0; i < this.m_beiZhaoMuZhe.RewardList.get_Count(); i++) { CFriendRecruit.RecruitReward recruitReward = this.m_beiZhaoMuZhe.RewardList.get_Item(i); if (recruitReward.state == CFriendRecruit.RewardState.Normal) { ResRecruitmentReward cfgReward = this.GetCfgReward(recruitReward.rewardID); if (cfgReward != null && masterRoleInfo != null && masterRoleInfo.PvpLevel >= cfgReward.dwLevel) { recruitReward.state = CFriendRecruit.RewardState.Keling; } } } }
public void SetRecruiterRewardBits(uint m_dwRecruiterRewardBits) { this.m_dwRecruiterRewardBits = m_dwRecruiterRewardBits; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); for (int i = 0; i < this.m_beiZhaoMuZhe.RewardList.Count; i++) { CFriendRecruit.RecruitReward recruitReward = this.m_beiZhaoMuZhe.RewardList[i]; if (this.HasGetBeiZhaoMuZheReward((int)recruitReward.cfg.bRewardBit)) { recruitReward.state = CFriendRecruit.RewardState.Getted; } else if (this.m_beiZhaoMuZhe.userInfo != null && masterRoleInfo != null && masterRoleInfo.PvpLevel >= recruitReward.cfg.dwLevel) { recruitReward.state = CFriendRecruit.RewardState.Keling; } else { recruitReward.state = CFriendRecruit.RewardState.Normal; } } }
public void ShowZhaomuZhe_Item(GameObject com, CFriendRecruit.RecruitData info) { GameObject bar = Utility.FindChild(com, "BarBg"); GameObject bar2 = Utility.FindChild(com, "BarBg2"); Image componetInChild = Utility.GetComponetInChild <Image>(com, "BarBg/Fore"); Image componetInChild2 = Utility.GetComponetInChild <Image>(com, "BarBg2/Fore"); if (this.zhaoMuZheBarWidth1 == 0f && componetInChild != null) { this.zhaoMuZheBarWidth1 = componetInChild.get_rectTransform().sizeDelta.x; } if (this.zhaoMuZheBarWidth2 == 0f && componetInChild2 != null) { this.zhaoMuZheBarWidth2 = componetInChild2.get_rectTransform().sizeDelta.x; } if (info.userInfo != null) { com.transform.FindChild("user/hasData").gameObject.CustomSetActive(true); com.transform.FindChild("user/null").gameObject.CustomSetActive(false); com.transform.FindChild("user/hasData/Level").gameObject.CustomSetActive(true); CUIHttpImageScript component = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>(); UT.SetHttpImage(component, info.userInfo.szHeadUrl); Text component2 = com.transform.FindChild("user/hasData/Level").GetComponent <Text>(); component2.set_text(string.Format("Lv.{0}", info.userInfo.dwPvpLvl)); GameObject gameObject = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage/NobeIcon").gameObject; if (gameObject) { MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject.GetComponent <Image>(), (int)info.userInfo.stGameVip.dwCurLevel, false, true, 0uL); } Text component3 = com.transform.FindChild("user/hasData/NameGroup/Name").GetComponent <Text>(); string text = UT.Bytes2String(info.userInfo.szUserName); if (component3 != null) { component3.set_text(text); } GameObject gameObject2 = com.transform.FindChild("user/hasData/NameGroup/Gender").gameObject; FriendShower.ShowGender(gameObject2, (COM_SNSGENDER)info.userInfo.bGender); } else { com.transform.FindChild("user/hasData").gameObject.CustomSetActive(false); com.transform.FindChild("user/null").gameObject.CustomSetActive(true); } float num = 1000f; float num2 = -1f; CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath); int num3 = Math.Min(this.zhaomuzheRewardCount, info.RewardList.Count); for (int i = 0; i < num3; i++) { Transform transform = com.transform.FindChild(string.Format("reward_{0}", i)); DebugHelper.Assert(transform != null, "rewardNodeTS not null..."); if (!(transform == null)) { CFriendRecruit.RecruitReward recruitReward = info.RewardList[i]; ResRecruitmentReward cfgReward = Singleton <CFriendContoller> .instance.model.friendRecruit.GetCfgReward(recruitReward.rewardID); if (cfgReward.dwLevel < num) { num = cfgReward.dwLevel; } if (cfgReward.dwLevel > num2) { num2 = cfgReward.dwLevel; } this.Show_Award(transform.gameObject, info.ullUid, info.dwLogicWorldId, COM_RECRUITMENT_TYPE.COM_RECRUITMENT_ACTIVE, recruitReward.rewardID, cfgReward, recruitReward.state, form, true); } } GameObject gameObject3 = Utility.FindChild(com, "cup"); this.ShowCup(gameObject3, info.IsGetAllReward(), 0); if (info.userInfo != null) { this.SetCombineBar(bar, bar2, this.zhaoMuZheBarWidth1, this.zhaoMuZheBarWidth2, info.userInfo.dwPvpLvl, num, num2); } else { this.SetBarSize(componetInChild, 0f, 0f); this.SetBarSize(componetInChild2, 0f, 0f); } }
private void Show_BeiZhouMoZhe_Reward() { if (this.zhaomu_content == null || this.beizhaomu_content == null) { return; } this.zhaomu_content.CustomSetActive(false); this.beizhaomu_content.CustomSetActive(true); CFriendRecruit friendRecruit = Singleton <CFriendContoller> .instance.model.friendRecruit; Text component = this.beizhaomu_content.transform.FindChild("info/text").GetComponent <Text>(); Text component2 = this.beizhaomu_content.transform.FindChild("info/benift/exp/icon/txt").GetComponent <Text>(); Text component3 = this.beizhaomu_content.transform.FindChild("info/benift/gold/icon/txt").GetComponent <Text>(); if (component2 != null) { component2.set_text(string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardExp())); } if (component3 != null) { component3.set_text(string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardGold())); } GameObject gameObject = this.beizhaomu_content.transform.FindChild("info/user").gameObject; gameObject.CustomSetActive(true); GameObject gameObject2 = gameObject.transform.FindChild("default").gameObject; gameObject2.GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_User_DefalutTxt")); this.beizhaomu_content.transform.FindChild("info/reward/title/Text").GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_RewardTip")); GameObject gameObject3 = gameObject.transform.FindChild("NameGroup").gameObject; CFriendRecruit.RecruitData beiZhaoMuZhe = friendRecruit.GetBeiZhaoMuZhe(); Text component4 = gameObject.transform.FindChild("Level").GetComponent <Text>(); if (beiZhaoMuZhe.userInfo == null) { component.set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_Role_NoData")); gameObject2.CustomSetActive(true); gameObject3.CustomSetActive(false); component4.gameObject.CustomSetActive(false); } else { component.set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_Role_HasData")); gameObject2.CustomSetActive(false); gameObject3.CustomSetActive(true); component4.gameObject.CustomSetActive(true); CUIHttpImageScript component5 = gameObject.transform.FindChild("pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>(); UT.SetHttpImage(component5, beiZhaoMuZhe.userInfo.szHeadUrl); component4.set_text(string.Format("Lv.{0}", beiZhaoMuZhe.userInfo.dwPvpLvl)); GameObject gameObject4 = gameObject.transform.FindChild("pnlSnsHead/HttpImage/NobeIcon").gameObject; if (gameObject4) { MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject4.GetComponent <Image>(), (int)beiZhaoMuZhe.userInfo.stGameVip.dwCurLevel, false, true, 0uL); } Text component6 = gameObject.transform.FindChild("NameGroup/Name").GetComponent <Text>(); string text = UT.Bytes2String(beiZhaoMuZhe.userInfo.szUserName); if (component6 != null) { component6.set_text(text); } GameObject gameObject5 = gameObject.transform.FindChild("NameGroup/Gender").gameObject; FriendShower.ShowGender(gameObject5, (COM_SNSGENDER)beiZhaoMuZhe.userInfo.bGender); } CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath); GameObject gameObject6 = this.beizhaomu_content.transform.FindChild("info/reward").gameObject; CFriendRecruit.RecruitData beiZhaoMuZhe2 = friendRecruit.GetBeiZhaoMuZhe(); ulong ullUid = beiZhaoMuZhe2.ullUid; uint dwLogicWorldId = beiZhaoMuZhe2.dwLogicWorldId; int num = Math.Min(4, beiZhaoMuZhe2.RewardList.Count); float num2 = 1000f; float num3 = -1f; for (int i = 0; i < num; i++) { CFriendRecruit.RecruitReward recruitReward = beiZhaoMuZhe2.RewardList[i]; GameObject gameObject7 = gameObject6.transform.FindChild(string.Format("reward_{0}", i)).gameObject; ResRecruitmentReward cfgReward = Singleton <CFriendContoller> .instance.model.friendRecruit.GetCfgReward(recruitReward.rewardID); if (cfgReward.dwLevel < num2 && cfgReward.dwLevel != 1u) { num2 = cfgReward.dwLevel; } if (cfgReward.dwLevel > num3) { num3 = cfgReward.dwLevel; } this.Show_Award(gameObject7, ullUid, dwLogicWorldId, COM_RECRUITMENT_TYPE.COM_RECRUITMENT_PASSIVE, recruitReward.rewardID, cfgReward, recruitReward.state, form, true); } GameObject gameObject8 = Utility.FindChild(this.beizhaomu_content, "info/reward/BarBg"); GameObject gameObject9 = Utility.FindChild(this.beizhaomu_content, "info/reward/BarBg2"); Image componetInChild = Utility.GetComponetInChild <Image>(gameObject8, "Fore"); Image componetInChild2 = Utility.GetComponetInChild <Image>(gameObject9, "Fore"); if (this.beiZhaoMuZheBarWidth1 == 0f && componetInChild != null) { this.beiZhaoMuZheBarWidth1 = componetInChild.get_rectTransform().sizeDelta.x; } if (this.beiZhaoMuZheBarWidth2 == 0f && componetInChild2 != null) { this.beiZhaoMuZheBarWidth2 = componetInChild2.get_rectTransform().sizeDelta.x; } if (beiZhaoMuZhe.userInfo != null) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); this.SetCombineBar(gameObject8, gameObject9, this.beiZhaoMuZheBarWidth1, this.beiZhaoMuZheBarWidth2, masterRoleInfo.PvpLevel, num2, num3); } else { this.SetBarSize(componetInChild, 0f, 0f); this.SetBarSize(componetInChild2, 0f, 0f); } }
private void Show_BeiZhouMoZhe_Reward() { if (this.zhaomu_content == null || this.beizhaomu_content == null) { return; } this.zhaomu_content.CustomSetActive(false); this.beizhaomu_content.CustomSetActive(true); CFriendRecruit friendRecruit = Singleton <CFriendContoller> .get_instance().model.friendRecruit; Text component = this.beizhaomu_content.transform.FindChild("info/text").GetComponent <Text>(); Text component2 = this.beizhaomu_content.transform.FindChild("info/benift/exp/icon/txt").GetComponent <Text>(); Text component3 = this.beizhaomu_content.transform.FindChild("info/benift/gold/icon/txt").GetComponent <Text>(); if (component2 != null) { component2.text = string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardExp()); } if (component3 != null) { component3.text = string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardGold()); } GameObject gameObject = this.beizhaomu_content.transform.FindChild("info/user").gameObject; gameObject.CustomSetActive(true); GameObject gameObject2 = gameObject.transform.FindChild("default").gameObject; gameObject2.GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Friend_Rec_Bei_User_DefalutTxt"); this.beizhaomu_content.transform.FindChild("info/reward/title/Text").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Friend_Rec_Bei_RewardTip"); GameObject gameObject3 = gameObject.transform.FindChild("NameGroup").gameObject; CFriendRecruit.RecruitData beiZhaoMuZhe = friendRecruit.GetBeiZhaoMuZhe(); Text component4 = gameObject.transform.FindChild("Level").GetComponent <Text>(); if (beiZhaoMuZhe.userInfo == null) { component.text = Singleton <CTextManager> .get_instance().GetText("Friend_Rec_Bei_Role_NoData"); gameObject2.CustomSetActive(true); gameObject3.CustomSetActive(false); component4.gameObject.CustomSetActive(false); } else { component.text = Singleton <CTextManager> .get_instance().GetText("Friend_Rec_Bei_Role_HasData"); gameObject2.CustomSetActive(false); gameObject3.CustomSetActive(true); component4.gameObject.CustomSetActive(true); CUIHttpImageScript component5 = gameObject.transform.FindChild("pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>(); UT.SetHttpImage(component5, beiZhaoMuZhe.userInfo.szHeadUrl); component4.text = string.Format("Lv.{0}", beiZhaoMuZhe.userInfo.dwPvpLvl); GameObject gameObject4 = gameObject.transform.FindChild("pnlSnsHead/HttpImage/NobeIcon").gameObject; if (gameObject4) { MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject4.GetComponent <Image>(), (int)beiZhaoMuZhe.userInfo.stGameVip.dwCurLevel, false); } Text component6 = gameObject.transform.FindChild("NameGroup/Name").GetComponent <Text>(); string text = UT.Bytes2String(beiZhaoMuZhe.userInfo.szUserName); if (component6 != null) { component6.text = text; } GameObject gameObject5 = gameObject.transform.FindChild("NameGroup/Gender").gameObject; FriendShower.ShowGender(gameObject5, beiZhaoMuZhe.userInfo.bGender); } CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath); GameObject gameObject6 = this.beizhaomu_content.transform.FindChild("info/reward").gameObject; CFriendRecruit.RecruitData beiZhaoMuZhe2 = friendRecruit.GetBeiZhaoMuZhe(); ulong ullUid = beiZhaoMuZhe2.ullUid; uint dwLogicWorldId = beiZhaoMuZhe2.dwLogicWorldId; int num = Math.Min(4, beiZhaoMuZhe2.RewardList.get_Count()); for (int i = 0; i < num; i++) { CFriendRecruit.RecruitReward recruitReward = beiZhaoMuZhe2.RewardList.get_Item(i); GameObject gameObject7 = gameObject6.transform.FindChild(string.Format("reward_{0}", i)).gameObject; this.Show_Award(gameObject7, ullUid, dwLogicWorldId, 2, recruitReward.rewardID, recruitReward.state, form, true); } }