Ejemplo n.º 1
0
        private static void SetMopupTenEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum)
        {
            Button          component          = Mopup.GetComponent <Button>();
            CUIEventScript  component2         = component.gameObject.GetComponent <CUIEventScript>();
            stUIEventParams onClickEventParams = default(stUIEventParams);
            bool            isEnable;

            if (difficulty == 1)
            {
                Text componetInChild = Utility.GetComponetInChild <Text>(Mopup, "Text");
                componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[]
                {
                    "10"
                });

                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip());
                onClickEventParams.tag          = 10;
                component2.m_onClickEventParams = onClickEventParams;
            }
            else
            {
                if (difficulty != 2)
                {
                    DebugHelper.Assert(false, "Invalid difficulty -- {0}", new object[]
                    {
                        difficulty
                    });
                    return;
                }
                Text componetInChild2 = Utility.GetComponetInChild <Text>(Mopup, "Text");
                if (LeftPlayNum > 0)
                {
                    componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[]
                    {
                        LeftPlayNum.ToString()
                    });
                }
                else
                {
                    componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Can_Not_Sweep");
                }
                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip() && LeftPlayNum > 0);
                onClickEventParams.tag          = LeftPlayNum;
                component2.m_onClickEventParams = onClickEventParams;
            }
            CUICommonSystem.SetButtonEnable(component, isEnable, true, true);
        }
    protected override string Execute(string[] InArguments, ref CSDT_CHEATCMD_DETAIL CheatCmdRef)
    {
        int           Chapter       = CheatCommandBase.SmartConvert <int>(InArguments[0]);
        int           No            = CheatCommandBase.SmartConvert <int>(InArguments[1]);
        ELevelTypeTag eLevelTypeTag = CheatCommandBase.SmartConvert <ELevelTypeTag>(InArguments[2]);

        CheatCmdRef.stUnlockLevel = new CSDT_CHEAT_UNLOCK_LEVEL();
        RES_LEVEL_DIFFICULTY_TYPE DiffType        = (eLevelTypeTag == ELevelTypeTag.普通) ? RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NORMAL : RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NIGHTMARE;
        ResLevelCfgInfo           resLevelCfgInfo = GameDataMgr.levelDatabin.FindIf((ResLevelCfgInfo x) => x.iChapterId == Chapter && (int)x.bLevelNo == No && x.bLevelDifficulty == (byte)DiffType);

        if (resLevelCfgInfo != null)
        {
            CheatCmdRef.stUnlockLevel.iLevelID = resLevelCfgInfo.iCfgID;
            return(CheatCommandBase.Done);
        }
        return(string.Format("未找到 {2} {0}-{1}对应地图配置", Chapter, No, eLevelTypeTag.ToString()));
    }
Ejemplo n.º 3
0
        private static void SetMopupEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum)
        {
            Button component = Mopup.GetComponent <Button>();
            bool   isEnable  = false;

            if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NORMAL)
            {
                isEnable = CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL;
            }
            else if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NIGHTMARE)
            {
                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && (LeftPlayNum > 0);
            }
            else
            {
                object[] inParameters = new object[] { difficulty };
                DebugHelper.Assert(false, "Invalid difficulty -- {0}", inParameters);
                return;
            }
            CUICommonSystem.SetButtonEnable(component, isEnable, true, true);
        }
Ejemplo n.º 4
0
        private static void SetMopupTenEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum)
        {
            Button          component = Mopup.GetComponent <Button>();
            bool            isEnable  = false;
            CUIEventScript  script    = component.gameObject.GetComponent <CUIEventScript>();
            stUIEventParams @params   = new stUIEventParams();

            if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NORMAL)
            {
                string[] args = new string[] { "10" };
                Utility.GetComponetInChild <Text>(Mopup, "Text").text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", args);

                isEnable    = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && isVip();
                @params.tag = 10;
                script.m_onClickEventParams = @params;
            }
            else if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NIGHTMARE)
            {
                Text componetInChild = Utility.GetComponetInChild <Text>(Mopup, "Text");
                if (LeftPlayNum > 0)
                {
                    string[] textArray2 = new string[] { LeftPlayNum.ToString() };
                    componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", textArray2);
                }
                else
                {
                    componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Can_Not_Sweep");
                }
                isEnable    = ((CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && isVip()) && (LeftPlayNum > 0);
                @params.tag = LeftPlayNum;
                script.m_onClickEventParams = @params;
            }
            else
            {
                object[] inParameters = new object[] { difficulty };
                DebugHelper.Assert(false, "Invalid difficulty -- {0}", inParameters);
                return;
            }
            CUICommonSystem.SetButtonEnable(component, isEnable, true, true);
        }
Ejemplo n.º 5
0
        private static void SetMopupEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum)
        {
            Button component = Mopup.GetComponent <Button>();
            bool   isEnable;

            if (difficulty == 1)
            {
                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL);
            }
            else
            {
                if (difficulty != 2)
                {
                    DebugHelper.Assert(false, "Invalid difficulty -- {0}", new object[]
                    {
                        difficulty
                    });
                    return;
                }
                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && LeftPlayNum > 0);
            }
            CUICommonSystem.SetButtonEnable(component, isEnable, true, true);
        }