From 19c27ae7bb5267301da30ad44e44f4a18053f32b Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Wed, 5 Jan 2022 10:12:23 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AE=B6=E5=9B=AD=E3=80=91=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View2/GeneralInfoPopup_HomeLandUpgrade.lua | 6 +++--- .../~Lua/Modules/HomeLand/HomeLandManager.lua | 13 ++++++++++++- .../~Lua/Modules/HomeLand/HomeLandPanel.lua | 2 +- .../~Lua/Modules/Net/NetManager.lua | 11 +++++++---- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View2/GeneralInfoPopup_HomeLandUpgrade.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View2/GeneralInfoPopup_HomeLandUpgrade.lua index c48572c70b..11d6c8084b 100644 --- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View2/GeneralInfoPopup_HomeLandUpgrade.lua +++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View2/GeneralInfoPopup_HomeLandUpgrade.lua @@ -37,6 +37,7 @@ function this:InitComponent(gameObject) this.cost1Num1 = Util.GetGameObject(this.Cost,"cost1/Num"):GetComponent("Text") this.cost2Name = Util.GetGameObject(this.Cost,"cost2/Text"):GetComponent("Text") this.cost2Num = Util.GetGameObject(this.Cost,"cost2/Num"):GetComponent("Text") + this.cost2Num.text = "" --fastDone this.fastDoneMoney = Util.GetGameObject(gameObject,"Btns/fastDone/Money") this.fastDoneIcon = Util.GetGameObject(this.fastDoneMoney,"Icon"):GetComponent("Image") @@ -116,11 +117,10 @@ function this:OnShow(_parent,_args) end if curData.Rule then - this.cost2Name.text = HomeLand[curData.Rule[1]].Name - this.cost2Num.text = string.format("%s级",curData.Rule[2]) + local color = HomeLandManager.BuildData[curData.Rule[1]].level < curData.Rule[2] and "FF0000" or "FFEED6" + this.cost2Name.text = string.format("%s到达%s级",color,HomeLand[curData.Rule[1]].Name,curData.Rule[2]) else this.cost2Name.text = "" - this.cost2Num.text = "" end this.fastDoneIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(tonumber(str[2]))) diff --git a/Assets/ManagedResources/~Lua/Modules/HomeLand/HomeLandManager.lua b/Assets/ManagedResources/~Lua/Modules/HomeLand/HomeLandManager.lua index a70da50066..f3ab05686c 100644 --- a/Assets/ManagedResources/~Lua/Modules/HomeLand/HomeLandManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/HomeLand/HomeLandManager.lua @@ -248,10 +248,12 @@ end function this.Check1to5Building() local data = this.BuildData for i = 1, 5 do - if this.singleUpgrade(i) or this.singleGet(i) then + if data[i].dataMain.IsOpen == 1 and (this.singleUpgrade(i) or this.singleGet(i)) then + LogRed("5") return true end end + LogRed("6") return false end @@ -261,9 +263,11 @@ function this.singleUpgrade(id) LogGreen("建筑Id:"..tostring(data.Id)) if BagManager.GetTotalItemNum(data.Cost[1][1]) >= data.Cost[1][2] then--所需材料够 if not data.Rule or (this.BuildData[data.Rule[1]].level >= data.Rule[2]) then--到达升级条件 + LogRed("7") return true end end + LogRed("8") return false end @@ -271,8 +275,10 @@ end function this.singleGet(id) local data = this.BuildData[id] if data.dataMain.Type == 1 and data.dataSingle.Gain then + LogRed("9:"..tostring((GetTimeStamp() - data.startTime)/60*data.dataSingle.Gain[2] >= data.dataSingle.Storage[1][2])) return (GetTimeStamp() - data.startTime)/60*data.dataSingle.Gain[2] >= data.dataSingle.Storage[1][2] end + LogRed("10") return false end @@ -281,9 +287,11 @@ function this.CheckMission() local data = this.SetRewardData() for index, value in ipairs(data) do if value.state == 1 then + LogRed("11") return true end end + LogRed("12") return false end @@ -291,9 +299,11 @@ end function this.CheckEquipUpgrade() for i = 1, 4 do if this.CheckSingleEquipUpgrade(i) then + LogRed("13") return true end end + LogRed("14") return false end @@ -307,6 +317,7 @@ function this.CheckSingleEquipUpgrade(id) bool = true end end + LogRed("15:"..tostring(bool)) return bool end diff --git a/Assets/ManagedResources/~Lua/Modules/HomeLand/HomeLandPanel.lua b/Assets/ManagedResources/~Lua/Modules/HomeLand/HomeLandPanel.lua index fbd0a93dac..8c6a98e378 100644 --- a/Assets/ManagedResources/~Lua/Modules/HomeLand/HomeLandPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/HomeLand/HomeLandPanel.lua @@ -427,7 +427,7 @@ end function HomeLand:SetRedPoint() for i = 1, 5 do - self.mapData[i].RedPoint:SetActive(HomeLandManager.Check1to5Building()) + self.mapData[i].RedPoint:SetActive(HomeLandManager.singleGet(i)) end self.mapData[6].RedPoint:SetActive(HomeLandManager.CheckEquipUpgrade()) self.taskRed:SetActive(HomeLandManager.CheckMission()) diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 21dbffcfed..66ab55aa35 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -6380,10 +6380,13 @@ function NetManager.HomeAllGainRequset(_id,func) msg:ParseFromString(data) -- UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1) if msg.drop and msg.drop.itemlist and msg.drop.itemlist[1] and msg.drop.itemlist[1].itemId then - Timer.New(function() - local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig,msg.drop.itemlist[1].itemId) - PopupTipPanel.ShowColorTip(ItemConfig.Name, Util.LoadSprite(GetSpriteNameByItemId(msg.drop.itemlist[1].itemId)), msg.drop.itemlist[1].itemNum) - end, 0.2, #msg.drop.itemlist):Start() + local thread=coroutine.start(function() + for i = 1, #msg.drop.itemlist do + local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig,msg.drop.itemlist[i].itemId) + PopupTipPanel.ShowColorTip(ItemConfig.Name, Util.LoadSprite(GetSpriteNameByItemId(msg.drop.itemlist[i].itemId)), msg.drop.itemlist[i].itemNum) + coroutine.wait(0.1) + end + end) end this.HomeInfoRequest(function () if func then