From 489f6f7e3726e3b856ddf7746f66a01088a683ab Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Fri, 10 Sep 2021 21:34:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E5=AF=B9=E6=8B=96=E5=8A=A8=E8=8B=B1?= =?UTF-8?q?=E9=9B=84=E4=BF=9D=E5=AD=98=E9=98=9F=E4=BC=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Formation/FormationPanelV2.lua | 6 +++++ .../WorldArena/WorldArenaBattleInfoPanel.lua | 26 +++++++++++++++++++ .../WorldArena/WorldArenaMainPanel.lua | 7 +++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua index 2e10d821b0..45f0a41cdd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua @@ -559,6 +559,9 @@ end --设置英雄列表数据 function this.SetRoleList(_roleDatas, isTop,isAni) this.SortHeroDatas(_roleDatas) + if this.curFormationIndex==2001 or this.curFormationIndex==2002 or this.curFormationIndex==2003 then + this.opView.RemoveTeamByIndex(this.curFormationIndex) + end -- local curFormation = FormationManager.formationList[this.curFormationIndex] this.scrollView:SetData(_roleDatas, function(index, go) this.SingleHeroDataShow(go, _roleDatas[index]) @@ -732,6 +735,9 @@ function this.SingleHeroDataShow(_go, _heroData) for i,v in pairs(this.choosedList) do if(heroData.dynamicId==v.heroId) then choosedObj:SetActive(true) + if this.curFormationIndex==2001 or this.curFormationIndex==2002 or this.curFormationIndex==2003 then + this.opView.AddHeroToTeam(heroData.dynamicId,v.position,this.curFormationIndex) + end end end if panelType == FORMATION_TYPE.WORLDARENA then diff --git a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaBattleInfoPanel.lua b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaBattleInfoPanel.lua index dc01e7b7f7..bb8d4db1b3 100644 --- a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaBattleInfoPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaBattleInfoPanel.lua @@ -91,6 +91,22 @@ local function OnEndDrag(self, Pointgo, data) curInfo.transform:SetSiblingIndex(1) curInfo.localPosition = Vector3.New(0,-67,0) LogError("起始id=="..currIndex.." 终点id=="..targetIndex) + if currIndex ~= targetIndex then + -- 交换编队数据 + local tempFormation = self.curFormation[2000 + currIndex] + self.curFormation[2000 + currIndex] = self.curFormation[2000 + targetIndex] + self.curFormation[2000 + targetIndex] = tempFormation + -- 保存 + for i = 1, 3 do + local heros = {} + for _, hero in ipairs(self.curFormation[i+2000].teamHeroInfos) do + table.insert(heros, {heroId = hero.heroId, position = hero.position}) + end + FormationManager.SaveFormation(i+2000, heros, + FormationManager.formationList[2001].teamPokemonInfos) + end + + end end --初始化组件(用于子类重写) function WorldArenaBattleInfoPanel:InitComponent() @@ -377,6 +393,16 @@ function WorldArenaBattleInfoPanel:OnOpen(msg,_type,closeFunc,list) end this.ShowInfo(msg) this.RefreshBattleCastInfo() + + self.curFormation = {} + for i = 1, 3 do + local team=FormationManager.GetFormationByID(i+2000) + local cTeam = FormationManager.MakeAEmptyTeam(i+2000) + for j = 1, #team.teamHeroInfos do + table.insert(cTeam.teamHeroInfos, team.teamHeroInfos[j]) + end + self.curFormation[i+2000] = cTeam + end end function this.ShowInfo(msg) diff --git a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMainPanel.lua index d1d5297cfe..dd0262675d 100644 --- a/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaMainPanel.lua @@ -268,10 +268,9 @@ function this.ShowRewardBoxProgressData() return elseif state == 2 then NetManager.CrossYuXuLunDaoGetDailyRewardRequest(i, function(msg) - allBoxGetState[i]=3 - this.ShowRewardBoxProgressData() + allBoxGetState[i]=2 + --this.ShowRewardBoxProgressData() UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1,function () - CheckRedPointStatus(RedPointType.Arena_Reward) end) end) @@ -280,7 +279,7 @@ function this.ShowRewardBoxProgressData() end end this.progressImage.fillAmount = allNums/maxNum - this.progressTipText.text = Language[10102]..allNums..Language[10048] + this.progressTipText.text = "今日挑战" end