private void RefreshText() { m_detectBtn.interactable = false; m_restNumText.text = Util.Format(m_restNumTip, moduleBordlands.detectCostDic.Count - moduleBordlands.currentDetectTimes); uint remian = modulePlayer.GetMoneyCount(CurrencySubType.Diamond); m_remainText.text = Util.Format(m_remainTip, remian); PItem2 cost = moduleBordlands.detectCostDic.Get(moduleBordlands.currentDetectTimes); //次数满了 if (cost == null) { //读取上一条数据 PItem2 lastCost = moduleBordlands.detectCostDic.Get(moduleBordlands.currentDetectTimes - 1); if (lastCost != null) { string ss = Util.Format(ConfigText.GetDefalutString(TextForMatType.BorderlandUIText, 13), lastCost.num); Util.SetText(m_costNumText, lastCost.num <= remian ? ss : GeneralConfigInfo.GetNoEnoughColorString(ss)); m_detectBtn.interactable = false; } return; } PropItemInfo prop = ConfigManager.Get <PropItemInfo>(cost.itemTypeId); if (prop == null) { Logger.LogError("detect cost type error,id = {0}", cost.itemTypeId); return; } AtlasHelper.SetCurrencyIcon(m_costImage, (CurrencySubType)prop.subType); remian = modulePlayer.GetMoneyCount((CurrencySubType)prop.subType); Util.SetText(m_remainText, m_remainTip, remian); bool detectBtnVisible = cost.num <= remian && !moduleBordlands.isHasAnyBoss; m_detectBtn.interactable = detectBtnVisible; string str = Util.Format(ConfigText.GetDefalutString(TextForMatType.BorderlandUIText, 13), cost.num); Util.SetText(m_costNumText, cost.num <= remian ? str : GeneralConfigInfo.GetNoEnoughColorString(str)); }
protected override void OnOpen() { isFullScreen = false; m_maskObj = transform.Find("mask").gameObject; m_buyBtn = GetComponent <Button>("buy_btn"); m_cancleBtn = GetComponent <Button>("cancel_btn"); m_buyInfoTip = transform.Find("text_kuang").gameObject; m_buyInfoText = GetComponent <Text>("text_kuang/text"); m_emblemText = GetComponent <Text>("emblem/text"); m_emblemImage = GetComponent <Image>("emblem/yongmu"); m_advCoinText = GetComponent <Text>("coin/text"); EventTriggerListener.Get(m_maskObj).onClick = OnMaskClick; m_buyBtn.onClick.RemoveAllListeners(); m_buyBtn.onClick.AddListener(OnBuyBtnClick); EventTriggerListener.Get(m_cancleBtn.gameObject).onClick = OnMaskClick; AtlasHelper.SetCurrencyIcon(m_emblemImage, CurrencySubType.Emblem); view = GetComponent <ScrollView>("insideframe/scrollView"); dataSource = new DataSource <PShopItem>(null, view, OnSetShopItemInfo, OnClickItem); IniteText(); }
public bool OpenRevivePanel() { if (modulePVE.isStandalonePVE && (modulePVE.rebornItemDic == null || !modulePVE.canRevive || modulePVE.rebornItemDic.Count <= 0)) { return(false); } PItem2 reviveItem = null; int reviveCoin = m_reviveCoinItem != null?moduleEquip.GetPropCount(m_reviveCoinItem.itemTypeId) : 0; if (reviveCoin > 0) { reviveItem = m_reviveCoinItem; } if (reviveItem == null) { reviveItem = modulePVE.rebornItemDic.Get(modulePVE.currentReviveTimes); } if (reviveItem == null) { return(false); } currentReviveCostCount = (int)reviveItem.num; SetPanelVisible(true); //替换公共图片 var info = ConfigManager.Get <PropItemInfo>(reviveItem.itemTypeId); if (info.itemType == PropType.Currency) { AtlasHelper.SetCurrencyIcon(m_costIcon, (CurrencySubType)info.subType); } else { AtlasHelper.SetIcons(m_costIcon, info.icon); } Util.SetText(m_contentText, (int)TextForMatType.CombatUIText, 3, info.itemName); int hasReviveCostCount = 0; if (info.itemType == PropType.Currency) { hasReviveCostCount = info.subType == (byte)CurrencySubType.Diamond ? (int)modulePlayer.roleInfo.diamond : (int)modulePlayer.roleInfo.coin; } else if (info.itemType == PropType.Sundries && info.subType == (int)SundriesSubType.Revive) { hasReviveCostCount = reviveCoin; } else { hasReviveCostCount = moduleEquip.GetPropCount(info.ID); } m_restReviveText.text = string.Format(restReviveTip, (modulePVE.maxReviveTimes - modulePVE.currentReviveTimes)); m_costCountText.text = string.Format(restCountTip, currentReviveCostCount, hasReviveCostCount); bool isReviveBtnEnable = hasReviveCostCount >= currentReviveCostCount && modulePVE.canRevive; m_reviveBtn.SetInteractable(isReviveBtnEnable); //组队模式不暂停AI if (!modulePVE.isTeamMode) { moduleAI.SetAllAIPauseState(true); } return(true); }