private void SetDrawCardState() { string tipstr = ""; bool isshowtip = false; if (starttime > EB.Time.Now) { tipstr = string.Format("[ff6699]{0}[-]", EB.Localizer.GetString("ID_ACTIVITY_NOTSTARTED")); isshowtip = true; } else if (fintime < EB.Time.Now) { tipstr = EB.Localizer.GetString("ID_uifont_in_LTLegionWarQualify_End_4"); isshowtip = true; } if (!isshowtip) { AddCountDownTimer(); DrawCardrp10.CustomSetActive(BalanceResourceUtil.GetUserDiamond() >= tenDrawcardcost); } actEndtip.text = actEndtipshadow.text = tipstr; endtipobj.CustomSetActive(isshowtip); drawcard1.CustomSetActive(!isshowtip); drawcard10.CustomSetActive(!isshowtip); SetScoreRewardRPState(); SetDiamondCostLabel(); }
public void OnBtnClick() { if (mIsScroll) { return; } float init = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("LuckWheelPriceInit"); float step = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("LuckWheelPriceStep"); float max = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("LuckWheelPriceMax"); float price = Mathf.Min(init + step * mCout, max); int num = 0; DataLookupsCache.Instance.SearchIntByID("res.hc.v", out num); if (num < price) { BalanceResourceUtil.HcLessMessage(); return; } switch (requestType) { case LTInstanceConfig.InChallengeState: LTInstanceMapModel.Instance.RequestChallengeCampaignLuckDraw(OnLuckDrawCallback); break; case LTInstanceConfig.OutChallengeState: LTInstanceMapModel.Instance.RequestChallengeWipeOutLuckDraw(OnLuckDrawCallback); break; default: break; } mIsScroll = true; }
private void OnBuyBtnClicked() { // 拥有的钻石 int diamondAmount; DataLookupsCache.Instance.SearchIntByID("res.hc.v", out diamondAmount); if (_data.activityPrice <= diamondAmount) { EB.Sparx.Request request = LTHotfixApi.GetInstance().Post("/sign_in/buyDiamondGift"); request.AddData("id", _data.id); LTHotfixApi.GetInstance().BlockService(request, delegate(Hashtable data) { if (data != null) { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, -_data.activityPrice, "购买七日钻石礼包"); DataLookupsCache.Instance.CacheData(data); SetBuyBtnStatus(); GlobalMenuManager.Instance.Open("LTShowRewardView", new List <LTShowItemData>() { _data.lTShowItemData }); } }); } else { ///MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTChallengeInstanceReviveCtrl_1696")); BalanceResourceUtil.HcLessMessage(); } }
/// <summary> /// 刷新抽奖礼包 /// </summary> private void RefreshDrawUI(ChargeGiftData data) { IconSp.spriteName = data.icon; if (IconSp.keepAspectRatio != UIWidget.AspectRatioSource.Free) { IconSp.keepAspectRatio = UIWidget.AspectRatioSource.Free; } IconSp.MakePixelPerfect(); IconSp.keepAspectRatio = UIWidget.AspectRatioSource.BasedOnWidth; IconSp.width = 358; TitleLab.text = data.title; GiftCountLab.text = string.Format("{0}/{1}", curGiftIndex + 1, giftDataList.Count); string colorStr = BalanceResourceUtil.GetUserDiamond() >= data.coinValue ? LT.Hotfix.Utility.ColorUtility.WhiteColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal; DiamondPriceLab.text = string.Format("[{0}]{1}[-]", colorStr, data.coinValue.ToString()); DiscountLab.text = LTChargeManager.GetDiscountText(data.discount); DiscountLab.transform.parent.gameObject.CustomSetActive(data.discount > 0 && data.discount < 1); curItemDataList = data.rewardList; curCountDownEnd = data.countDownEnd; tempCountDown = 1; RefreshShowItem(); RefreshDrawCountDown(); }
public void OpenChatTalkUI() { ChatRule.CHAT_CHANNEL channelType = ChatRule.CHAT_CHANNEL.CHAT_CHANNEL_WORLD; int userlevel = BalanceResourceUtil.GetUserLevel(); int chatlevel = BalanceResourceUtil.GetChatLevel(); if (userlevel < chatlevel) { var ht = Johny.HashtablePool.Claim(); ht.Add("0", chatlevel); MessageTemplateManager.ShowMessage(902014, ht, null); return; } string channelStr = ChatRule.CHANNEL2STR[channelType]; float leftTime = SparxHub.Instance.ChatManager.GetLastSendTime(channelStr) + GetSendInterval(channelType) - Time.realtimeSinceStartup; if (leftTime > 0) { var ht = Johny.HashtablePool.Claim(); ht.Add("0", Mathf.CeilToInt(leftTime).ToString()); MessageTemplateManager.ShowMessage(902100, ht, null); EB.Debug.LogWarning("OpenChatTalkUI: time limited"); return; } talkUI.CustomSetActive(true); StartRecord(); }
/// <summary> /// 修改军团名称和图标的核心方法 /// </summary> private void OnClickChangeLegionName() { FusionAudio.PostEvent("UI/General/ButtonClick"); if (BtInput.value.Length <= 1) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LegionLogic_11096")); return; } if (iconID == data.legionIconID && BtInput.value == data.legionName) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LegionNameEditView_2604")); mDMono.gameObject.SetActive(false); return; } if (!EB.ProfanityFilter.Test(BtInput.value)) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LegionLogic_10580")); return; } if (BalanceResourceUtil.GetUserDiamond() < AlliancesManager.Instance.Config.RenameCost) { BalanceResourceUtil.HcLessMessage(); return; } LTHotfixApi.GetInstance().ExceptionFunc = FuncProcess;//截取异常进行处理 EB.Sparx.Request request = LTHotfixApi.GetInstance().Post("/alliances/rename"); request.AddData("aid", LegionModel.GetInstance().legionData.legionID); request.AddData("name", BtInput.value); request.AddData("iconID", iconID); LTHotfixApi.GetInstance().BlockService(request, ResProcess /* (Hashtable resData) => { }*/);//向服务器发送请求上传修改后的信息 //AlliancesManager.Instance.Detail.IconID = iconID;//容错步骤,如果发0给服务器,服务器不会下发该数据,这里先存储,如果服务器不下发就用这里设置的,服务器下发了用服务器的 mDMono.gameObject.SetActive(false); }
/// <summary> /// 初始化初始选择Item /// </summary> private void InitSelect() { int maxLevel = 0; DataLookupsCache.Instance.SearchIntByID("userCampaignStatus.challengeChapters.bigFloor", out maxLevel); maxLevel += 1; Hotfix_LT.Data.LostChallengeChapter temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetCheckPointChapterByChapter(maxLevel); if (temp == null)//满层通关 { maxCheckPointLevel = 1000; temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetCheckPointChapterByChapter(maxLevel - 1); } else { maxCheckPointLevel = temp.Level; } CurSelectLevel = temp.Level; List <Hotfix_LT.Data.LostChallengeChapter> list = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostChallengeCheckPointChapterList(); int index = list.IndexOf(temp); DynamicScroll.MoveInternalNow((index - 4 < 0) ? 0 : index - 4); InitDrop(); BlitzObj.CustomSetActive(GetShowBlitzObj()); RecommendLevelLabel.gameObject.CustomSetActive(temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel); if (temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel) { RecommendLevelLabel.text = string.Format("{0}:{1}", EB.Localizer.GetString("ID_CHALLENGE_RECOMMEND"), temp.RecommendLevel); int userLevel = BalanceResourceUtil.GetUserLevel(); RecommendBGSprite.spriteName = (userLevel >= temp.RecommendLevel) ? "Ty_Welfare_Label_5" : "Welfare_Label_6"; } }
public void AllGetClick() { FusionAudio.PostEvent("UI/General/ButtonClick"); if (FriendManager.Instance.CanAllReceive()) { if (!FriendManager.Instance.IsResidueVigorReceiveNum()) { MessageTemplateManager.ShowMessage(FriendManager.CodeGetVitLimit); return; } //接受体力有次数限制,无二次弹窗提示, 达到上限则无法领取且保 留 int vigor = BalanceResourceUtil.GetUserVigor(); if (vigor >= 9999) { MessageTemplateManager.ShowMessage(FriendManager.CodeVitMax, null, delegate(int result) { if (result == 0) { ReceiveVigor(); } }); } else { ReceiveVigor(); } } else { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_FRIEND_NO_VIGOR_GET")); } }
public void OnOnceBtnClick() { if (BalanceResourceUtil.EnterVigorCheck(LTAwakeningInstanceConfig.GetNeedEnterVigor())) { // MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_PARTNER_AWAKEN_TIP_6")); return; } if (LTAwakeningInstanceConfig.AwakeningIsLock(m_AwakenDungeonTemplate.Type)) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_PARTNER_AWAKEN_TIP_7")); return; } int uid = 0; DataLookupsCache.Instance.SearchIntByID("userAwakenCampaign.uid", out uid); LTAwakeningInstanceManager.Instance.Blitz(uid, m_AwakenDungeonTemplate.ID, 1, () => { StartCoroutine(ResetScroll()); Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.OnEnterTimeChange); Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.OnPartnerEquipChange);//装备数量发生变化需要通知发送下 canClose = true; }); }
public void Blitz(int uid, int battleType, int times, System.Action callback) { Api.blockErrorFunc = (response) => { if (response.error != null) { string strObjects = (string)response.error; switch (strObjects) { case "insufficient vigor": { BalanceResourceUtil.TurnToVigorGotView(); return(true); } } } return(false); }; Api.RequestBlitzInstance(uid, battleType, times, delegate(Hashtable data) { if (data != null) { DataLookupsCache.Instance.CacheData(data); if (callback != null) { callback(); } } }); }
public static int GetExpRewardNum(int taskid) { TaskTemplate taskTpl = TaskTemplateManager.Instance.GetTask(taskid); if (taskTpl == null) { return(0); } if (taskTpl.xp.Length <= 0) { return(0); } int A = taskTpl.xp[0]; if (taskTpl.xp.Length >= 2) { int B = taskTpl.xp[1]; int lvl = BalanceResourceUtil.GetUserLevel(); return(A + B * lvl); } else { return(A); } }
public string GetVigorRecoverAllCountDown() { int current_value; if (DataLookupsCache.Instance.SearchIntByID(m_dataPath, out current_value)) { int residueVigor = BalanceResourceUtil.GetUserVigorMax() - current_value - 1; if (residueVigor <= 0) { return(string.Empty); } int totalSeconds = residueVigor * m_delta; System.TimeSpan ts = EB.Time.FromPosixTime(m_nextRequestTime) - EB.Time.FromPosixTime(EB.Time.Now); //减去7点半 ts += System.TimeSpan.FromSeconds(totalSeconds); int hours = ts.Hours + ts.Days * 24; int minutes = ts.Minutes; int seconds = ts.Seconds; string timeS = string.Format("{0:00}:{1:00}:{2:00}", hours, minutes, seconds); return(timeS); } return("00:00:00"); }
public void UpdateUI() { if (string.IsNullOrEmpty(Data.id)) { mDMono.gameObject.CustomSetActive(false); return; } else { mDMono.gameObject.CustomSetActive(true); } //m_Have_Label.text = string.Format(HaveFormatStr,EB.Localizer.GetString("ID_LABEL_NAME_HADE"),Data.have); if (m_Discount_Label != null) { m_Discount_Label.text = LTChargeManager.GetDiscountText(Data.discount); m_Discount_Label.gameObject.CustomSetActive(Data.discount > 0 && Data.discount < 1); } int resBalance = BalanceResourceUtil.GetResValue(Data.cost_id); if (resBalance < Data.cost) { m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.RedColor; } else { m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.WhiteColor; } LTUIUtil.AddBlackOutLineToLabel(m_Cost_Label, Data.cost.ToString()); m_Cost_Sprite.spriteName = BalanceResourceUtil.GetResSpriteName(Data.cost_id); if (m_UIResourceComponent != null) { m_UIResourceComponent.m_ResID = Data.cost_id; } m_Item.LTItemData = new LTShowItemData(Data.id, Data.num, Data.type, false); LTIconNameQuality itemInfo = LTItemInfoTool.GetInfo(m_Item.LTItemData.id, m_Item.LTItemData.type, m_Item.LTItemData.coloring); Data.item_name = itemInfo.name; m_Item.Name.applyGradient = false; if (Data.sell_out) { m_Cost_Label.gameObject.CustomSetActive(false); m_Cost_Sprite.gameObject.CustomSetActive(false); m_SellOut_Sprite.gameObject.CustomSetActive(true); m_BuyBtn.enabled = false; } else { m_Cost_Label.gameObject.CustomSetActive(true); m_Cost_Sprite.gameObject.CustomSetActive(true); m_SellOut_Sprite.gameObject.CustomSetActive(false); m_BuyBtn.enabled = true; } }
public void OnReviveBtnClick(GameObject sender) { if (BalanceResourceUtil.GetUserDiamond() < NationManager.Instance.Config.TeamReviveCost) { BalanceResourceUtil.HcLessMessage(); return; } if (isRevive) { return; } isRevive = true; NationManager.Instance.Revive(delegate(bool successful) { if (successful) { for (int i = 0; i < TeamItems.Length; i++) { TeamItems[i].GoOnButton.gameObject.CustomSetActive(true); TeamItems[i].OffBtn.gameObject.CustomSetActive(false); TeamItems[i].TeamData.State = eTeamState.Available; } ReviveButton.gameObject.CustomSetActive(false); TimeButton.gameObject.CustomSetActive(false); MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_NationBattleSelectTeamController_9444")); } }); }
public void OnBattleBtnClick() { FusionAudio.PostEvent("UI/General/ButtonClick"); if (AllianceUtil.GetIsInTransferDart(null)) { return; } if (BalanceResourceUtil.EnterVigorCheck(NewGameConfigTemplateManager.Instance.GetResourceBattleEnterVigor(mInstanceType))) { return; } if (mLeftTimes <= 0) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTResourceInstanceHudController_6819")); } else if (!LTResourceInstanceManager.Instance.IsLevelEnough(mChooseLevel)) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_codefont_in_LTResourceInstanceHudController_7027"), mChooseLevel.level)); } else if (LTResourceInstanceManager.Instance.IsLock(mChooseLevel, mInstanceType)) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTResourceInstanceHudController_7254")); } else { BattleReadyHudController.Open(mActivityTbl.battle_type, StartBattleRequest, mChooseLevel.layout); } }
private void OnBuyTimes() { if (BuyTimes >= Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("worldBossBuyChallengeMaxTimes")) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTResourceShopController_3145")); //�������� return; } float cost = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("worldBossBuyChallengeTimesBase") + Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("worldBossBuyChallengeTimes") * BuyTimes; if (BalanceResourceUtil.GetUserDiamond() < cost)//��ʯ���� { BalanceResourceUtil.HcLessMessage(); return; } var ht = Johny.HashtablePool.Claim(); ht.Add("0", cost); MessageTemplateManager.ShowMessage(902123, ht, delegate(int result) { if (result == 0) { LoadingSpinner.Show(); BuyTimesRequest.SendRequest(); } }); Johny.HashtablePool.Release(ht); }
public void OnBuyTimesButtonClick() { FusionAudio.PostEvent("UI/General/ButtonClick"); int buyCost = HonorArenaManager.Instance.Info.quantity; //购买花费 if (BalanceResourceUtil.GetUserDiamond() < buyCost) { BalanceResourceUtil.HcLessMessage(); return; } var ht = Johny.HashtablePool.Claim(); ht.Add("0", buyCost); MessageTemplateManager.ShowMessage(902123, ht, delegate(int result) { if (result == 0) { HonorArenaManager.Instance.BuyChallengeTimes(delegate(bool successful) { StoneLabel.text = string.Format("{0}", HonorArenaManager.Instance.Info.ticket); }); } }); Johny.HashtablePool.Release(ht); }
//挑战副本 public void OnChallengeBtnClick() { int num = 0; DataLookupsCache.Instance.SearchIntByID("userAwakenCampaign.ticket", out num); if (BalanceResourceUtil.EnterVigorCheck(EnterVigor)) { // MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_PARTNER_AWAKEN_TIP_5")); return; } if (LTAwakeningInstanceConfig.AwakeningIsLock(data.Type)) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_PARTNER_AWAKEN_TIP_7")); return; } int uid = 0; DataLookupsCache.Instance.SearchIntByID("userAwakenCampaign.uid", out uid); System.Action startCombatCallback = delegate() { LTAwakeningInstanceManager.Instance.StartBattle(uid, data.ID); }; BattleReadyHudController.Open(eBattleType.AwakeningBattle, startCombatCallback, data.CombatLayoutName, data.Type); }
public void OnJoystickDragStart() { if (state.Equals("pending")) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_ACTIVITY_NOT_OPEN")); return; } if (curIndex == -1) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_ACTIVITY_LOCKYCAT_TIP5")); return; } //次数判断(是否购买特权) if (VIPTemplateManager.Instance.GetTotalNum(VIPPrivilegeKey.LuckyCat) - curIndex <= 0) { MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_2, EB.Localizer.GetString("ID_ACTIVITY_LOCKYCAT_TIP6"), delegate(int r) { if (r == 0) { GlobalMenuManager.Instance.Open("LTVIPRewardHud"); } }); return; } //材料判断 if (BalanceResourceUtil.GetUserDiamond() < Cur.stage) { BalanceResourceUtil.HcLessMessage(); return; } GetReward(Cur.id, Success, Fail); }
public void OnAddGoldClick() { int gold = BalanceResourceUtil.GetUserGold(); EB.Sparx.Hub.Instance.GetManager <EB.Sparx.ResourcesManager>().SetResRPC("gold", gold + 100000); MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, "您已增加10w金币!"); }
public void OnPositiveBtnClick() { int own = 0; DataLookupsCache.Instance.SearchIntByID(string.Format("res.{0}.v", mCostType), out own); if (own < mCostNum) { BalanceResourceUtil.ResLessMessage(mCostType); return; } if (!btnClickLimit) { return; } btnClickLimit = false; if (PositiveBtnAction != null) { PositiveBtnAction(); } OnCancelButtonClick(); }
private void SetLabelShow(int index, string id, int NeedCount = 0) { bool isRes = false; if (id.Equals(LTResID.HcName) || id.Equals(LTResID.GoldName)) { isRes = true; itemCount = BalanceResourceUtil.GetResValue(id); } else { isRes = false; itemCount = GameItemUtil.GetInventoryItemNum(id); } if (NeedCount > 0) { NeedCountStr = string.Format("/{0}", ApplyNumFormat(NeedCount, isRes)); colorstr = itemCount >= NeedCount ? "[42fe79]" : "[ff6699]"; } else { NeedCountStr = ""; colorstr = "[ffffff]"; } if (NumLabelArray[index].transform.childCount > 0) { NumLabelArray[index].text = NumLabelArray[index].transform.GetChild(0).GetComponent <UILabel>().text = string.Format("{0}{1}[-]{2}", colorstr, ApplyNumFormat(itemCount, isRes), NeedCountStr); } else { NumLabelArray[index].text = string.Format("{0}{1}[-]{2}", colorstr, ApplyNumFormat(itemCount, isRes), NeedCountStr); } }
/// <summary> /// 点击购买抽奖礼包按钮 /// </summary> public void OnCilckDiamondBuyBtn() { if (giftDataList.Count <= curGiftIndex) { EB.Debug.LogError("LTChargeGiftRewadUI OnCilckDiamondBuyBtn is Error, curGiftIndex : {0}, giftDataList.Count : {1}", curGiftIndex, giftDataList.Count); return; } ChargeGiftData data = giftDataList[curGiftIndex]; if (BalanceResourceUtil.GetUserDiamond() < data.coinValue) { BalanceResourceUtil.HcLessMessage(delegate { controller.Close(); }); return; } LTChargeManager.Instance.ReceiveBuyGift(data.id, delegate { GlobalMenuManager.Instance.Open("LTShowRewardView", data.rewardList); giftDataList.RemoveAt(curGiftIndex); if (giftDataList.Count <= 0) { ClearGiftData(); controller.Close(); return; } ArrowObj.CustomSetActive(curGiftType == EGiftType.eDraw && giftDataList != null && giftDataList.Count > 1); curGiftIndex = 0; RefreshDrawUI(giftDataList[0]); }); }
public void OnOKBtnClick() { if (mFreeTimes != 0 && mCost > BalanceResourceUtil.GetUserDiamond()) { BalanceResourceUtil.HcLessMessage(); return; } if (mReviveCount <= 0) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTChallengeInstanceReviveCtrl_1859")); return; } LTInstanceMapModel.Instance.RequestChallengeRevive(delegate { LTChallengeInstanceHpCtrl.RestHpSum(); if (mFreeTimes != 0) { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, -mCost, "挑战副本复活"); } controller.Close(); if (mCallback != null) { mCallback(true); } }); }
/// <summary> /// 设置价格 /// </summary> public void SetMedalCoin() { mCoinNum = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("AllianceMedalCost"); string colorStr = BalanceResourceUtil.GetUserDiamond() >= mCoinNum ? LT.Hotfix.Utility.ColorUtility.WhiteColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal; BuyMedalCoin.text = string.Format("[{0}]{1}[-]", colorStr, mCoinNum); }
private bool isCouldTraining(int trainingId) { var info = LTPromotionManager.Instance.GetPromotion(); if (info == null) { EB.Debug.LogError("LTPromotionUIController.OpenTrainingView -> info is null"); return(false); } if (!LTPromotionManager.Instance.IsTrainingFree(trainingId) && trainingId == 1 && BalanceResourceUtil.GetUserGold() < LTPromotionManager.Instance.GetTrainingCost(trainingId)) { BalanceResourceUtil.ResLessMessage("gold"); return(false); } if (!LTPromotionManager.Instance.IsTrainingFree(trainingId) && trainingId == 2 && BalanceResourceUtil.GetUserDiamond() < LTPromotionManager.Instance.GetTrainingCost(trainingId)) { BalanceResourceUtil.ResLessMessage("hc"); return(false); } if (LTPromotionManager.Instance.GetUsedTrainingTimes(trainingId) >= LTPromotionManager.Instance.GetTrainingTotalTimes(trainingId)) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_BUY_TIMES_NOT_ENOUGH")); return(false); } if (!LTPromotionManager.Instance.HasUnfinishedAttr()) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_PROMOTION_TRAINING_UPPER_LIMIT_TIPS")); return(false); } return(true); }
public void BuyClick(StoreItemData target) { if (target.sell_out) { return; } int isCanBuyMessageId = 0; if (!GameItemUtil.GetItemIsCanBuy(target.id, target.type, out isCanBuyMessageId)) { MessageTemplateManager.ShowMessage(isCanBuyMessageId); return; } int resBalance = BalanceResourceUtil.GetResValue(target.cost_id); if (resBalance < target.cost) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTChallengeInstanceShopCtrl_3630")); return; } LTInstanceMapModel.Instance.RequestChallengeBuyScroll(new[] { mx, my }, target.buy_id, delegate { LTInstanceMapModel.Instance.RequestGetChapterState(() => { }); GlobalMenuManager.Instance.CloseMenu("LTStoreBuyUI"); }); }
public bool CheckRes(string res, int cost, bool showTip = true) { if (res.Equals("hc")) { if (BalanceResourceUtil.GetUserDiamond() < cost) { if (showTip) { BalanceResourceUtil.HcLessMessage(); } return(false); } } else if (res.Equals("gold")) { if (BalanceResourceUtil.GetUserGold() < cost) { if (showTip) { BalanceResourceUtil.GoldLessMessage(); } return(false); } } return(true); }
public void ShowLevelUp() { if (OldData != data) { OldData = data; Show(data.Eid); } string colorStr = (LTPartnerEquipDataManager.Instance.UpLevelSelectList.Count > 0)?"[42fe79]": "[ffffff]"; int totalAddEXP = 0; Dictionary <string, int> Dics = LTPartnerEquipDataManager.Instance.getEquipUpItemNumDic(); foreach (var item in Dics) { totalAddEXP += LTPartnerEquipDataManager.Instance.getEquipUpItemExp(item.Key) * item.Value; } for (int i = 0; i < LTPartnerEquipDataManager.Instance.UpLevelSelectList.Count; i++) { totalAddEXP += LTPartnerEquipDataManager.Instance.GetTotleExpByEid(LTPartnerEquipDataManager.Instance.UpLevelSelectList[i]); } Hotfix_LT.Data.EquipmentLevelUp LevelUpInfo = new Hotfix_LT.Data.EquipmentLevelUp(); bool GetExpInfo = false; for (int i = data.EquipLevel; i < MaxLevel; i++) { if (data.Exp + totalAddEXP < LevelUpList[i].TotalNeedExp) { GetExpInfo = true; LevelUpInfo = LevelUpList[i]; break; } } int OverPlueExp = GetExpInfo? (LevelUpInfo.TotalNeedExp - LevelUpInfo.needExp) : LevelUpList[MaxLevel - 1].TotalNeedExp; int costCount = totalAddEXP; if (totalAddEXP > 0 && !GetExpInfo) { costCount = OverPlueExp - data.Exp; } int temp1 = data.Exp - OverPlueExp + totalAddEXP; int temp2 = LevelUpInfo.needExp; float tempValue = (float )temp1 / (float)temp2; nextExpSlider.value = (LevelUpInfo.level == 0 || (LevelUpInfo.level - 1) > data.EquipLevel)?1: tempValue; nextLevelLabel.text = nextLevelLabel.transform.GetChild(0).GetComponent <UILabel>().text = string.Format("{0}{1}", colorStr, (LevelUpInfo.level - 1) >= 0? (LevelUpInfo.level - 1) : LevelUpList.Count); nextLevelLabel.gameObject.CustomSetActive(((LevelUpInfo.level - 1) >= 0 ? (LevelUpInfo.level - 1) : MaxLevel) != data.EquipLevel); NextLevel = (LevelUpInfo.level - 1) >= 0 ? (LevelUpInfo.level - 1) : MaxLevel; SliderLabel.text = string.Format("{0}{1}/{2}", colorStr, temp1, LevelUpInfo.needExp); int resGold = BalanceResourceUtil.GetUserGold(); string colorStr2 = (costCount > resGold) ? "[ff6699]" : "[ffffff]"; CostLabel.text = CostLabel.transform.GetChild(0).GetComponent <UILabel>().text = string.Format("{0}{1}", colorStr2, costCount); //CostLabel.updateAnchors = UIRect.AnchorUpdate.OnUpdate; CostIcon.UpdateAnchors(); SetUplevelBtn(totalAddEXP > 0); }
public void GetDrawCardItemRequireMsg(int times, System.Action <bool> callback = null) { int CurHC = BalanceResourceUtil.GetUserDiamond(); Api.RequestBuyLotteryItem(times, delegate(Hashtable result) { if (result == null) { if (callback != null) { callback(false); } return; } DataLookupsCache.Instance.CacheData(result); if (callback != null) { callback(result != null); } if (CurHC - BalanceResourceUtil.GetUserDiamond() > 0) { FusionTelemetry.CurrencyChangeData.PostEvent(FusionTelemetry.CurrencyChangeData.hc, BalanceResourceUtil.GetUserDiamond() - CurHC, "购买抽奖券"); } }); }