Example #1
0
 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);
 }
Example #2
0
 public ResRecruitmentReward GetCfgReward(ushort rewardID)
 {
     for (int i = 0; i < this.m_rewardConfig.get_Count(); i++)
     {
         ResRecruitmentReward resRecruitmentReward = this.m_rewardConfig.get_Item(i);
         if (resRecruitmentReward.wID == rewardID)
         {
             return(resRecruitmentReward);
         }
     }
     return(null);
 }
        private void Show_ZhouMoZhe_Reward()
        {
            CFriendRecruit friendRecruit = Singleton <CFriendContoller> .instance.model.friendRecruit;

            if (this.zm_benifit_exp != null)
            {
                this.zm_benifit_exp.set_text(string.Format("+{0}%", friendRecruit.GetZhaoMuZhe_RewardExp()));
            }
            if (this.zm_benifit_gold != null)
            {
                this.zm_benifit_gold.set_text(string.Format("+{0}%", friendRecruit.GetZhaoMuZhe_RewardGold()));
            }
            int    zhaoMuZhe_RewardProgress   = friendRecruit.GetZhaoMuZhe_RewardProgress();
            int    zhaoMuZhe_RewardTotalCount = friendRecruit.GetZhaoMuZhe_RewardTotalCount();
            string text = Singleton <CTextManager> .instance.GetText("Friend_Rec_zmz_whole_Progress", new string[]
            {
                zhaoMuZhe_RewardProgress.ToString(),
                zhaoMuZhe_RewardTotalCount.ToString()
            });

            if (this.zm_totalProgress != null)
            {
                this.zm_totalProgress.set_text(text);
            }
            string text2 = Singleton <CTextManager> .instance.GetText("Friend_Rec_zm_ProgressText", new string[]
            {
                zhaoMuZhe_RewardProgress.ToString(),
                zhaoMuZhe_RewardTotalCount.ToString()
            });

            if (this.zm_ProgressText != null)
            {
                this.zm_ProgressText.set_text(text2);
            }
            for (int i = 0; i < zhaoMuZhe_RewardProgress; i++)
            {
                GameObject gameObject = Utility.FindChild(this.zm_progressNode, string.Format("reward{0}", i));
                this.ShowCup(gameObject, true, i);
            }
            for (int j = zhaoMuZhe_RewardProgress; j < zhaoMuZhe_RewardTotalCount; j++)
            {
                GameObject gameObject2 = Utility.FindChild(this.zm_progressNode, string.Format("reward{0}", j));
                this.ShowCup(gameObject2, false, j);
            }
            ResRecruitmentReward cfgReward = Singleton <CFriendContoller> .instance.model.friendRecruit.GetCfgReward(friendRecruit.SuperReward.rewardID);

            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath);

            this.Show_Award(this.supberRewardNode, 0uL, 0u, COM_RECRUITMENT_TYPE.COM_RECRUITMENT_ACTIVE, friendRecruit.SuperReward.rewardID, cfgReward, friendRecruit.SuperReward.state, form, false);
            this.Refresh_ZhaomuZhe_List();
            this.zhaomu_content.CustomSetActive(true);
            this.beizhaomu_content.CustomSetActive(false);
        }
Example #4
0
        public CUseable GetUsable(ushort id)
        {
            CUseable cUseable = null;

            this.useable_cfg.TryGetValue(id, ref cUseable);
            if (cUseable == null)
            {
                ResRecruitmentReward cfgReward = this.GetCfgReward(id);
                cUseable = CUseableManager.CreateUseable(2, cfgReward.dwRewardID, 0);
                this.useable_cfg.Add(id, cUseable);
            }
            return(cUseable);
        }
        public CUseable GetUsable(ushort id)
        {
            CUseable cUseable = null;

            this.useable_cfg.TryGetValue(id, out cUseable);
            if (cUseable == null)
            {
                ResRecruitmentReward cfgReward = this.GetCfgReward(id);
                cUseable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, cfgReward.dwRewardID, 0);
                this.useable_cfg.Add(id, cUseable);
            }
            return(cUseable);
        }
Example #6
0
 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;
             }
         }
     }
 }
Example #7
0
 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 static void On_Send_INTIMACY_RELATION_REQUEST(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_RECRUITMENT_REWARD_RSP stRecruitmentRewardRsp = msg.stPkgData.stRecruitmentRewardRsp;
            CFriendRecruit       friendRecruit = Singleton <CFriendContoller> .instance.model.friendRecruit;
            ResRecruitmentReward cfgReward     = friendRecruit.GetCfgReward(stRecruitmentRewardRsp.wRecruitRewardId);

            if (cfgReward.bRewardType == 2)
            {
                friendRecruit.SetBITS((RES_RECRUIMENT_BITS)cfgReward.bRewardBit, true);
            }
            CFriendRecruit.RecruitData recruitData = friendRecruit.GetRecruitData(stRecruitmentRewardRsp.stUin.ullUid, stRecruitmentRewardRsp.stUin.dwLogicWorldId);
            recruitData.SetReward(stRecruitmentRewardRsp.wRecruitRewardId, CFriendRecruit.RewardState.Getted);
            if (friendRecruit.SuperReward.rewardID == stRecruitmentRewardRsp.wRecruitRewardId)
            {
                friendRecruit.SuperReward.state = CFriendRecruit.RewardState.Getted;
            }
        }
