【鸿蒙阵bug修改】

dev_chengFeng
guowei 2020-12-24 16:16:53 +08:00
parent 130ee0c212
commit b09bf01c54
3 changed files with 53 additions and 34 deletions

View File

@ -63,7 +63,7 @@ function this.InitHongMengData(hongmengGuards, hongmengHeroInfos, hongmengTablet
end
function this:UpdateHongMengData(hongmengGuards,hongmengAdditions)
function this.UpdateHongMengData(hongmengGuards,hongmengAdditions)
this.hongmengGuards = hongmengGuards
this.hongmengAdditions = hongmengAdditions
print("刷新hongmengGuards")
@ -328,11 +328,15 @@ function this:GetAdditions()
end
function this.GetSingleAdditions(type)
for i = 1, #this.hongmengAdditions do
if this.hongmengAdditions[i].additionType == type then
return this.hongmengAdditions[i].value
if this.hongmengAdditions then
-- body
for i = 1, #this.hongmengAdditions do
if this.hongmengAdditions[i].additionType == type then
return this.hongmengAdditions[i].value
end
end
end
return 0
end
@ -499,13 +503,17 @@ end
function this.RefreshEnvoyPoint()
-- body
for i = 1, #this.hongmengGuards do
if this.hongmengTablet >= this.TowerStartLimit then
-- body
if this.hongmengGuards[i].heroId ~= "" then
for i = 1, #this.hongmengGuards do
-- body
return true
if this.hongmengGuards[i].heroId == "" then
-- body
return true
end
end
end
return false
end

View File

@ -124,10 +124,13 @@ function this.HongMengIndication(buffer)
local msg = HeroInfoProto_pb.HongmengInfoIndication()
msg:ParseFromString(data)
LogGreen("更新数据")
if msg.hongmengGuards or msg.hongmengAdditions then
-- body
for i = 1, #msg.hongmengGuards do
-- body
print(HeroManager.GetSingleHeroData(msg.hongmengGuards[i].heroId).name)
end
HarmonyManager.UpdateHongMengData(msg.hongmengGuards,msg.hongmengAdditions)
end
end

View File

@ -56,9 +56,15 @@ function HarmonyView:OnOpen()
local heroDataList = {}
if HarmonyManager.hongmengGuards and #HarmonyManager.hongmengGuards > 0 then
for i = 1, #HarmonyManager.hongmengGuards do
table.insert(heroDataList,HeroManager.GetSingleHeroData(HarmonyManager.hongmengGuards[i].heroId))
if HarmonyManager.hongmengGuards[i].heroId ~= "" then
-- body
table.insert(heroDataList,HeroManager.GetSingleHeroData(HarmonyManager.hongmengGuards[i].heroId))
LogGreen("刷新"..i)
end
end
end
-- if #heroDataList > 0 then
-- table.sort(heroDataList, function(a,b)
-- if a.lv==b.lv then
@ -68,6 +74,32 @@ function HarmonyView:OnOpen()
-- end
-- end)
-- end
-- self.count = 1;
-- self:SetGreen(self.HongMengData)
--LogGreen(heroDataList[6].name)
for i = 1, 6 do
local singleHeroData = {}
if heroDataList[i] then
singleHeroData = heroDataList[i]
self.HongMengData[i] = singleHeroData
if heroDataList[i].lv== heroDataList[#heroDataList].lv then
-- body
self:SetItem(self.HongMengData[i],self.GongMingTable[i],1)
else
self:SetItem(self.HongMengData[i],self.GongMingTable[i],0)
end
else
self.HongMengData[i] = singleHeroData
self:SetItem(nil,self.GongMingTable[i],0)
end
end
for i = 1, #self.HongMengData do
if self.HongMengData[i] then
-- body
@ -81,30 +113,6 @@ function HarmonyView:OnOpen()
end
end
-- self.count = 1;
-- self:SetGreen(self.HongMengData)
--LogGreen(heroDataList[6].name)
for i = 1, 6 do
local singleHeroData = {}
if heroDataList[i] then
singleHeroData = heroDataList[i]
self.HongMengData[i] = singleHeroData
if self.HongMengData[i].lv== heroDataList[#heroDataList].lv then
-- body
self:SetItem(self.HongMengData[i],self.GongMingTable[i],1)
else
self:SetItem(self.HongMengData[i],self.GongMingTable[i],0)
end
else
self.HongMengData[i] = singleHeroData
self:SetItem(nil,self.GongMingTable[i],0)
end
end
-- for i = 0, #self.GongMingTable do
-- if i == 5 then
-- self:SetItem(self.HongMengData[i+1],self.GongMingTable[i],1)