我要变强界面匹配当前版本修改

dev_chengFeng
gaoxin 2020-08-26 15:16:17 +08:00
parent dfac8836db
commit 9ff8dbf943
3 changed files with 3153 additions and 58 deletions

View File

@ -101,9 +101,15 @@ function GiveMePowerPanel:InitComponent()
this.groupBox = Util.GetGameObject(this.heroPanel, "demons")
this.heroChoose = Util.GetGameObject(this.heroPanel, "demons/choose")
this.btnAddHero = Util.GetGameObject(this.heroPanel, "demons/add")
this.btnMyGroup = Util.GetGameObject(this.heroPanel, "orggroup")
this.btnAddHero = {}
this.groupBox = {}
for i = 1, 6 do
this.btnAddHero[i] = Util.GetGameObject(this.heroPanel, "demons/add"..i)
this.groupBox[i] = Util.GetGameObject(this.heroPanel, "demons/item"..i)
end
this.curHeroName = Util.GetGameObject(this.heroPanel, "curHero/name"):GetComponent("Text")
this.curHeroProgress = Util.GetGameObject(this.heroPanel, "curHero/progress"):GetComponent("Slider")
this.curHeroGrade = Util.GetGameObject(this.heroPanel, "curHero/progress/Text"):GetComponent("Text")
@ -133,11 +139,13 @@ function GiveMePowerPanel:BindEvent()
Util.AddClick(this.btnMyGroup, function()
--UIManager.OpenPanel(UIName.FormationPanel, FORMATION_TYPE.MAIN)
--JumpManager.GoJump(1013)
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.MAIN)
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.SAVE_FORMATION)
end)
Util.AddClick(this.btnAddHero, function()
JumpManager.GoJump(1023)
for i = 1, 6 do
Util.AddOnceClick(this.btnAddHero[i], function()
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.SAVE_FORMATION)
end)
end
-- 初始化Tab管理器
this.TabCtrl = TabBox.New()
@ -180,29 +188,27 @@ function this.RefreshHeroPanelShow()
--
local power = 0
local formationData = FormationManager.GetFormationByID(FormationManager.curFormationIndex)
for i = 1, 5 do
local go = this.groupBox.transform:GetChild(i-1).gameObject
if formationData.teamHeroInfos[i] then
go:SetActive(true)
local heroDId = formationData.teamHeroInfos[i].heroId
for i = 1, 6 do
this.groupBox[i]:SetActive(false)
this.btnAddHero[i]:SetActive(true)
end
for _, hero in pairs(formationData.teamHeroInfos) do
local pos = hero.position
this.groupBox[pos]:SetActive(true)
this.btnAddHero[pos]:SetActive(false)
local heroDId = hero.heroId
local allEquipAddProVal = HeroManager.CalculateHeroAllProValList(1, heroDId, false)
power = power + allEquipAddProVal[HeroProType.WarPower]
local heroData = HeroManager.GetSingleHeroData(heroDId)
this.SingleHeroDataShow(go, heroData, i)
this.SingleHeroDataShow(this.groupBox[pos], heroData, pos)
if i == 1 then
this.ChooseHero(go, heroData, i)
end
else
go:SetActive(false)
end
end
local heroNum = #formationData.teamHeroInfos
this.btnAddHero:SetActive(heroNum < 5)
if heroNum < 5 then
local pos = this.groupBox.transform:GetChild(heroNum).transform.localPosition
this.btnAddHero.transform.localPosition = pos
if not this._CurHeroIndex or this._CurHeroIndex > pos then
this.ChooseHero(this.groupBox[pos], heroData, pos)
end
end
this.forceValue.text = power
end