【鸿蒙阵修改】
parent
3b7ff95aaf
commit
3c34072214
|
@ -132,7 +132,7 @@ function HongMengEnvoyPanel:BindEvent()
|
|||
NetManager.UpHongMengGrade(
|
||||
function()
|
||||
-- body
|
||||
LogGreen("回调函数")
|
||||
|
||||
HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv).value = HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv).value + 1
|
||||
if HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv).value >= sum then
|
||||
-- body
|
||||
|
@ -140,30 +140,9 @@ function HongMengEnvoyPanel:BindEvent()
|
|||
self.imageGame:SetActive(false)
|
||||
self.TextGame:SetActive(false)
|
||||
self.UnShowText:SetActive(true)
|
||||
self.UpBtnRedPoint:SetActive(false)
|
||||
end
|
||||
|
||||
local data = HarmonyManager:GetHongMengUpData()
|
||||
|
||||
if Gold >= data.LevelUp[1][2] then
|
||||
-- body
|
||||
self.TextGold.text = string.format("<color=#9e8d6c>%d</color>",data.LevelUp[1][2])
|
||||
if GrowthAmulet >= data.LevelUp[2][2] then
|
||||
self.TextGrowthAmulet.text = string.format("<color=#9e8d6c>%d</color>",data.LevelUp[2][2])
|
||||
else
|
||||
self.TextGrowthAmulet.text = string.format("<color=#E15558>%d</color>",data.LevelUp[2][2])
|
||||
end
|
||||
else
|
||||
self.TextGold.text = string.format("<color=#E15558>%d</color>",data.LevelUp[1][2])
|
||||
LogGreen("变色!!!!!!!!!!!! "..data.LevelUp[1][2])
|
||||
if GrowthAmulet >= data.LevelUp[2][2] then
|
||||
|
||||
self.TextGrowthAmulet.text = string.format("<color=#9e8d6c>%d</color>",data.LevelUp[2][2])
|
||||
else
|
||||
|
||||
self.TextGrowthAmulet.text = string.format("<color=#E15558>%d</color>",data.LevelUp[2][2])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local sum = HarmonyManager:HongMengTowerUpLimit()
|
||||
self.GradeText.text = string.format("%d/%d", HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv).value, sum)
|
||||
--检测红点 UpdateGongMingLv
|
||||
|
@ -269,8 +248,7 @@ function HongMengEnvoyPanel:UpdateShow(list)
|
|||
end
|
||||
|
||||
function HongMengEnvoyPanel:UpdateFun(data)
|
||||
print(data.gridId)
|
||||
|
||||
|
||||
self:RunTimerFun()
|
||||
|
||||
self:UpdateShow(HarmonyManager.hongmengGuards)
|
||||
|
@ -284,8 +262,27 @@ function HongMengEnvoyPanel:ReFeshTextFun(data)
|
|||
|
||||
self.NumText.text = string.format("%d/%d", HeroCount, Box)
|
||||
end
|
||||
function HongMengEnvoyPanel:UpdateTextColor()
|
||||
Gold = BagManager.GetTotalItemNum(UpViewRechargeType.Gold)
|
||||
GrowthAmulet = BagManager.GetTotalItemNum(UpViewRechargeType.GrowthAmulet)
|
||||
--获取当前需要道具数量的数据
|
||||
local data = HarmonyManager:GetHongMengUpData()
|
||||
if Gold >= data.LevelUp[1][2] then
|
||||
-- 是否变色
|
||||
self.TextGold.text = string.format("<color=#F1E7E7>%d</color>",data.LevelUp[1][2])
|
||||
else
|
||||
self.TextGold.text = string.format("<color=#E15558>%d</color>",data.LevelUp[1][2])
|
||||
end
|
||||
if GrowthAmulet >= data.LevelUp[2][2] then
|
||||
self.TextGrowthAmulet.text = string.format("<color=#F1E7E7>%d</color>",data.LevelUp[2][2])
|
||||
else
|
||||
self.TextGrowthAmulet.text = string.format("<color=#E15558>%d</color>",data.LevelUp[2][2])
|
||||
end
|
||||
end
|
||||
function HongMengEnvoyPanel:UpdateGoldVal()
|
||||
self:UpdateTextColor()
|
||||
|
||||
|
||||
end
|
||||
--添加事件监听(用于子类重写)
|
||||
function HongMengEnvoyPanel:AddListener()
|
||||
for i = 1, #self.contents do
|
||||
|
@ -294,7 +291,7 @@ function HongMengEnvoyPanel:AddListener()
|
|||
Game.GlobalEvent:AddEvent(GameEvent.HongMeng.UnLoadHongMengEnvoy, self.UpdateFun, self)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.HongMeng.OnlyRefeshText, self.ReFeshTextFun, self)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.HongMeng.UpHongMengEnvoy, self.UpdateFun, self)
|
||||
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, self.UpdateGoldVal, self)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
|
@ -312,8 +309,7 @@ end
|
|||
function HongMengEnvoyPanel:OnOpen(equipSId)
|
||||
--NetManager.PlayerInfoRequest(LoadingPanel.OnStep)
|
||||
self.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, {showType = UpViewOpenType.ShowLeft})
|
||||
Gold = BagManager.GetTotalItemNum(UpViewRechargeType.Gold)
|
||||
GrowthAmulet = BagManager.GetTotalItemNum(UpViewRechargeType.GrowthAmulet)
|
||||
|
||||
for i = 1, #self.EnvoyItemList do
|
||||
-- body
|
||||
self.EnvoyItemList[i]:OnOpen()
|
||||
|
@ -324,29 +320,7 @@ function HongMengEnvoyPanel:OnOpen(equipSId)
|
|||
end
|
||||
local data = HarmonyManager:GetHongMengUpData()
|
||||
if data then
|
||||
-- body
|
||||
print(data.LevelUp[2][2],GrowthAmulet)
|
||||
if Gold >= data.LevelUp[1][2] then
|
||||
-- body #9e8d6c
|
||||
self.TextGold.text = string.format("<color=#9e8d6c>%d</color>",data.LevelUp[1][2])
|
||||
|
||||
if GrowthAmulet >= data.LevelUp[2][2] then
|
||||
|
||||
self.TextGrowthAmulet.text = string.format("<color=#9e8d6c>%d</color>",data.LevelUp[2][2])
|
||||
else
|
||||
|
||||
self.TextGrowthAmulet.text = string.format("<color=#E15558>%d</color>",data.LevelUp[2][2])
|
||||
end
|
||||
else
|
||||
self.TextGold.text = string.format("<color=#E15558>%d</color>",data.LevelUp[1][2])
|
||||
if GrowthAmulet >= data.LevelUp[2][2] then
|
||||
|
||||
self.TextGrowthAmulet.text = string.format("<color=#9e8d6c>%d</color>",data.LevelUp[2][2])
|
||||
else
|
||||
-- print("222222")
|
||||
self.TextGrowthAmulet.text = string.format("<color=#E15558>%d</color>",data.LevelUp[2][2])
|
||||
end
|
||||
end
|
||||
self:UpdateTextColor()
|
||||
else
|
||||
LogGreen(" error: data is nil ")
|
||||
end
|
||||
|
|
|
@ -69,26 +69,22 @@ function HongMengUnLoadPanel:OnOpen(equipSId)
|
|||
--print(data)
|
||||
local dataRockOne = EquipTreasureManager.GetSingleTreasureByIdDyn(temp_hero.jewels[2])
|
||||
local dataRockTwo = EquipTreasureManager.GetSingleTreasureByIdDyn(temp_hero.jewels[1])
|
||||
if dataRockOne or dataRockTwo then
|
||||
if dataRockOne then
|
||||
-- body
|
||||
if dataRockOne.type == "魂宝" then
|
||||
-- body
|
||||
-- Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = string.format("%d",dataRockOne.oriLv)
|
||||
HunDegree = dataRockOne.oriLv
|
||||
|
||||
else
|
||||
--Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = string.format("%d",dataRockOne.oriLv)
|
||||
LingDegree = dataRockOne.oriLv
|
||||
|
||||
LingDegree = dataRockOne.oriLv
|
||||
end
|
||||
end
|
||||
if dataRockTwo then
|
||||
if dataRockTwo.type == "灵宝" then
|
||||
-- body
|
||||
LingDegree = dataRockTwo.oriLv
|
||||
else
|
||||
HunDegree = dataRockTwo.oriLv
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
this:SetItem(this.ItemOne,HarmonyManager:GetGongMingListSingle(data),0)
|
||||
|
||||
this:SetItem(this.ItemTwo,temp_hero,1)
|
||||
|
|
Loading…
Reference in New Issue