private void OnClick_Exit(GameObject obj = null)
 {
     CtrlManager.ShowMsgBox("确认退出", "是否要退出战斗回放?", delegate(bool _isConfirm)
     {
         if (_isConfirm)
         {
             GameManager.Instance.ReplayController.EndReplay();
         }
     }, PopViewType.PopTwoButton, "确定", "取消", null);
 }
Ejemplo n.º 2
0
        private List <string> GetData(List <string> allData, heroDataType type)
        {
            List <string> list = new List <string>();

            foreach (string current in Singleton <PvpManager> .Instance.freeHeros)
            {
                try
                {
                    list.Add(current.Split(new char[]
                    {
                        ','
                    })[0]);
                }
                catch (Exception ex)
                {
                    CtrlManager.ShowMsgBox(ex.ToString(), this.ToString() + "解析限免英雄数组时报错,检查代码", delegate
                    {
                    }, PopViewType.PopOneButton, "确定", "取消", null);
                }
            }
            if (allData == null || allData.Count == 0)
            {
                return(new List <string>());
            }
            List <string> list2 = new List <string>();

            switch (type)
            {
            case heroDataType.Owned:
                list2 = this.GetTypeData(CharacterDataMgr.instance.OwenHeros, allData);
                break;

            case heroDataType.Non_Owned:
                if (CharacterDataMgr.instance.AllNoHaveHeros != null && CharacterDataMgr.instance.AllCanCallHeros != null)
                {
                    list2 = this.GetTypeData(CharacterDataMgr.instance.AllNoHaveHeros, allData).Except(this.GetTypeData(list, allData)).ToList <string>();
                }
                break;

            case heroDataType.Free:
                list2 = this.GetTypeData(list, allData).Except(this.GetTypeData(CharacterDataMgr.instance.OwenHeros, allData)).ToList <string>();
                break;
            }
            List <string> list3 = new List <string>();

            for (int i = 0; i < list2.Count; i++)
            {
                list3.Add(list2[list2.Count - i - 1]);
            }
            return(list3);
        }
 private void OnClickExitGame(GameObject obj = null)
 {
     if (GlobalSettings.isLoginByHoolaiSDK)
     {
         InitSDK.instance.SDKExit();
     }
     else if (GlobalSettings.isLoginByAnySDK)
     {
         InitSDK.instance.AnySDKExit(true);
     }
     else
     {
         CtrlManager.ShowMsgBox(LanguageManager.Instance.GetStringById("SystemSettingUI_Close01", "确认退出"), LanguageManager.Instance.GetStringById("SystemSettingUI_Close02", "确定退出刺激好玩的《魔霸英雄》吗?"), new Action <bool>(this.ExitCall), PopViewType.PopTwoButton, "确定", "取消", null);
     }
 }
Ejemplo n.º 4
0
 private void LoginGame(GameObject objct_1 = null)
 {
     if (string.IsNullOrEmpty(this.Account.value) || (this.Account.value.Length != 11 && !Application.isEditor))
     {
         this.ShowWarn(3);
         CtrlManager.ShowMsgBox((!(LanguageManager.Instance.GetStringById("LoginUI_Title_LoginError") != string.Empty)) ? "登录错误" : LanguageManager.Instance.GetStringById("LoginUI_Title_LoginError"), (!(LanguageManager.Instance.GetStringById("LoginUI_Content_LoginError1") != string.Empty)) ? "请输入11位的手机号" : LanguageManager.Instance.GetStringById("LoginUI_Content_LoginError1"), new Action(this.LoginNameIsWrong), PopViewType.PopOneButton, "确定", "取消", null);
     }
     else if ((this.Account.value != null && string.IsNullOrEmpty(this.PIN.value)) || this.PIN.value.Length < 6)
     {
         CtrlManager.ShowMsgBox((!(LanguageManager.Instance.GetStringById("LoginUI_Title_LoginError") != string.Empty)) ? "登录错误" : LanguageManager.Instance.GetStringById("LoginUI_Title_LoginError"), (!(LanguageManager.Instance.GetStringById("LoginUI_Content_LoginError2") != string.Empty)) ? "请输入和账号对应的6-12位密码" : LanguageManager.Instance.GetStringById("LoginUI_Content_LoginError2"), new Action(this.LoginPINIsWrong), PopViewType.PopOneButton, "确定", "取消", null);
     }
     else if (this.Account.value != null && this.PIN.value != null && this.Account.value != string.Empty && this.PIN.value != string.Empty)
     {
         this.LoginServer(this.Account.value, this.PIN.value, 2);
     }
 }
