private void OnClick_Exit(GameObject obj = null) { CtrlManager.ShowMsgBox("确认退出", "是否要退出战斗回放?", delegate(bool _isConfirm) { if (_isConfirm) { GameManager.Instance.ReplayController.EndReplay(); } }, PopViewType.PopTwoButton, "确定", "取消", null); }
private void DoPopView(PopViewParam param) { CtrlManager.OpenWindow(WindowID.NewPopView, null); NewPopView ctrl = CtrlManager.GetCtrl <NewPopView>(WindowID.NewPopView); if (ctrl != null) { ctrl.SetParam(param); } }
public void CloseViewClick(GameObject obj) { if (this.canClick) { this.canClick = false; CtrlManager.CloseWindow(WindowID.UnlockView); this.text_str = string.Empty; this.CheckShowType(); } }
private void TryShow() { if (Singleton <CharacterView> .Instance == null) { CtrlManager.OpenWindow(WindowID.CharacterView, null); } if (this.gameObject == null) { CtrlManager.OpenWindow(WindowID.CharacterView, null); } }
private void GoToSign(GameObject go) { if (this.CanJumpToSign()) { CtrlManager.OpenWindow(WindowID.SignView, null); } else { Singleton <TipView> .Instance.ShowViewSetText("暂未开放", 1f); } }
private void CheckShowType() { if (this.showType == 2 && this.showIndex < this.infoList.Count - 1) { this.showIndex++; this.text_str = this.infoList[this.showIndex][0]; this.effectId = this.infoList[this.showIndex][1]; this.canClick = true; CtrlManager.OpenWindow(WindowID.UnlockView, null); } }
public override void Init() { base.Init(); this._components = this.uiWindow.GetComponent <ObserveViewComponents>(); UIEventListener.Get(this._components.Background).onDragStart = new UIEventListener.VoidDelegate(this.OnDragStart); UIEventListener.Get(this._components.Background).onDragEnd = new UIEventListener.VoidDelegate(this.OnDragEnd); UIEventListener.Get(this._components.Background).onDrag = new UIEventListener.VectorDelegate(this.OnDrag); UIEventListener.Get(this._components.BtnSettings.gameObject).onClick = delegate { CtrlManager.OpenWindow(WindowID.ReturnView, null); }; }
private void AddDiamond(GameObject objct_1 = null) { if (!Singleton <ShopView> .Instance.IsOpen) { Singleton <ShopView> .Instance.ThroughShop = ETypicalShop.Recharge; CtrlManager.OpenWindow(WindowID.ShopViewNew, null); CtrlManager.CloseWindow(WindowID.MenuBottomBarView); } else { Singleton <ShopView> .Instance.SetShopType(6); } }
private void ClickCloseRuneView(GameObject obj) { if (null != obj) { if (null != Singleton <PropertyView> .Instance.transform && Singleton <PropertyView> .Instance.gameObject.activeInHierarchy) { MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewInitToggle, PropertyType.Info, false); MobaMessageManagerTools.SendClientMsg(ClientV2C.propviewChangeToggle, PropertyType.Info, false); MobaMessageManagerTools.SendClientMsg(ClientV2C.runesviewCloseView, null, false); } CtrlManager.CloseWindow(WindowID.RunesOverView); } }
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); }
public void ShowViewSetText(string text, float time = 1f) { this.text_str = text; CtrlManager.OpenWindow(WindowID.TipView, null); if (this.time_out == null) { this.time_out = this.transform.GetComponent <TimeoutController>(); } if (this.time_out == null) { this.time_out = this.gameObject.AddComponent <TimeoutController>(); } this.SetTime(time); }
private void GoToShop(GameObject go) { CtrlManager.OpenWindow(WindowID.PurchasePopupView, null); Singleton <PurchasePopupView> .Instance.onSuccess.Add(new Callback(this.AfterBuyAvatar)); if (this.isHeadPortraitPanel) { Singleton <PurchasePopupView> .Instance.Show(GoodsSubject.HeadPortrait, this.selectPortraitName, 1, false); } else { Singleton <PurchasePopupView> .Instance.Show(GoodsSubject.HeadPortraitFrame, this.selectPortraitName, 1, false); } }
public override void Init() { base.Init(); this.TitleLabel = this.transform.Find("Anchor/Panel/Title").GetComponent <UILabel>(); this.proxy = this.transform.GetComponent <AwardViewContainer>(); this.sample = this.proxy.rewardItem; UIEventListener.Get(this.proxy.buttonGetAward.gameObject).onClick = delegate { CtrlManager.CloseWindow(WindowID.AwardView); if (this.onClose != null) { this.onClose(); } }; }
private void OpenWaitingView(bool b) { if (b) { if (!Singleton <NewWaitingView> .Instance.IsOpened) { CtrlManager.OpenWindow(WindowID.NewWaitingView, null); } this.RefreshWaitingViewText(); } else if (Singleton <NewWaitingView> .Instance.IsOpened) { CtrlManager.CloseWindow(WindowID.NewWaitingView); } }
public void AddInvitation(string id, string title, string content, string summerId, InvitateType type = InvitateType.KHOrZDY) { if (SceneManager.Instance.CurSceneType == SceneType.Home && !Singleton <PvpRoomView> .Instance.IsOpen && !Singleton <PvpSelectHeroView> .Instance.IsOpen) { if (!Singleton <InvitationView> .Instance.IsOpen) { CtrlManager.OpenWindow(WindowID.InvitationView, null); } this.coroutineManager.StartCoroutine(this.AddOneNotice(id, title, content, summerId, type), true); } else { this.SaveInvitation(id, title, content, summerId, type); } }
private void ClickBannerItem(GameObject obj) { if (this.info == null) { return; } CtrlManager.OpenWindow(WindowID.ActivityView, null); MsgData_Activity_setCurActivity param = new MsgData_Activity_setCurActivity { activity_typeID = this.info.activityConfig.activity_type_id, activity_id = this.info.activityConfig.id }; MobaMessageManagerTools.SendClientMsg(ClientV2V.Activity_setCurActivity, param, false); }
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); } }
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); } }
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); } } } }
private void SucceedInCreatingCount() { ModelManager.Instance.Get_userData_X().LoginCount++; if (GlobalSettings.isLoginByHoolaiSDK) { InitSDK.instance.SetExtData("3"); AnalyticsToolManager.Register(ModelManager.Instance.Get_accountData_X().AccountId); } else if (GlobalSettings.isLoginByAnySDK) { InitSDK.instance.SetAnySDKExtData("2"); } Singleton <MenuTopBarView> .Instance.RefreshUI(); CtrlManager.CloseWindow(WindowID.SummonerRegisterView); NewbieManager.Instance.TryProcessNewbieGuide(); }
private void GoToRank(GameObject go) { if (this.skipPage == "1") { Singleton <RankView> .Instance.selectBtn = "Ladder"; } else if (this.skipPage == "2") { Singleton <RankView> .Instance.selectBtn = "MagicBottle"; } else { Singleton <RankView> .Instance.selectBtn = "Charming"; } CtrlManager.OpenWindow(WindowID.RankView, null); CtrlManager.CloseWindow(WindowID.MenuBottomBarView); }
private void ClickSkillItem(GameObject obj = null) { if (!this.skillObjDict[obj.name].IsCanChoice()) { CtrlManager.CloseWindow(WindowID.TipView); Singleton <TipView> .Instance.SetText("技能还未解锁", 0f); CtrlManager.OpenWindow(WindowID.TipView, null); return; } this.ShowSkillData(obj.name); if (this.clickSkillCallBack != null) { this.clickSkillCallBack(obj.name); } CtrlManager.CloseWindow(WindowID.PvpChoiceSkillView); }
public void OnMsg_RichManGiftMgr(MobaMessage msg) { if (msg == null) { return; } OperationResponse operationResponse = msg.Param as OperationResponse; if (operationResponse != null) { bool flag = (bool)operationResponse.Parameters[1]; if (flag) { int num = (int)operationResponse.Parameters[30]; if (num == 1) { this.TuhaoCount = (int)operationResponse.Parameters[55]; this.UpdateTuhaoHongBao(); } else if (num == 2) { int type = (int)operationResponse.Parameters[234]; int count = (int)operationResponse.Parameters[101]; string name = (string)operationResponse.Parameters[59]; bool flag2 = (bool)operationResponse.Parameters[176]; CtrlManager.OpenWindow(WindowID.RedPacketView, null); Singleton <RedPacketView> .Instance.UpdateGiftData(type, count, name); this.TuhaoCount--; this.UpdateTuhaoHongBao(); if (flag2) { this.SendTrumpet(type, count, name); } } else { this.TuhaoPacket.gameObject.SetActive(false); } } } else { this.TuhaoPacket.gameObject.SetActive(false); } }
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 }); } }
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(); }
private void OnResetBtn(GameObject go) { if (LevelManager.Instance.CheckSceneIsTest()) { if (LevelManager.Instance.IsServerZyBattleType) { return; } GameObject gameObject = GameObject.FindGameObjectWithTag("Player"); if (gameObject != null) { Units component = gameObject.GetComponent <Units>(); UtilCounter counter = UtilManager.Instance.GetCounter(UtilType.Exp); ExpValue expValue = counter.GetValue(PlayerControlMgr.Instance.GetPlayer().unique_id) as ExpValue; expValue.AddExp(-expValue.CurExp); component.skillManager.SkillPointsLeft = 0; for (int i = 0; i < 4; i++) { List <SkillDataKey> skillsByIndex = component.getSkillsByIndex(i); if (skillsByIndex != null) { for (int j = 0; j < skillsByIndex.Count; j++) { skillsByIndex[j] = new SkillDataKey(skillsByIndex[j].SkillID, 0, skillsByIndex[j].Skin); Skill skillById = component.getSkillById(skillsByIndex[j].SkillID); if (skillById != null) { skillById.SetLevel(0); } } } } SkillCounter skillCounter = UtilManager.Instance.GetCounter(UtilType.Skill) as SkillCounter; skillCounter.OnHeroLevelup(component, 0); component.level = 1; component.UpLevel(); CtrlManager.CloseWindow(WindowID.SkillView); CtrlManager.OpenWindow(WindowID.SkillView, null); } } }
private void ShowResult() { if (GameManager.Instance == null) { return; } SurrenderMgr surrenderMgr = GameManager.Instance.SurrenderMgr; if (surrenderMgr == null) { return; } int num = Mathf.CeilToInt((float)surrenderMgr.ValidVoters * 0.7f); if (num <= surrenderMgr.AcceptCount) { CtrlManager.CloseWindow(WindowID.SurrenderView); return; } this._comps.ShowVotePanel(false); this._comps.ShowResultPanel(true); string resultText = string.Empty; int acceptCount = surrenderMgr.AcceptCount; int num2 = surrenderMgr.Votes - surrenderMgr.AcceptCount; int num3 = surrenderMgr.OurTeamCount - surrenderMgr.Votes; string format = "投票结果{0}票同意 {1}票拒绝 {2}票弃权 投降失败"; resultText = string.Format(format, acceptCount, num2, num3); this._comps.SetResultText(resultText); if (this._closeTask == null) { this._closeTask = new Task(this.TimerEnumerator(4f), false); this._closeTask.Finished += delegate(bool manual) { this._closeTask = null; CtrlManager.CloseWindow(WindowID.SurrenderView); }; this._closeTask.Start(); } }
public override void HandleAfterOpenView() { this.clickCd = false; SendMsgManager.Instance.SendMsg(MobaGameCode.DealGameReport, null, new object[0]); if (Singleton <MenuBottomBarView> .Instance.IsOpen) { CtrlManager.CloseWindow(WindowID.MenuBottomBarView); } if (PvpMatchMgr.State == PvpMatchState.Matching) { this.ShowMatchingFrame(); } else if (PvpMatchMgr.State == PvpMatchState.Matched) { this.ShowMatchingFrame(); } PvpLevelStorage.DispatchChooseGameMsg(); bool flag = CharacterDataMgr.instance.GetUserLevel(ModelManager.Instance.Get_userData_X().Exp) >= BaseDataMgr.instance.GetDataById <SysBattleSceneVo>("80006").scene_limit_level; this._daluandou.FindChild("Lock").gameObject.SetActive(!flag); this._daluandou.GetComponent <BoxCollider>().enabled = flag; if (flag) { this._task_timeLock = this._timeLockCMgr.StartCoroutine(this.RankTimeLock(), true); } this._timeLockCMgr.StartCoroutine(this.RankSeasonLock(), true); bool flag2 = CharacterDataMgr.instance.GetUserLevel(ModelManager.Instance.Get_userData_X().Exp) >= BaseDataMgr.instance.GetDataById <SysBattleSceneVo>("80021").scene_limit_level; this._jbs.FindChild("Lock").gameObject.SetActive(!flag2); this._jbs.GetComponent <BoxCollider>().enabled = flag2; if (flag2) { this._timeLockCMgr.StartCoroutine(this.LeagueTimeLock(), true); } AutoTestController.InvokeTestLogic(AutoTestTag.EnterPvp, delegate { this.ClickFightWithRobot(null); }, 1f); }
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 }); } } }
private void Click_CharmRule(GameObject obj = null) { CtrlManager.ShowMsgBox("如何获得魅力值?", "[EC3A76]魅力值[-]来自你获得与穿戴的皮肤、宠物、特效等,每赛季结束时结算排名,根据排名获得奖励。", delegate { }, PopViewType.PopOneButton, "我知道了", "取消", null); }