From 0f611408b8f7afb3873c3723f36ab2b1fd4d6d98 Mon Sep 17 00:00:00 2001
From: jiaoyangna <17610272109@lianjingshidai.com>
Date: Tue, 7 Jul 2020 17:51:02 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=88=E6=88=90=E8=A3=85=E5=A4=87=E5=88=B7?=
=?UTF-8?q?=E6=96=B0=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Compound/view/CompoundPanel_Equip.lua | 20 +++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua b/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua
index b1a992fa02..53e6acb241 100644
--- a/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua
+++ b/Assets/ManagedResources/~Lua/Modules/Compound/view/CompoundPanel_Equip.lua
@@ -23,7 +23,8 @@ local curNeedEquip = {}
local curSelectEquip = {}
local curSelectGO
local materidaIsCan = false
-local bagPosEquips = {}
+local bagPosEquips = {}
+local needGoldNum = 0
function this:InitComponent(gameObject)
this.tabBox = Util.GetGameObject(gameObject, "CompoundPanel_Equip/TabBox")
this.needGoldText = Util.GetGameObject(gameObject, "CompoundPanel_Equip/compoundBtn/needGoldText"):GetComponent("Text")
@@ -66,14 +67,27 @@ function this:BindEvent()
end
function this:AddListener()
+ Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold,this.ShowGoldNum0)
end
function this:RemoveListener()
+ Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold,this.ShowGoldNum0)
+end
+
+function this.ShowGoldNum0()
+ if needGoldNum > BagManager.GetItemCountById(14) then
+ materidaIsCan = false
+ this.needGoldText.text = string.format("%s", needGoldNum)
+ else
+ materidaIsCan = true
+ this.needGoldText.text =string.format("%s", needGoldNum)
+ end
end
function this:OnShow(...)
curIndex = 1
sortingOrder =0
+ needGoldNum=0
this.TabCtrl = TabBox.New()
this.TabCtrl:SetTabAdapter(this.TabAdapter)
this.TabCtrl:SetChangeTabCallBack(this.SwitchView)
@@ -118,7 +132,7 @@ function this.ShowTitleData(curEquipStarsConfig)
this.ShowGoldNum(equipStarsConfig[curSelectEquip.Star - 1],compoundNum)
end
function this.ShowGoldNum(upEquipStarsConfig,compoundNum)
- local needGoldNum = compoundNum * upEquipStarsConfig.RankupResources[1][2]
+ needGoldNum = compoundNum * upEquipStarsConfig.RankupResources[1][2]
if needGoldNum > BagManager.GetItemCountById(upEquipStarsConfig.RankupResources[1][1]) then
materidaIsCan = false
this.needGoldText.text = string.format("%s", needGoldNum)
@@ -330,9 +344,11 @@ function this.SwitchView(index)
end
function this:OnClose()
+ needGoldNum=0
end
function this:OnDestroy()
+ needGoldNum=0
end
return this
\ No newline at end of file