Ejemplo n.º 5
0
        private void Name_CertainOrCancel_Event(GameObject object_1)
        {
            if (object_1 == this.Name_Cancel.gameObject)
            {
                this.Click_BG(null);
            }
            else
            {
                string value = this.Name_Input.value;
                if (string.IsNullOrEmpty(value))
                {
                    Singleton <TipView> .Instance.ShowViewSetText(LanguageManager.Instance.GetStringById("SummonerUI_Passport_Tips_NameCannotBeEmpty"), 1f);

                    return;
                }
                if (value.Length > 7)
                {
                    Singleton <TipView> .Instance.ShowViewSetText(LanguageManager.Instance.GetStringById("SummonerUI_Passport_Tips_NameOverLength"), 1f);
                }
                else if (string.IsNullOrEmpty(value))
                {
                    Singleton <TipView> .Instance.ShowViewSetText(LanguageManager.Instance.GetStringById("SummonerUI_Passport_Tips_NameCannotBeEmpty"), 1f);
                }
                else
                {
                    if (value.Contains("*"))
                    {
                        Singleton <TipView> .Instance.ShowViewSetText(LanguageManager.Instance.GetStringById("SummonerUI_Passport_Tips_IllegalCharacter"), 1f);

                        return;
                    }
                    int num = ModelManager.Instance.Get_userData_filed_X("ChangNickNameCount");
                    if (num < 1)
                    {
                        SendMsgManager.SendMsgParam param = new SendMsgManager.SendMsgParam(true, LanguageManager.Instance.GetStringById("SummonerUI_Passport_Tips_RefreshData"), true, 15f);
                        SendMsgManager.Instance.SendMsg(MobaGameCode.MagicBottleItem, param, new object[]
                        {
                            value
                        });
                    }
                    else
                    {
                        CtrlManager.ShowMsgBox(LanguageManager.Instance.GetStringById("SummonerUI_Passport_ChangeNickname"), LanguageManager.Instance.GetStringById("SummonerUI_Passport_ChangeNicknameCost"), new Action <bool>(this.ChangeNameCallBack), PopViewType.PopTwoButton, "确定", "取消", null);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private void ChangeNameOrNot_Event(GameObject obj = null)
        {
            List <EquipmentInfoData> list = ModelManager.Instance.Get_equipmentList_X();

            if (list.Find((EquipmentInfoData data) => data.ModelId == 6666) == null)
            {
                CtrlManager.ShowMsgBox("提示", LanguageManager.Instance.GetStringById("SummonerUI_Passport_Tips_MissingNameCard"), new Action <bool>(this.AddPassportCallback), PopViewType.PopTwoButton, "确定", "取消", null);
            }
            else if (list.Find((EquipmentInfoData data) => data.ModelId == 6666).Count >= 1)
            {
                string text = this.Name_Input.value.Replace("\n", string.Empty).Replace(" ", string.Empty).Replace("\t", string.Empty).Replace("\r", string.Empty);
                SendMsgManager.SendMsgParam param = new SendMsgManager.SendMsgParam(true, LanguageManager.Instance.GetStringById("SummonerUI_Passport_Tips_RefreshData"), true, 15f);
                SendMsgManager.Instance.SendMsg(MobaGameCode.MagicBottleItem, param, new object[]
                {
                    text
                });
            }
        }
Ejemplo n.º 7
0
        private void InitBtnObject()
        {
            Dictionary <int, AreaInfo> dictionary = ModelManager.Instance.Get_AreaList_X();

            if (dictionary.Count == 0)
            {
                ClientLogger.Error("没收到服务器数据");
                CtrlManager.ShowMsgBox("错误", "无法获得服务器列表,请稍后再试", new Action(this.ExitGameCall), PopViewType.PopOneButton, "确定", "取消", null);
            }
            this.mBtnGridControllers.Clear();
            foreach (KeyValuePair <int, AreaInfo> current in dictionary)
            {
                GameObject gameObject = NGUITools.AddChild(this.mServerListGrid.gameObject, this.mBtnCache);
                gameObject.SetActive(true);
                AreaButtonCtrl component = gameObject.GetComponent <AreaButtonCtrl>();
                component.BindingAreaInfo(current.Value);
                this.mBtnGridControllers.Add(component);
            }
            this.mServerListGrid.Reposition();
        }
Ejemplo n.º 8
0
 private void clickRegistration(GameObject objct_1 = null)
 {
     if (this.YourUserNameLabel.text == string.Empty || this.YourUserNameLabel.text == "请输入预约的手机号" || this.YourUserNameLabel.text.Length < 6)
     {
         this.ShowSetPassWord(false);
         CtrlManager.ShowMsgBox("注册失败", "请输入一个6-12位数字或字母组成的账号", new Action(this.RegistNameIsWrong), PopViewType.PopOneButton, "确定", "取消", null);
     }
     else if (string.IsNullOrEmpty(this.RegistrationPIN.value) || this.RegistrationPIN.value.Length < 6)
     {
         CtrlManager.ShowMsgBox("注册失败", "请输入一个6-12位数字或字母组成的密码", new Action(this.RegistPasswordIsWrong1), PopViewType.PopOneButton, "确定", "取消", null);
         this.ShowWarn(5);
     }
     else if (this.RegistrationPIN.value != this.PINAgain.value)
     {
         CtrlManager.ShowMsgBox("注册失败", "请保证两次输入的密码完全相同", new Action(this.RegistPasswordIsWrong2), PopViewType.PopOneButton, "确定", "取消", null);
         this.ShowWarn(6);
     }
     else
     {
         string text  = this.YourUserNameLabel.text;
         string value = this.RegistrationPIN.value;
         if (!this.isForgetMode)
         {
             this.LoginServer(text, value, 3);
         }
         else
         {
             SendMsgManager.SendMsgParam param = new SendMsgManager.SendMsgParam(false, "正在修改密码...", true, 15f);
             SendMsgManager.Instance.SendMsg(MobaMasterCode.ModifyAccountPasswd, param, new object[]
             {
                 text,
                 this.RegistrationPIN.value
             });
         }
     }
 }
Ejemplo n.º 9
0
 private void Click_CharmRule(GameObject obj = null)
 {
     CtrlManager.ShowMsgBox("如何获得魅力值?", "[EC3A76]魅力值[-]来自你获得与穿戴的皮肤、宠物、特效等,每赛季结束时结算排名,根据排名获得奖励。", delegate
     {
     }, PopViewType.PopOneButton, "我知道了", "取消", null);
 }
Ejemplo n.º 10
0
 private void OnClickLogout(GameObject obj = null)
 {
     CtrlManager.ShowMsgBox(LanguageManager.Instance.GetStringById("SystemSettingUI_Exit01", "确认登出"), LanguageManager.Instance.GetStringById("SystemSettingUI_Exit02", "确定重启游戏以更换账号吗?"), new Action <bool>(this.LogoutCall), PopViewType.PopTwoButton, "确定", "取消", null);
 }
Ejemplo n.º 11
0
        public static void GotoWindow(int i)
        {
            switch (i)
            {
            case 1:
                if (Singleton <UIPvpEntranceCtrl> .Instance.IsOpen)
                {
                    CtrlManager.CloseWindow(WindowID.PvpEntranceView);
                }
                if (!Singleton <ArenaModeView> .Instance.IsOpen)
                {
                    CtrlManager.OpenWindow(WindowID.MenuView, null);
                }
                CtrlManager.CloseWindow(WindowID.TaskView);
                CtrlManager.CloseWindow(WindowID.DailyView);
                CtrlManager.OpenWindow(WindowID.ArenaModeView, null);
                break;

            case 2:
                if (!Singleton <ArenaModeView> .Instance.IsOpen)
                {
                    CtrlManager.OpenWindow(WindowID.MenuView, null);
                }
                CtrlManager.CloseWindow(WindowID.TaskView);
                CtrlManager.CloseWindow(WindowID.DailyView);
                CtrlManager.OpenWindow(WindowID.ArenaModeView, null);
                Singleton <ArenaModeView> .Instance.TravalClick(2);

                break;

            case 3:
            {
                long exp               = ModelManager.Instance.Get_userData_X().Exp;
                int  userLevel         = CharacterDataMgr.instance.GetUserLevel(exp);
                int  scene_limit_level = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>("80006").scene_limit_level;
                bool flag              = userLevel >= scene_limit_level;
                if (flag)
                {
                    if (Singleton <UIPvpEntranceCtrl> .Instance.IsOpen)
                    {
                        CtrlManager.CloseWindow(WindowID.PvpEntranceView);
                    }
                    if (!Singleton <ArenaModeView> .Instance.IsOpen)
                    {
                        CtrlManager.OpenWindow(WindowID.MenuView, null);
                    }
                    CtrlManager.CloseWindow(WindowID.TaskView);
                    CtrlManager.CloseWindow(WindowID.DailyView);
                    CtrlManager.OpenWindow(WindowID.ArenaModeView, null);
                    Singleton <ArenaModeView> .Instance.TravalClick(3);
                }
                else
                {
                    CtrlManager.ShowMsgBox("提示", string.Format("等级不足,{0}级才能前往", scene_limit_level), delegate
                        {
                        }, PopViewType.PopOneButton, "确定", "取消", null);
                }
                break;
            }

            case 4:
            {
                long exp2               = ModelManager.Instance.Get_userData_X().Exp;
                int  userLevel2         = CharacterDataMgr.instance.GetUserLevel(exp2);
                int  scene_limit_level2 = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>("80021").scene_limit_level;
                bool flag2              = userLevel2 >= scene_limit_level2;
                if (flag2)
                {
                    if (!Singleton <ArenaModeView> .Instance.IsOpen)
                    {
                        CtrlManager.OpenWindow(WindowID.MenuView, null);
                    }
                    CtrlManager.CloseWindow(WindowID.TaskView);
                    CtrlManager.CloseWindow(WindowID.DailyView);
                    CtrlManager.OpenWindow(WindowID.ArenaModeView, null);
                    Singleton <ArenaModeView> .Instance.TravalClick(4);
                }
                else
                {
                    CtrlManager.ShowMsgBox("提示", string.Format("等级不足,{0}级才能前往", scene_limit_level2), delegate
                        {
                        }, PopViewType.PopOneButton, "确定", "取消", null);
                }
                break;
            }

            case 5:
                if (!Singleton <ArenaModeView> .Instance.IsOpen)
                {
                    CtrlManager.OpenWindow(WindowID.MenuView, null);
                }
                CtrlManager.CloseWindow(WindowID.TaskView);
                CtrlManager.CloseWindow(WindowID.DailyView);
                CtrlManager.OpenWindow(WindowID.ArenaModeView, null);
                Singleton <ArenaModeView> .Instance.TravalClick(5);

                break;

            case 6:
                if (!Singleton <ArenaModeView> .Instance.IsOpen)
                {
                    CtrlManager.OpenWindow(WindowID.MenuView, null);
                }
                CtrlManager.CloseWindow(WindowID.TaskView);
                CtrlManager.CloseWindow(WindowID.DailyView);
                CtrlManager.OpenWindow(WindowID.ArenaModeView, null);
                Singleton <ArenaModeView> .Instance.TravalClick(6);

                break;

            case 7:
                if (!Singleton <ArenaModeView> .Instance.IsOpen)
                {
                    CtrlManager.OpenWindow(WindowID.MenuView, null);
                }
                CtrlManager.CloseWindow(WindowID.TaskView);
                CtrlManager.CloseWindow(WindowID.DailyView);
                CtrlManager.OpenWindow(WindowID.ArenaModeView, null);
                Singleton <ArenaModeView> .Instance.TravalClick(7);

                break;

            case 8:
                MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemOpenView, null, false);
                break;

            case 9:
                CtrlManager.OpenWindow(WindowID.GoldHandView, null);
                break;

            case 10:
                if (CharacterDataMgr.instance.OwenHeros.Count > 0)
                {
                    CtrlManager.OpenWindow(WindowID.PropertyView, null);
                    MobaMessageManagerTools.SendClientMsg(ClientV2C.sacriviewChangeHero, CharacterDataMgr.instance.OwenHeros[0], false);
                    MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewInitToggle, PropertyType.Rune, false);
                }
                else
                {
                    Singleton <TipView> .Instance.ShowViewSetText("当前没有已拥有的英雄,无法完成此任务", 1f);
                }
                break;

            case 11:
                CtrlManager.OpenWindow(WindowID.SignView, null);
                break;
            }
        }