【玉虚论道】编队界面提交
parent
f13f1937c7
commit
74f0e3f8a2
File diff suppressed because it is too large
Load Diff
|
|
@ -1174,6 +1174,7 @@ FORMATION_TYPE = {
|
|||
GUILD_TRANSCRIPT=21,
|
||||
FIGHTLEVEL=22,
|
||||
JUMPSERVER_HIGHTLADDER=23,--跨服
|
||||
WORLDARENA=24,--玉虚论道(3队)
|
||||
}
|
||||
|
||||
--活动Type定义
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ this.PanelOptionView = {
|
|||
[FORMATION_TYPE.GUILD_TRANSCRIPT]="Modules/Formation/View/GuildTranscriptFormation",
|
||||
[FORMATION_TYPE.FIGHTLEVEL]="Modules/Formation/View/FightLevelFormation",
|
||||
[FORMATION_TYPE.JUMPSERVER_HIGHTLADDER]="Modules/Formation/View/JumpServerHightLadderFormation",
|
||||
[FORMATION_TYPE.WORLDARENA]="Modules/Formation/View/WorldArenaFormation",
|
||||
}
|
||||
function this:InitComponent()
|
||||
this.spLoader = SpriteLoader.New()
|
||||
|
|
@ -157,6 +158,9 @@ function this:InitComponent()
|
|||
|
||||
--元素共鸣
|
||||
this.ElementalResonanceView = SubUIManager.Open(SubUIConfig.ElementalResonanceView, this.gameObject.transform)
|
||||
--玉虚论道(3队)切换
|
||||
this.switchBar = Util.GetGameObject(self.transform, "SwitchBar")
|
||||
this.switchBar:SetActive(false)
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
|
|
@ -1186,5 +1190,51 @@ function this.SetOneKeyGoExpedition()
|
|||
this.OnClickTabBtn(proId)
|
||||
end
|
||||
|
||||
--设置玉虚论道一键上阵
|
||||
function this.SetOneKeyGoYuXunLunDao()
|
||||
--获取需要上阵的位置
|
||||
local posArr=this.GetPosList()
|
||||
if #posArr==0 then
|
||||
PopupTipPanel.ShowTip(Language[10689])
|
||||
return
|
||||
end
|
||||
local theros = HeroManager.GetAllHeroDatas(limitLevel)
|
||||
theros = ExpeditionManager.GetAllHeroDatas(theros,limitLevel)
|
||||
--按战力从大到小排序
|
||||
table.sort(theros,function(a,b)
|
||||
if a.warPower == b.warPower then
|
||||
return a.id>b.id
|
||||
else
|
||||
return a.warPower > b.warPower
|
||||
end
|
||||
end)
|
||||
--修改 upHeroSidTable 静态id 存储 有则跳过
|
||||
local upHeroSidTable = {}
|
||||
this.order = 0
|
||||
this.choosedList = {}
|
||||
for j = 1, #this.choosedList do
|
||||
local curSingleherodata = HeroManager.GetSingleHeroData(this.choosedList[j].heroId)
|
||||
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
|
||||
end
|
||||
for k, v in ipairs(theros) do
|
||||
local curSingleherodata = HeroManager.GetSingleHeroData(v.dynamicId)
|
||||
local hp = FormationManager.GetFormationHeroHp(this.curFormationIndex,v.dynamicId)
|
||||
if not upHeroSidTable[curSingleherodata.id] and hp > 0 then
|
||||
--LogGreen("this.choosedList "..#this.choosedList)
|
||||
if #this.choosedList < 6 then
|
||||
for n = 1, #posArr do
|
||||
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
|
||||
table.insert(this.choosedList, {heroId = v.dynamicId, position=posArr[n]})
|
||||
table.remove(posArr,n)
|
||||
this.order = this.order + 1
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
this.SetCardsData()
|
||||
this.OnClickTabBtn(proId)
|
||||
end
|
||||
|
||||
return FormationPanelV2
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,115 @@
|
|||
local WorldArenaFormation = {}
|
||||
local this = WorldArenaFormation
|
||||
|
||||
--- 是否需要切换编队的功能
|
||||
this.IsNeedChangeFormation = true
|
||||
|
||||
local checkFunc = function ()
|
||||
for j = 1, #this.lightList do
|
||||
this.lightList[j]:SetActive(false)
|
||||
end
|
||||
this.lightList[this.curIndex]:SetActive(true)
|
||||
end
|
||||
|
||||
local switchFunc = function (type)
|
||||
if type == 1 then
|
||||
if this.curIndex ~= 3 then
|
||||
if this.curIndex == 1 then
|
||||
this.curIndex = 2
|
||||
else
|
||||
this.curIndex = 1
|
||||
end
|
||||
else
|
||||
end
|
||||
else
|
||||
if this.curIndex ~= 1 then
|
||||
if this.curIndex == 3 then
|
||||
this.curIndex = 2
|
||||
else
|
||||
this.curIndex = 3
|
||||
end
|
||||
else
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- 逻辑初始化
|
||||
function this.Init(root,...)
|
||||
this.root = root
|
||||
this.root.bg:SetActive(true)
|
||||
this.root.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main })
|
||||
this.root.btn_1:SetActive(true)
|
||||
this.root.btn_2:SetActive(true)
|
||||
this.root.btn_1_lab.text=Language[10710]
|
||||
this.root.btn_2_lab.text=Language[10715]
|
||||
local temp = {...}
|
||||
this.curIndex = temp[1]
|
||||
LogGreen("this.curIndex:"..tostring(this.curIndex))
|
||||
this.root.switchBar:SetActive(true)
|
||||
|
||||
--左右切换按钮
|
||||
this.btnLeft = Util.GetGameObject(this.root.switchBar,"btnLeft")
|
||||
this.btnRight = Util.GetGameObject(this.root.switchBar,"btnRight")
|
||||
Util.AddOnceClick(this.btnLeft,function ()
|
||||
this.curIndex = (this.curIndex + 2) % 3 == 0 and 3 or (this.curIndex + 2) % 3
|
||||
checkFunc()
|
||||
end)
|
||||
Util.AddOnceClick(this.btnRight,function ()
|
||||
this.curIndex = (this.curIndex + 1) % 3 == 0 and 3 or (this.curIndex + 1) % 3
|
||||
checkFunc()
|
||||
end)
|
||||
|
||||
--交换按钮
|
||||
this.btnSwitch1 = Util.GetGameObject(this.root.switchBar,"GameObject/btnSwitch (1)")
|
||||
this.btnSwitch2 = Util.GetGameObject(this.root.switchBar,"GameObject/btnSwitch (2)")
|
||||
Util.AddOnceClick(this.btnSwitch1,function ()
|
||||
switchFunc(1)
|
||||
checkFunc()
|
||||
end)
|
||||
Util.AddOnceClick(this.btnSwitch2,function ()
|
||||
switchFunc(2)
|
||||
checkFunc()
|
||||
end)
|
||||
|
||||
--单个按钮
|
||||
this.numList = {}
|
||||
this.lightList = {}
|
||||
for i = 1, 3 do
|
||||
this.numList[i] = Util.GetGameObject(this.root.switchBar,"GameObject/num ("..i..")")
|
||||
this.lightList[i] = Util.GetGameObject(this.numList[i],"Image")
|
||||
this.lightList[i]:SetActive(false)
|
||||
Util.AddOnceClick(this.numList[i],function ()
|
||||
FormationManager.currentFormationIndex = this.GetFormationIndex()
|
||||
this.root.RefreshFormation(false,false)
|
||||
this.curIndex = i
|
||||
checkFunc()
|
||||
end)
|
||||
end
|
||||
this.lightList[this.curIndex]:SetActive(true)
|
||||
end
|
||||
--- 获取需要显示的编队id
|
||||
function this.GetFormationIndex()
|
||||
return 2000 + this.curIndex
|
||||
end
|
||||
|
||||
--- 关闭界面事件
|
||||
function this.OnCloseBtnClick()
|
||||
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
||||
this.root:ClosePanel()
|
||||
end
|
||||
|
||||
function this.On_Btn1_Click()
|
||||
this.root.SetOneKeyGoYuXunLunDao()
|
||||
end
|
||||
function this.On_Btn2_Click()
|
||||
if this.root.order>=1 then
|
||||
FormationManager.RefreshFormation(this.root.curFormationIndex, this.root.choosedList,
|
||||
FormationManager.formationList[this.root.curFormationIndex].teamPokemonInfos)
|
||||
PopupTipPanel.ShowTip(Language[10713])
|
||||
this.root:ClosePanel()
|
||||
else
|
||||
PopupTipPanel.ShowTip(string.format(Language[10699], 1))
|
||||
end
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7aae27e374ac84541a5219dd8488af08
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -302,7 +302,7 @@ function this.SetHeadsInfo(data,root,index,name,level)
|
|||
-- UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid)
|
||||
-- end
|
||||
LogGreen("data.uid:"..tostring(data.uid))
|
||||
UIManager.OpenPanel(UIName.WorldArenaOtherTeamPanel, data.uid)
|
||||
UIManager.OpenPanel(UIName.WorldArenaMyTeamPanel, data.uid)
|
||||
end)
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ function WorldArenaMyTeamPanel:SetSingleFormation(go,data,index)
|
|||
title.text = string.format( "第%s队",NumToChinese[index])
|
||||
warPower.text = data.totalForce
|
||||
Util.AddOnceClick(btnChange,function ()
|
||||
PopupTipPanel.ShowTip(string.format( "进入第%s个编队",index))
|
||||
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.WORLDARENA,index)
|
||||
end)
|
||||
|
||||
for i, demon in ipairs(self.Heros[index]) do
|
||||
|
|
|
|||
Loading…
Reference in New Issue