// 显示连接失败的 二次弹框 public void ShowConFailed() { Loading.Singleton.m_conFailedNum++; UICommonMsgBoxCfg boxCfg = WindowRoot.transform.GetComponent <UICommonMsgBoxCfg>(); // 如果是战斗状态下 if (MainGame.Singleton.CurrentState is StateBattle) { boxCfg.buttonNum = 1; // 如果提示次数到上限 则 出现两个按钮 WorldParamInfo wordParmInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enConTimeOutCounts); if (wordParmInfo != null && Loading.Singleton.m_conFailedNum > wordParmInfo.IntTypeValue) { boxCfg.buttonNum = 2; } } UICommonMsgBox.GetInstance().ShowMsgBox(OnYesClicked, OnNoClicked, boxCfg); string buyText = Localization.Get("ConFailed"); UICommonMsgBox.GetInstance().GetMainText().SetText(buyText); HideWindow(); }
// 显示连接失败的 离开战斗的 二次弹框 public void ShowConFailedLeave() { UICommonMsgBoxCfg boxCfg = WindowRoot.transform.Find("LeaveConfirm").GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnLeaveYesClicked, OnLeaveNoClicked, boxCfg); HideWindow(); }
void OnButtonOK(GameObject obj) { bool isShowCommonMsgBox = false; CSItem card = CardBag.Singleton.GetCardByGuid(CardEvolution.Singleton.m_curEvolutionGuid); if (null == card) { Debug.Log("UICardEvolution card == null card:" + CardEvolution.Singleton.m_curEvolutionGuid); return; } HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { Debug.Log("UICardEvolution HeroInfo == null card.m_id:" + card.IDInTable); return; } Dictionary <int, int> evolveCardList = new Dictionary <int, int>(); foreach (var cardID in info.EvolveCardList) { if (evolveCardList.ContainsKey(cardID)) { ++evolveCardList[cardID]; } else { evolveCardList.Add(cardID, 1); } } //判断素材卡里是否有稀有素材 如果有 则弹出二次确认框 foreach (KeyValuePair <int, int> item in evolveCardList) { WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enCardDivisionMaterialStarLevel); HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(item.Value); if (null != heroInfo && worldInfo.IntTypeValue <= heroInfo.Rarity) { isShowCommonMsgBox = true; } } if (isShowCommonMsgBox) { UICommonMsgBoxCfg boxCfg = m_buttonOk.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnCardEvolutionOK, OnCardEvolutionNO, boxCfg); string formulaText = Localization.Get("WarningOfTheMaterial"); UICommonMsgBox.GetInstance().GetMainText().SetHintText(formulaText); UICommonMsgBox.GetInstance().GetMainText().SetHintTextColor(Color.red); } else { //进入转菊花loading界面 Loading.Singleton.SetLoadingTips((int)LOADINGTIPSENUM.enJumpToBag); IMiniServer.Singleton.req_herocardEvolve(CardEvolution.Singleton.m_curEvolutionGuid); HideWindow(); } }
//魔法石招募 void OnStoneRecruitmentButton(GameObject obj) { WorldParamInfo param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enMagicStoneRecruitmentNum); UICommonMsgBoxCfg boxCfg = m_stoneRecruitmentButton.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnStoneRecruitmentButtonYes, OnStoneRecruitmentButtonNo, boxCfg); string buyText = string.Format(Localization.Get("EnsureStoneRecruit"), param.IntTypeValue); UICommonMsgBox.GetInstance().GetMainText().SetText(buyText); }
// 创建角色 public void OnCreate(GameObject obj) { UICommonMsgBoxCfg boxCfg = obj.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnCreateButtonYes, OnCreateButtonNo, boxCfg); string cardName = GameTable.HeroInfoTableAsset.Lookup(Login.Singleton.m_curCardId).StrName; string buyText = string.Format(Localization.Get("EnsureChooseThisCard"), cardName); UICommonMsgBox.GetInstance().GetMainText().SetText(buyText); }
//拥有原地复活次数 // public void OnOrigialFunc() // { // if (CanRetLayerResurrection()) // { // if (m_resurrectionUnLimited) // { // //有复活次数限制,显示复活剩余次数 // //如果复活剩余次数为0,原地复活按钮为灰 // } // m_selectObj.SetActive(true); // } // else // { // UICommonMsgBoxCfg boxCfg = WindowRoot.GetComponent<UICommonMsgBoxCfg>(); // UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonOrigial, OnButtonNo, boxCfg); // } // // } // public void ExecuteOrigial() // { // IResult r = BattleFactory.Singleton.CreateResult(ENResult.Relive, (int)EnMyPlayers.enChief, (int)EnMyPlayers.enChief); // if (r != null) // { // r.ResultExpr(null); // BattleFactory.Singleton.GetBattleContext().CreateResultControl().DispatchResult(r); // } // if (Team.Singleton.Deputy != null) // { // r = BattleFactory.Singleton.CreateResult(ENResult.Relive, (int)EnMyPlayers.enDeputy, (int)EnMyPlayers.enDeputy); // if (r != null) // { // r.ResultExpr(null); // BattleFactory.Singleton.GetBattleContext().CreateResultControl().DispatchResult(r); // } // } // HideWindow(); // ++BattleArena.Singleton.ReliveCount; // } //------------------------------------------------------------- public void OnButtonCacel(object sender, EventArgs e) { //BattleSummary.Singleton.OnFinished(false); //HideWindow(); m_selectObj.SetActive(false); m_choiceLayerObj.SetActive(false); UICommonMsgBoxCfg boxCfg = WindowRoot.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, boxCfg); }
//扩容 public void ExpandCardBag(int type) { // 当前背包容量超过最大 if (m_capacity >= m_bagTableInfo.m_maxSize) { RUSure.Singleton.Show(Localization.Get("ExpandMax"), null); return; } int expandCost = 0; // int expandSize = 0; switch (type) { case (int)ExpandBag.ExpandType.enExpand1: { expandCost = m_bagTableInfo.m_expandCost1; // expandSize = m_bagTableInfo.m_expandSize1; } break; case (int)ExpandBag.ExpandType.enExpand2: { expandCost = m_bagTableInfo.m_expandCost2; // expandSize = m_bagTableInfo.m_expandSize2; } break; case (int)ExpandBag.ExpandType.enExpand3: { expandCost = m_bagTableInfo.m_expandCost3; // expandSize = m_bagTableInfo.m_expandSize3; } break; } //弹出二次确认框 魔法石不足 if (User.Singleton.GetDiamond() < expandCost) { UICommonMsgBoxCfg boxCfg = UIExpandBag.GetInstance().FindChild("OK").transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); string text = Localization.Get("NotEnoughMagicStone"); UICommonMsgBox.GetInstance().GetMainText().SetText(text); return; } //向服务器发送扩展背包消息 // WorldParamInfo param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enCardBagID); MiniServer.Singleton.SendExpandCardBag_C2S(type); //进入转菊花loading界面 Loading.Singleton.SetLoadingTips(); //NotifyChanged((int)ENPropertyChanged.enExpandCardBag, type); //string str = string.Format(Localization.Get("ExpandSuccess"), expandSize, m_capacity); //RUSure.Singleton.Show(str, null); }
//点击恢复体力按钮 void OnRecoverStamina(GameObject obj) { //恢复体力值数量 int staminaNum = 0; //计算恢复体力所需魔法石 WorldParamInfo param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enRecoverStaminaMagicStoneNum); int needStone = param.IntTypeValue; int money = User.Singleton.GetMoney(); if (needStone > money) { //弹出二次确认 魔法石不足 UICommonMsgBoxCfg boxCfg = m_recoverStaminaBG.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); string text = Localization.Get("NotEnoughMagicStone"); UICommonMsgBox.GetInstance().GetMainText().SetText(text); return; } //最大体力值上限 int maxStamina = User.Singleton.GetMaxStamina(); int stamina = User.Singleton.UserProps.GetProperty_Int32(UserProperty.stamina);//当前体力值 //判断是否为最大体力值 if (stamina >= maxStamina) { //弹出二次确认 体力值已满 UICommonMsgBoxCfg boxCfg = m_recoverStaminaButtonLable.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); string text = Localization.Get("StaminaIsMax"); UICommonMsgBox.GetInstance().GetMainText().SetText(text); return; } param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enRecoverStaminaNum); //直接回满 if (0 > param.IntTypeValue) { //最大体力值上限 staminaNum = maxStamina - stamina; } else { //恢复固定值 param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enRecoverStaminaNum); staminaNum = param.IntTypeValue;//恢复多少体力 } //弹出二次确认 是否恢复体力 UICommonMsgBoxCfg boxCfg2 = m_recoverStaminaButton.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnRecoverStaminaYes, OnRecoverStaminaNo, boxCfg2); string text2 = string.Format(Localization.Get("EnsureRecoverStamina"), needStone, staminaNum); UICommonMsgBox.GetInstance().GetMainText().SetText(text2); }
void OnChangeNameSucc() { UICommonMsgBoxCfg boxCfg = m_okChangeButton.transform.GetComponent <UICommonMsgBoxCfg>(); boxCfg.mainTextPrefab = boxCfg.textPrefabList[1]; UICommonMsgBox.GetInstance().ShowMsgBox(OnOKChangeName, null, boxCfg); string buyText = Localization.Get("NameChanged"); UICommonMsgBox.GetInstance().GetMainText().SetText(buyText); }
//恢复能量 void OnRecoverEnergy(GameObject obj) { //恢复能量值数量 int energyNum = 0; //计算恢能量所需魔法石 WorldParamInfo param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enRecoverEnergyMagicStoneNum); int needStone = param.IntTypeValue; //最大军资上限 int maxEnergy = User.Singleton.GetMaxEnergy(); int energy = User.Singleton.UserProps.GetProperty_Int32(UserProperty.energy);//当前军资 int money = User.Singleton.GetMoney(); if (needStone > money) { //弹出二次确认 魔法石不足 UICommonMsgBoxCfg boxCfg = m_recoverEnergyBG.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); string text = Localization.Get("NotEnoughMagicStone"); UICommonMsgBox.GetInstance().GetMainText().SetText(text); return; } //判断是否为最大军资 if (energy >= maxEnergy) { //弹出二次确认 军资已满 UICommonMsgBoxCfg boxCfg = m_recoverEnergyButtonLable.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); string text = Localization.Get("EnergyIsMax"); UICommonMsgBox.GetInstance().GetMainText().SetText(text); return; } param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enRecoverEnergyNum); //直接回满 if (0 > param.IntTypeValue) { //最大军资上限 energyNum = maxEnergy - energy; } else { //恢复固定值 param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enRecoverEnergyNum); energyNum = param.IntTypeValue;//恢复多少军资 } //弹出二次确认 是否恢复军资 UICommonMsgBoxCfg boxCfg2 = m_recoverEnergyButton.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnRecoverEnergyYes, OnRecoverEnergyNo, boxCfg2); string text2 = string.Format(Localization.Get("EnsureRecoverEnergy"), needStone, energyNum); UICommonMsgBox.GetInstance().GetMainText().SetText(text2); }
// 退出队伍时的 删除空队伍 和 弹二次提示框的相关处理 public override bool OnLeave() { // int index = Team.Singleton.m_curTeamIndex; // 是否所有队伍为空 bool isEmpty = true; // 是否所有队伍的主角色为空 bool isMainEmpty = true; for (int i = 0; i < Team.Singleton.TeamNum; i++) { if (!Team.Singleton.IsTeamEmpty(i)) { isEmpty = false; } if (!Team.Singleton.IsDutyEmpty(i, Team.EDITTYPE.enMain)) { isMainEmpty = false; } } // 如果全部队伍为空 则二次提示 if (isEmpty) { UICommonMsgBoxCfg boxCfg = FindChild("TeamEmpty").GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, boxCfg); //Debug.Log("全部队伍为空 则二次提示"); return(false); } // 如果全部队伍的主角色为空 则二次提示 if (isMainEmpty) { UICommonMsgBoxCfg boxCfg = FindChild("TeamMainEmpty").GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, boxCfg); //Debug.Log("全部队伍的主角色为空 则二次提示"); return(false); } // 然后删除 空白队伍 这时 会保证 必然有一个队伍不是空 所以可以放心的删除所有的空队伍 Team.Singleton.RemoveEmpty(); // 更新队伍当前索引 如果 当前索引的队伍为空 则取第一个队伍为 当前队伍索引 if (Team.Singleton.IsTeamEmpty(Team.Singleton.m_curTeamIndex)) { Team.Singleton.m_curTeamIndex = 0; } // 发送服务器保存 当前队伍索引 IMiniServer.Singleton.SendSelectTeamIndex(Team.Singleton.m_curTeamIndex); Team.Singleton.UpdateBattleTeam(); return(true); }
public void OnCancelTeamLeaderModelClicked(object obj, EventArgs e) { GameObject gameObject = obj as GameObject; string prefabStr = ""; UICommonMsgBoxCfg boxCfg = gameObject.GetComponent <UICommonMsgBoxCfg>(); prefabStr = "UICancelTeamLeaderModeLabel"; boxCfg.mainTextPrefab = prefabStr; UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, boxCfg); Debug.Log("OnCancelTeamLeaderModelClicked"); }
//好友查找失败 public void OnPlayerIDNotFound(MessageRespond respond) { /*Loading.Singleton.Hide();*/ if (respond.IsSuccess) { return; } Debug.Log("OnPlayerIDNotFound"); UICommonMsgBoxCfg boxCfg = FindChild("Button_Enter").GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnFriendBtnYes, OnFriendBtnNo, boxCfg); }
public void OnServerLog(string logStr) { UICommonMsgBoxCfg boxCfg = new UICommonMsgBoxCfg(); boxCfg.isUsePrefab = false; boxCfg.mainTextPrefab = logStr; boxCfg.buttonNum = 1; UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); //Debug.LogError("协议版本号与服务端不同,请更新客户端"); HideWindow(); }
void OnPropertyChanged(int objectID, int eventType, IPropertyObject obj, object eventObj) { if (eventType == (int)Team.ENPropertyChanged.enShowTeam) { // if (MainUIManager.Singleton.ChangeUI(this)) // { // MainButtonList.Singleton.m_curShowType = MainButtonList.SHOWWNDTYPE.ENTeam; // ShowWindow(); // UpdateInfo(); // } //Debug.Log("CardBag.Singleton.GetCardList().Count:" + CardBag.Singleton.GetCardList().Count); } else if (eventType == (int)Team.ENPropertyChanged.enHideTeam) { HideWindow(); } else if (eventType == (int)Team.ENPropertyChanged.enUpdateTeam) { //if (MainUIManager.Singleton.ChangeUI(this)) { UpdateInfo(); } } else if (eventType == (int)Team.ENPropertyChanged.enShowEditTeam) { Team.Singleton.UpdateTeamBagAllSlotId(); Team.Singleton.m_curEditType = Team.EDITTYPE.enALL; HideAllModel(); OperateCardList.Singleton.SetOperateTeamType(); MainUIManager.Singleton.OnSwitchSingelUI(MainUIManager.EDUITYPE.enOperaterCardList); } else if (eventType == (int)Team.ENPropertyChanged.enRemoveTeam) { OnRemoveTeamItem(); // 显示 UpdateInfo(); } else if (eventType == (int)Team.ENPropertyChanged.enTeamEmpty) { UICommonMsgBoxCfg boxCfg = m_team.transform.Find("TeamEmpty").GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, boxCfg); Debug.Log("全部队伍为空 则二次提示"); } else if (eventType == (int)Team.ENPropertyChanged.enTeamMainEmpty) { UICommonMsgBoxCfg boxCfg = m_team.transform.Find("TeamMainEmpty").GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonYes, OnButtonNo, boxCfg); Debug.Log("全部队伍的主角色为空 则二次提示"); } }
public void OnEnterName(GameObject obj) { if (m_input.value == "") { return; } UICommonMsgBoxCfg confg = obj.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnEnterYes, null, confg); string text = string.Format(Localization.Get("EnsureUseThisName"), m_input.value); Debug.Log("text:" + text + ",m_input.value:" + m_input.value); UICommonMsgBox.GetInstance().GetMainText().SetText(text); }
//友情招募多次按钮 void OnFriendRecruitmentMore(GameObject obj) { WorldParamInfo param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enFrinendShipRecruitmentNum); UICommonMsgBoxCfg boxCfg = m_friendRecruitmentMoreButton.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnFriendRecruitmentMoreYes, OnFriendRecruitmentMoreNo, boxCfg); string buyText = string.Format(Localization.Get("EnsureFriendRecruit"), (m_moreFriendRecruitment * param.IntTypeValue), m_moreFriendRecruitment); UICommonMsgBox.GetInstance().GetMainText().SetText(buyText); int friendPoint = User.Singleton.UserProps.GetProperty_Int32(UserProperty.friendship_point); buyText = string.Format(Localization.Get("RemainFriendPoints"), (friendPoint - (m_moreFriendRecruitment * param.IntTypeValue))); UICommonMsgBox.GetInstance().GetMainText().SetHintText(buyText); }
//点击购买荣誉戒指卡牌按钮 void OnBuyRingCardButton(object sender, EventArgs e) { GameObject obj = (GameObject)sender; m_ringOfHonorId = obj.transform.parent.GetComponent <Parma>().m_id; m_ringOfHonorCardId = obj.transform.parent.GetComponent <Parma>().m_type; UICommonMsgBoxCfg boxCfg = m_cardListPanel.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnBuyRingCardButtonYes, OnBuyRingCardButtonNo, boxCfg); string cardName = GameTable.HeroInfoTableAsset.Lookup(m_ringOfHonorCardId).StrName; string buyText = string.Format(Localization.Get("EnsureExchangeCard"), cardName); UICommonMsgBox.GetInstance().GetMainText().SetText(buyText); }
// 连接失败时执行的函数 void OnConnectFailed(ConnectionArgs args, ErrorArgs error, object state) { Debug.Log("OnConnectFailed !!!"); LCMsgSender.Singleton.IsTryingConn = false; //ClientNetProperty.Singleton.NotifyChanged((int)ClientNetProperty.ENPropertyChanged.enConnectionFailed, error.ErrorType); // 如果没有得到SESSION才弹提示框 //if (false == LCMsgSender.Singleton.GotSession) { UICommonMsgBoxCfg boxCfg = new UICommonMsgBoxCfg(); boxCfg.mainTextPrefab = "UILostConnectionLabel"; boxCfg.buttonNum = 1; UICommonMsgBox.GetInstance().ShowMsgBox(OnConnectFailedButtonClick, null, boxCfg); } }
// 选择战友校验的回调 public void OnSelectHelperCallback(MessageRespond respond) { Debug.Log("OnSelectHelperCallback:" + respond.IsSuccess); if (false == respond.IsSuccess) { UICommonMsgBoxCfg boxCfg = new UICommonMsgBoxCfg(); boxCfg.mainTextPrefab = "UIComradeInfoErrorLabel"; boxCfg.buttonNum = 1; UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); return; } // 校验成功 发送进入副本的消息 // 发送服务器 int myStamina = User.Singleton.UserProps.GetProperty_Int32(UserProperty.stamina); MiniServer.Singleton.SendEnterDungeon(StageMenu.Singleton.m_curFloorId, myStamina, StageMenu.Singleton.m_camp, StageMenu.Singleton.m_key, StageMenu.Singleton.m_isRolling); }
void ShowWarnTips() { if (m_checkErrorID <= 0) { return; } WorldParamInfo info = GameTable.WorldParamTableAsset.Lookup(m_checkErrorID); if (null == info) { return; } UICommonMsgBoxCfg boxCfg = new UICommonMsgBoxCfg(); boxCfg.mainTextPrefab = info.StringTypeValue; boxCfg.buttonNum = 1; UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); }
//点击购买按钮 void OnBuyStoneButton(GameObject obj) { m_stoneId = obj.transform.parent.GetComponent <Parma>().m_id; int magicStoneNum = 0; int magicStonePrice = 0; foreach (MagicStoneInfo item in ShopProp.Singleton.m_magicStoneList) { if (item.m_magicStoneId == m_stoneId) { magicStoneNum = item.m_magicStoneNum; magicStonePrice = item.m_magicStonePrice; } } UICommonMsgBoxCfg boxCfg = m_stoneGridList.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnBuyStoneButtonYes, OnBuyStoneButtonNo, boxCfg); string buyText = string.Format(Localization.Get("EnsureBuyMagicStone"), magicStonePrice, magicStoneNum); UICommonMsgBox.GetInstance().GetMainText().SetText(buyText); }
void OnButtonOK(GameObject obj) { //HideWindow(); UICommonMsgBoxCfg boxCfg = m_buttonOk.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnCardDivisionUpdateOK, OnCardDivisionUpdateNO, boxCfg); string formulaText = Localization.Get("EnsureChooseUpdateFormula"); UICommonMsgBox.GetInstance().GetMainText().SetText(formulaText); //如果素材里面有 规定的稀有星级卡牌 foreach (KeyValuePair <int, CSItem> item in CardDivisionUpdateProp.Singleton.m_chooseCardList) { WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enCardDivisionMaterialStarLevel); HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(item.Value.IDInTable); if (null != heroInfo && worldInfo.IntTypeValue <= heroInfo.Rarity) { formulaText = Localization.Get("WarningOfTheMaterial"); UICommonMsgBox.GetInstance().GetMainText().SetHintText(formulaText); UICommonMsgBox.GetInstance().GetMainText().SetHintTextColor(Color.red); } } }
void OnStoneRecruitmentButtonYes(object sender, EventArgs e) { //确认购买后判断魔法石是否足够 不够 二次确认框 魔法石不足 int bindMoney = User.Singleton.UserProps.GetProperty_Int32(UserProperty.bind_money); WorldParamInfo param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enMagicStoneRecruitmentNum); if (param.IntTypeValue > bindMoney) { UICommonMsgBoxCfg boxCfg = m_stoneRecruitmentGrid.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); string text = Localization.Get("NotEnoughMagicStone"); UICommonMsgBox.GetInstance().GetMainText().SetText(text); return; } //进入转菊花loading界面 Loading.Singleton.SetLoadingTips((int)(LOADINGTIPSENUM.enJumpToStore)); //如果足够 发送消息 到服务器魔法石招募 ShopProp.Singleton.SendMagicStoneRecruitment(); ////关闭抽卡界面 //m_Recruitment.gameObject.SetActive(false); HideWindow(); }
public void OnMsgAccountLoginResult_S2F2C(PacketReader p, object state) { byte reslut = p.ReadByte(); string session = p.ReadAscii(32); uint sobID = p.ReadUInt32(); uint zoneID = p.ReadUInt32(); Debug.Log("session = " + session); if (reslut == (byte)ENLoginResult.enSuccess) { MessageTransfer.Singleton.Session = session; } else if (reslut == (byte)ENLoginResult.enProtocolVerErr) { UICommonMsgBoxCfg boxCfg = new UICommonMsgBoxCfg(); boxCfg.isUsePrefab = false; boxCfg.mainTextPrefab = "协议版本号与服务端不同,请更新客户端"; boxCfg.buttonNum = 1; UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); //Debug.LogError("协议版本号与服务端不同,请更新客户端"); } }
//购买好友格子 void OnExpandFriends(GameObject obj) { WorldParamInfo param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enMaxFriendCount); int friendCount = User.Singleton.GetFriendCount(); if (friendCount >= param.IntTypeValue) { //弹出二次确认 好友格子已经达到上限 UICommonMsgBoxCfg boxCfg = m_expandFriendsLabel.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); string text = Localization.Get("FriendNumMax"); UICommonMsgBox.GetInstance().GetMainText().SetText(text); return; } param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enExpandFriendsNeedMagicStone); int needMoney = param.IntTypeValue; int money = User.Singleton.GetMoney(); if (needMoney > money) { //弹出二次确认 魔法石不足 UICommonMsgBoxCfg boxCfg = m_expandFriendsBG.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(null, null, boxCfg); string text = Localization.Get("NotEnoughMagicStone"); UICommonMsgBox.GetInstance().GetMainText().SetText(text); return; } param = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enExpandFriendsNum); //弹出二次确认 是否恢复军资 UICommonMsgBoxCfg boxCfg2 = m_expandFriendsButton.transform.GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnExpandFriendsYes, OnExpandFriendsNo, boxCfg2); string text2 = string.Format(Localization.Get("EnsureExpandFriends"), needMoney, param.IntTypeValue); UICommonMsgBox.GetInstance().GetMainText().SetText(text2); }
public void OnShowOrigialBox() { UICommonMsgBoxCfg boxCfg = FindChildComponent <UICommonMsgBoxCfg>("Resurrection"); UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonOrigialYes, OnButtonOrigialNo, boxCfg); }
public void OnShowPayBox() { UICommonMsgBoxCfg boxCfg = FindChildComponent <UICommonMsgBoxCfg>("RechargeAsk"); UICommonMsgBox.GetInstance().ShowMsgBox(OnButtonPayYes, OnButtonPayNo, boxCfg); }
//拒绝全部申请按钮 public void OnClickRefuseAllBtnAllBtn(object sender, EventArgs e) { UICommonMsgBoxCfg boxCfg = FindChild("RefuseAllBtn").GetComponent <UICommonMsgBoxCfg>(); UICommonMsgBox.GetInstance().ShowMsgBox(OnRefuseAllBtnYes, OnRefuseAllBtnNo, boxCfg); }
public void ShowMsgBox(OnButtonCallbacked yesCallbacked, OnButtonCallbacked noCallbacked, UICommonMsgBoxCfg boxCfg, int strIndex) { Reset(); m_yesCallbacked = yesCallbacked; m_noCallbacked = noCallbacked; if (!string.IsNullOrEmpty(boxCfg.yesIcon)) { UISprite sprite = m_yesButton.GetComponent <UISprite>(); sprite.spriteName = boxCfg.yesIcon; } if (!string.IsNullOrEmpty(boxCfg.noIcon)) { UISprite sprite = m_noButton.GetComponent <UISprite>(); sprite.spriteName = boxCfg.noIcon; } // 显示一个按钮 if (boxCfg.buttonNum == 1) { m_oneButton.SetActive(true); m_twoButton.SetActive(false); } // 显示两个按钮 else { m_oneButton.SetActive(false); m_twoButton.SetActive(true); } if (boxCfg.isUsePrefab) { UIMainText = UIMsgBoxMainText.Load(boxCfg.textPrefabList[strIndex]); UIMainText.SetParent(m_textLabel); UIMainText.ShowWindow(); } else { UILabel label = m_textLabel.GetComponent <UILabel>(); if (null != label) { label.text = boxCfg.textPrefabList[strIndex]; } } ShowWindow(); }