Example #9
0
        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 Show_Award(GameObject node, ulong ullUid, uint dwLogicWorldId, COM_RECRUITMENT_TYPE type, ushort rewardID, CFriendRecruit.RewardState state, CUIFormScript formScript, bool bShowLevelNum = true)
        {
            Image          component  = node.transform.FindChild("box/icon").GetComponent <Image>();
            CUIEventScript component2 = component.GetComponent <CUIEventScript>();

            component2.m_onDownEventParams.tagUInt            = (uint)rewardID;
            component2.m_onDownEventParams.commonUInt64Param1 = ullUid;
            component2.m_onDownEventParams.taskId             = dwLogicWorldId;
            component2.m_onDownEventParams.weakGuideId        = (uint)type;
            CFriendRecruit friendRecruit = Singleton <CFriendContoller> .get_instance().model.friendRecruit;

            ResRecruitmentReward cfgReward = friendRecruit.GetCfgReward(rewardID);

            if (cfgReward == null)
            {
                return;
            }
            component.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + cfgReward.szIcon, formScript, true, false, false, false);
            if (bShowLevelNum)
            {
                Text component3 = node.transform.FindChild("box/num").GetComponent <Text>();
                component3.text = cfgReward.dwLevel.ToString();
            }
            bool  flag       = state == CFriendRecruit.RewardState.Getted;
            Image component4 = node.transform.FindChild("box/mark").GetComponent <Image>();

            component4.gameObject.CustomSetActive(flag);
            Transform transform = node.transform.FindChild("icon");

            if (transform != null)
            {
                this.ShowBar(transform.gameObject, flag);
            }
            bool       flag2      = state == CFriendRecruit.RewardState.Keling;
            GameObject gameObject = node.transform.FindChild("box/effect").gameObject;

            gameObject.CustomSetActive(flag2);
            node.transform.FindChild("box").GetComponent <Animation>().enabled = flag2;
        }
Example #11
0
 public void Clear()
 {
     this.cfg = null;
 }
Example #12
0
 public RecruitReward(ushort rewardId, CFriendRecruit.RewardState state)
 {
     this.rewardID = rewardId;
     this.state    = state;
     this.cfg      = Singleton <CFriendContoller> .get_instance().model.friendRecruit.GetCfgReward(rewardId);
 }
        public void Show_Award(GameObject node, ulong ullUid, uint dwLogicWorldId, COM_RECRUITMENT_TYPE type, ushort rewardID, ResRecruitmentReward cfg, CFriendRecruit.RewardState state, CUIFormScript formScript, bool bShowLevelNum = true)
        {
            Image          component  = node.transform.FindChild("box/icon").GetComponent <Image>();
            CUIEventScript component2 = component.GetComponent <CUIEventScript>();

            component2.m_onDownEventParams.tagUInt            = (uint)rewardID;
            component2.m_onDownEventParams.commonUInt64Param1 = ullUid;
            component2.m_onDownEventParams.taskId             = dwLogicWorldId;
            component2.m_onDownEventParams.weakGuideId        = (uint)((byte)type);
            if (cfg == null)
            {
                return;
            }
            component.SetSprite(CUIUtility.s_Sprite_Dynamic_Icon_Dir + cfg.szIcon, formScript, true, false, false, false);
            if (bShowLevelNum)
            {
                Text component3 = node.transform.FindChild("box/num").GetComponent <Text>();
                if (cfg.dwLevel == 1u)
                {
                    component3.set_text(Singleton <CTextManager> .instance.GetText("Recruit_Login"));
                }
                else
                {
                    component3.set_text(string.Format("Lv.{0}", cfg.dwLevel));
                }
            }
            bool  bActive    = state == CFriendRecruit.RewardState.Getted;
            Image component4 = node.transform.FindChild("box/mark").GetComponent <Image>();

            component4.gameObject.CustomSetActive(bActive);
            GameObject obj = Utility.FindChild(node, "BaoShi");

            obj.CustomSetActive(state == CFriendRecruit.RewardState.Getted || state == CFriendRecruit.RewardState.Keling);
            bool       flag       = state == CFriendRecruit.RewardState.Keling;
            GameObject gameObject = node.transform.FindChild("box/effect").gameObject;

            gameObject.CustomSetActive(flag);
            node.transform.FindChild("box").GetComponent <Animation>().enabled = flag;
        }
        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);
            }
        }