From 958c4286d14267f2c3de92d55ca743c44d9e277e Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Tue, 9 Aug 2022 13:42:59 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B4=9E=E5=BA=9C=E6=91=98=E6=98=9F=E9=98=81]?= =?UTF-8?q?=3D=3D=3D=3D=3D=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Popup/View/GeneralPopup_HomeLandEquip.lua | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HomeLandEquip.lua b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HomeLandEquip.lua index 81841b86c7..e12a850ee1 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HomeLandEquip.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HomeLandEquip.lua @@ -144,16 +144,20 @@ function this:SetData() this.costCondition.text = "" this.costIcon.gameObject:SetActive(true) this.costNum.gameObject:SetActive(true) - + this.costIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[1][1])) local color2 = BagManager.GetTotalItemNum(cost[1][1]) >= cost[1][2] and "#FFEED6" or "red" this.costNum.text = string.format("%s",color2,cost[1][2]) - if cost[2] then + LogError("cost len=="..#cost) + if #cost>1 then this.costIcon2.gameObject:SetActive(true) this.costNum2.gameObject:SetActive(true) this.costIcon2.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[2][1])) local color3 = BagManager.GetTotalItemNum(cost[2][1]) >= cost[2][2] and "#FFEED6" or "red" this.costNum2.text = string.format("%s",color3,cost[2][2]) + else + this.costIcon2.gameObject:SetActive(false) + this.costNum2.gameObject:SetActive(false) end else this.costIcon.gameObject:SetActive(false) @@ -162,7 +166,6 @@ function this:SetData() this.costNum2.gameObject:SetActive(false) this.costCondition.text = string.format("%s需要到达%s级",HomeLand[limit[1]].Name,limit[2]) end - --按钮和tips显示 local bool = HomeLandManager.GetCurIndexBtnsShow() local bool2 = @@ -182,8 +185,19 @@ function this:SetData() this.costCondition.gameObject:SetActive(false) --突破的消耗和升级不同 local cost = EquipRankUp[HomeLandManager.levelProId].Cost - local color2 = BagManager.GetTotalItemNum(cost[1]) >= cost[2] and "#FFEED6" or "red" - this.costNum.text = string.format("%s",color2,cost[2]) + local color2 = BagManager.GetTotalItemNum(cost[1][1]) >= cost[1][2] and "#FFEED6" or "red" + this.costIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[1][1])) + this.costNum.text = string.format("%s",color2,cost[1][2]) + if cost[2] then + this.costIcon2.gameObject:SetActive(true) + this.costNum2.gameObject:SetActive(true) + this.costIcon2.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[2][1])) + local color3 = BagManager.GetTotalItemNum(cost[2][1]) >= cost[2][2] and "#FFEED6" or "red" + this.costNum2.text = string.format("%s",color3,cost[2][2]) + else + this.costIcon2.gameObject:SetActive(false) + this.costNum2.gameObject:SetActive(false) + end end else this.Btn1:SetActive(true)