【家园】提交
parent
5e0c53e322
commit
19c27ae7bb
|
@ -37,6 +37,7 @@ function this:InitComponent(gameObject)
|
||||||
this.cost1Num1 = Util.GetGameObject(this.Cost,"cost1/Num"):GetComponent("Text")
|
this.cost1Num1 = Util.GetGameObject(this.Cost,"cost1/Num"):GetComponent("Text")
|
||||||
this.cost2Name = Util.GetGameObject(this.Cost,"cost2/Text"):GetComponent("Text")
|
this.cost2Name = Util.GetGameObject(this.Cost,"cost2/Text"):GetComponent("Text")
|
||||||
this.cost2Num = Util.GetGameObject(this.Cost,"cost2/Num"):GetComponent("Text")
|
this.cost2Num = Util.GetGameObject(this.Cost,"cost2/Num"):GetComponent("Text")
|
||||||
|
this.cost2Num.text = ""
|
||||||
--fastDone
|
--fastDone
|
||||||
this.fastDoneMoney = Util.GetGameObject(gameObject,"Btns/fastDone/Money")
|
this.fastDoneMoney = Util.GetGameObject(gameObject,"Btns/fastDone/Money")
|
||||||
this.fastDoneIcon = Util.GetGameObject(this.fastDoneMoney,"Icon"):GetComponent("Image")
|
this.fastDoneIcon = Util.GetGameObject(this.fastDoneMoney,"Icon"):GetComponent("Image")
|
||||||
|
@ -116,11 +117,10 @@ function this:OnShow(_parent,_args)
|
||||||
end
|
end
|
||||||
|
|
||||||
if curData.Rule then
|
if curData.Rule then
|
||||||
this.cost2Name.text = HomeLand[curData.Rule[1]].Name
|
local color = HomeLandManager.BuildData[curData.Rule[1]].level < curData.Rule[2] and "FF0000" or "FFEED6"
|
||||||
this.cost2Num.text = string.format("%s级",curData.Rule[2])
|
this.cost2Name.text = string.format("<color=#%s>%s到达%s级</color>",color,HomeLand[curData.Rule[1]].Name,curData.Rule[2])
|
||||||
else
|
else
|
||||||
this.cost2Name.text = ""
|
this.cost2Name.text = ""
|
||||||
this.cost2Num.text = ""
|
|
||||||
end
|
end
|
||||||
|
|
||||||
this.fastDoneIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(tonumber(str[2])))
|
this.fastDoneIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(tonumber(str[2])))
|
||||||
|
|
|
@ -248,10 +248,12 @@ end
|
||||||
function this.Check1to5Building()
|
function this.Check1to5Building()
|
||||||
local data = this.BuildData
|
local data = this.BuildData
|
||||||
for i = 1, 5 do
|
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
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
LogRed("6")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -261,9 +263,11 @@ function this.singleUpgrade(id)
|
||||||
LogGreen("建筑Id:"..tostring(data.Id))
|
LogGreen("建筑Id:"..tostring(data.Id))
|
||||||
if BagManager.GetTotalItemNum(data.Cost[1][1]) >= data.Cost[1][2] then--所需材料够
|
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--到达升级条件
|
if not data.Rule or (this.BuildData[data.Rule[1]].level >= data.Rule[2]) then--到达升级条件
|
||||||
|
LogRed("7")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
LogRed("8")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -271,8 +275,10 @@ end
|
||||||
function this.singleGet(id)
|
function this.singleGet(id)
|
||||||
local data = this.BuildData[id]
|
local data = this.BuildData[id]
|
||||||
if data.dataMain.Type == 1 and data.dataSingle.Gain then
|
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]
|
return (GetTimeStamp() - data.startTime)/60*data.dataSingle.Gain[2] >= data.dataSingle.Storage[1][2]
|
||||||
end
|
end
|
||||||
|
LogRed("10")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -281,9 +287,11 @@ function this.CheckMission()
|
||||||
local data = this.SetRewardData()
|
local data = this.SetRewardData()
|
||||||
for index, value in ipairs(data) do
|
for index, value in ipairs(data) do
|
||||||
if value.state == 1 then
|
if value.state == 1 then
|
||||||
|
LogRed("11")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
LogRed("12")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -291,9 +299,11 @@ end
|
||||||
function this.CheckEquipUpgrade()
|
function this.CheckEquipUpgrade()
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
if this.CheckSingleEquipUpgrade(i) then
|
if this.CheckSingleEquipUpgrade(i) then
|
||||||
|
LogRed("13")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
LogRed("14")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -307,6 +317,7 @@ function this.CheckSingleEquipUpgrade(id)
|
||||||
bool = true
|
bool = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
LogRed("15:"..tostring(bool))
|
||||||
return bool
|
return bool
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -427,7 +427,7 @@ end
|
||||||
|
|
||||||
function HomeLand:SetRedPoint()
|
function HomeLand:SetRedPoint()
|
||||||
for i = 1, 5 do
|
for i = 1, 5 do
|
||||||
self.mapData[i].RedPoint:SetActive(HomeLandManager.Check1to5Building())
|
self.mapData[i].RedPoint:SetActive(HomeLandManager.singleGet(i))
|
||||||
end
|
end
|
||||||
self.mapData[6].RedPoint:SetActive(HomeLandManager.CheckEquipUpgrade())
|
self.mapData[6].RedPoint:SetActive(HomeLandManager.CheckEquipUpgrade())
|
||||||
self.taskRed:SetActive(HomeLandManager.CheckMission())
|
self.taskRed:SetActive(HomeLandManager.CheckMission())
|
||||||
|
|
|
@ -6380,10 +6380,13 @@ function NetManager.HomeAllGainRequset(_id,func)
|
||||||
msg:ParseFromString(data)
|
msg:ParseFromString(data)
|
||||||
-- UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1)
|
-- 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
|
if msg.drop and msg.drop.itemlist and msg.drop.itemlist[1] and msg.drop.itemlist[1].itemId then
|
||||||
Timer.New(function()
|
local thread=coroutine.start(function()
|
||||||
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig,msg.drop.itemlist[1].itemId)
|
for i = 1, #msg.drop.itemlist do
|
||||||
PopupTipPanel.ShowColorTip(ItemConfig.Name, Util.LoadSprite(GetSpriteNameByItemId(msg.drop.itemlist[1].itemId)), msg.drop.itemlist[1].itemNum)
|
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig,msg.drop.itemlist[i].itemId)
|
||||||
end, 0.2, #msg.drop.itemlist):Start()
|
PopupTipPanel.ShowColorTip(ItemConfig.Name, Util.LoadSprite(GetSpriteNameByItemId(msg.drop.itemlist[i].itemId)), msg.drop.itemlist[i].itemNum)
|
||||||
|
coroutine.wait(0.1)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
this.HomeInfoRequest(function ()
|
this.HomeInfoRequest(function ()
|
||||||
if func then
|
if func then
|
||||||
|
|
Loading…
Reference in New Issue