【家园】提交

dev_chengFeng
ZhangBiao 2022-01-05 10:12:23 +08:00
parent 5e0c53e322
commit 19c27ae7bb
4 changed files with 23 additions and 9 deletions

View File

@ -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("<color=#%s>%s到达%s级</color>",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])))

View File

@ -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

View File

@ -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())

View File

@ -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