【鸿蒙阵修改】
parent
0454746498
commit
314665aa2d
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -53,7 +53,7 @@ function HarmonyPanel:BindEvent()
|
||||||
end)
|
end)
|
||||||
Util.AddClick(self.helpBtn,function()
|
Util.AddClick(self.helpBtn,function()
|
||||||
|
|
||||||
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.HongMengZhen,self.helpPosition.x,self.helpPosition.y)
|
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.HongMengZhen,self.helpPosition.x,self.helpPosition.y+500)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ local HongmengUp = ConfigManager.GetConfig(ConfigName.HongmengUp)
|
||||||
function this:InitHongMengData(hongmengGuards, hongmengHeroInfos, hongmengTablet, hongmengAdditions)
|
function this:InitHongMengData(hongmengGuards, hongmengHeroInfos, hongmengTablet, hongmengAdditions)
|
||||||
-- body
|
-- body
|
||||||
this.hongmengGuards = hongmengGuards
|
this.hongmengGuards = hongmengGuards
|
||||||
--LogGreen(#this.hongmengGuards)
|
LogGreen(#this.hongmengGuards)
|
||||||
this.hongmengHeroInfos = hongmengHeroInfos
|
this.hongmengHeroInfos = hongmengHeroInfos
|
||||||
LogGreen(#this.hongmengHeroInfos)
|
LogGreen(#this.hongmengHeroInfos)
|
||||||
for i = 1, #this.hongmengGuards do
|
for i = 1, #this.hongmengGuards do
|
||||||
|
@ -225,6 +225,7 @@ end
|
||||||
function this:IsEnvoyCount()
|
function this:IsEnvoyCount()
|
||||||
-- body
|
-- body
|
||||||
local count = 1
|
local count = 1
|
||||||
|
print("228 ",#this.hongmengGuards)
|
||||||
for i = 1, #this.hongmengGuards do
|
for i = 1, #this.hongmengGuards do
|
||||||
-- body
|
-- body
|
||||||
if this.hongmengGuards[i].heroId ~= "" then
|
if this.hongmengGuards[i].heroId ~= "" then
|
||||||
|
|
|
@ -93,7 +93,8 @@ function HongMengEnvoyPanel:BindEvent()
|
||||||
function()
|
function()
|
||||||
--二级共鸣弹窗
|
--二级共鸣弹窗
|
||||||
local count = HarmonyManager:IsEnvoyCount()
|
local count = HarmonyManager:IsEnvoyCount()
|
||||||
if count == 6 then
|
LogGreen(count)
|
||||||
|
if count >= 6 then
|
||||||
-- body
|
-- body
|
||||||
UIManager.OpenPanel(UIName.GongMingResultTips)
|
UIManager.OpenPanel(UIName.GongMingResultTips)
|
||||||
else
|
else
|
||||||
|
|
|
@ -11,10 +11,12 @@ HarmonyView.GongMingTable = {}
|
||||||
HarmonyView.HongMengData = {}
|
HarmonyView.HongMengData = {}
|
||||||
function HarmonyView:InitComponent()
|
function HarmonyView:InitComponent()
|
||||||
local num = self.gameObject.transform.childCount
|
local num = self.gameObject.transform.childCount
|
||||||
for i = 0, num-1 do
|
-- for i = 0, num-1 do
|
||||||
self.GongMingTable[i] =self.gameObject.transform:GetChild(i).gameObject
|
-- self.GongMingTable[i] =self.gameObject.transform:GetChild(i).gameObject
|
||||||
|
-- end
|
||||||
|
for i = 1, 6 do
|
||||||
|
self.GongMingTable[i] = Util.GetGameObject(self.gameObject, "item (" .. i .. ")")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,6 +33,7 @@ function HarmonyView:RemoveListener()
|
||||||
end
|
end
|
||||||
|
|
||||||
function HarmonyView:SetGreen(HongMengData)
|
function HarmonyView:SetGreen(HongMengData)
|
||||||
|
|
||||||
local min = HongMengData[#self.GongMingTable].lv
|
local min = HongMengData[#self.GongMingTable].lv
|
||||||
for i = 0, #self.GongMingTable do
|
for i = 0, #self.GongMingTable do
|
||||||
if HongMengData[i+1].lv == min then
|
if HongMengData[i+1].lv == min then
|
||||||
|
@ -47,52 +50,82 @@ function HarmonyView:InitData(data)
|
||||||
return a.lv > b.lv
|
return a.lv > b.lv
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
return data
|
-- return data
|
||||||
end
|
end
|
||||||
function HarmonyView:OnOpen()
|
function HarmonyView:OnOpen()
|
||||||
-- local heroDataList = HeroManager.GetAllHeroDatas(1);
|
local heroDataList = {}
|
||||||
-- self.HongMengData = self:InitData(heroDataList)
|
if HarmonyManager.hongmengGuards and #HarmonyManager.hongmengGuards > 0 then
|
||||||
|
for i = 1, #HarmonyManager.hongmengGuards do
|
||||||
for i = 1, #HarmonyManager.hongmengGuards do
|
table.insert(heroDataList,HeroManager.GetSingleHeroData(HarmonyManager.hongmengGuards[i].heroId))
|
||||||
self.HongMengData[i] = HeroManager.GetHongMengData(HarmonyManager.hongmengGuards[i].heroId)
|
end
|
||||||
|
end
|
||||||
|
if #heroDataList > 0 then
|
||||||
|
table.sort(heroDataList, function(a,b)
|
||||||
|
if a.lv==b.lv then
|
||||||
|
return a.warPower > b.warPower
|
||||||
|
else
|
||||||
|
return a.lv > b.lv
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
self.count = 0;
|
|
||||||
self.HongMengData = self:InitData(self.HongMengData)
|
|
||||||
|
|
||||||
for i = 1, #self.HongMengData do
|
for i = 1, #self.HongMengData do
|
||||||
-- body
|
|
||||||
for i = 1, #self.HongMengData[i].equipIdList do
|
for i = 1, #self.HongMengData[i].equipIdList do
|
||||||
-- body
|
|
||||||
HarmonyManager.equipCount= HarmonyManager.equipCount+1
|
HarmonyManager.equipCount= HarmonyManager.equipCount+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- print("count",HarmonyManager.equipCount)
|
|
||||||
self:SetGreen(self.HongMengData)
|
-- self.count = 1;
|
||||||
LogGreen(self.count)
|
-- self:SetGreen(self.HongMengData)
|
||||||
for i = 0, #self.GongMingTable do
|
|
||||||
if i == 5 then
|
for i = 1, 6 do
|
||||||
self:SetItem(self.HongMengData[i+1],self.GongMingTable[i],1)
|
local singleHeroData = {}
|
||||||
|
if heroDataList[i] then
|
||||||
|
singleHeroData = heroDataList[i]
|
||||||
|
self.HongMengData[i] = singleHeroData
|
||||||
|
if i== 6 then
|
||||||
|
-- body
|
||||||
|
self:SetItem(self.HongMengData[i],self.GongMingTable[i],1)
|
||||||
|
else
|
||||||
|
self:SetItem(self.HongMengData[i],self.GongMingTable[i],0)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
self:SetItem(self.HongMengData[i+1],self.GongMingTable[i],0)
|
self.HongMengData[i] = singleHeroData
|
||||||
|
self:SetItem(nil,self.GongMingTable[i],0)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
HarmonyManager:SetGuardList(self.HongMengData,(#self.GongMingTable+1))
|
|
||||||
|
-- for i = 0, #self.GongMingTable do
|
||||||
|
-- if i == 5 then
|
||||||
|
-- self:SetItem(self.HongMengData[i+1],self.GongMingTable[i],1)
|
||||||
|
-- else
|
||||||
|
-- self:SetItem(self.HongMengData[i+1],self.GongMingTable[i],0)
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
|
HarmonyManager:SetGuardList(self.HongMengData,#heroDataList)
|
||||||
end
|
end
|
||||||
|
|
||||||
function HarmonyView:SetItem(data,go,flag)
|
function HarmonyView:SetItem(data,go,flag)
|
||||||
Util.GetGameObject(go.transform, "GameObject/frame"):GetComponent("Image").sprite = Util.LoadSprite(GetHeroQuantityImageByquality(data.heroConfig.Quality,data.star))
|
if data then
|
||||||
if flag == 0 then
|
Util.GetGameObject(go.transform,"GameObject/infoGo"):SetActive(true)
|
||||||
Util.GetGameObject(go.transform, "GameObject/lv/Text"):GetComponent("Text").text = data.lv
|
Util.GetGameObject(go.transform, "GameObject/frame"):GetComponent("Image").sprite = Util.LoadSprite(GetHeroQuantityImageByquality(data.heroConfig.Quality,data.star))
|
||||||
|
if flag == 0 then
|
||||||
|
Util.GetGameObject(go.transform, "GameObject/infoGo/lv/Text"):GetComponent("Text").text = data.lv
|
||||||
|
else
|
||||||
|
Util.GetGameObject(go.transform, "GameObject/infoGo/lv/Text"):GetComponent("Text").text = string.format("<color=#0f0>%d</color>",data.lv)
|
||||||
|
end
|
||||||
|
|
||||||
|
Util.GetGameObject(go.transform, "GameObject/icon"):GetComponent("Image").sprite = Util.LoadSprite(data.icon)
|
||||||
|
|
||||||
|
Util.GetGameObject(go.transform, "GameObject/infoGo/proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(data.heroConfig.PropertyName))
|
||||||
|
local starGrid = Util.GetGameObject(go.transform, "GameObject/infoGo/star")
|
||||||
|
SetHeroStars(starGrid, data.star,1,nil,nil,Vector2.New(0,1))
|
||||||
else
|
else
|
||||||
Util.GetGameObject(go.transform, "GameObject/lv/Text"):GetComponent("Text").text = string.format("<color=#0f0>%d</color>",data.lv)
|
Util.GetGameObject(go.transform,"GameObject/infoGo"):SetActive(false)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Util.GetGameObject(go.transform, "GameObject/icon"):GetComponent("Image").sprite = Util.LoadSprite(data.icon)
|
|
||||||
|
|
||||||
Util.GetGameObject(go.transform, "GameObject/proIcon"):GetComponent("Image").sprite = Util.LoadSprite(GetProStrImageByProNum(data.heroConfig.PropertyName))
|
|
||||||
local starGrid = Util.GetGameObject(go.transform, "GameObject/star")
|
|
||||||
SetHeroStars(starGrid, data.star,1,nil,nil,Vector2.New(0,1))
|
|
||||||
end
|
end
|
||||||
return HarmonyView
|
return HarmonyView
|
Loading…
Reference in New Issue