diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua index 40b32b5d1c..e3c2ecb515 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua @@ -1,6 +1,6 @@ ----- 关卡 ----- -local CarbonFormation = {} -local this = CarbonFormation +local ExploreFormation = {} +local this = ExploreFormation local mainLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig) local SpecialConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,141) --- 是否需要切换编队的功能 @@ -64,18 +64,15 @@ function this.GetOneKeyUpHeroList() end --- btn1点击回调事件 -function this.On_Btn2_Click() +function this.On_Btn2_Click(formationId) if not hadClick then hadClick = true - for k,v in pairs(this.FormationData) do - if k == this.GetFormationIndex() then - FormationManager.SaveFormation(k, this.root.choosedList, - FormationManager.formationList[k].teamPokemonInfos) - else - FormationManager.SaveFormation(k, v.formationinfo, - FormationManager.formationList[k].teamPokemonInfos) - end + if this.FormationData[formationId] then + local formationinfo=this.FormationData[formationId].formationinfo + local teamPokemonInfos=FormationManager.formationList[formationId].teamPokemonInfos + FormationManager.SaveFormation(formationId,formationinfo,teamPokemonInfos) end + end this.root:ClosePanel() end