Skip to content

Commit

Permalink
Merge pull request #823 from AntlerForce/master
Browse files Browse the repository at this point in the history
Add a small delay to SayBattle commands when applying presets in multiplayer
  • Loading branch information
AntlerForce authored Nov 25, 2024
2 parents f314554 + 6cc052e commit f78808d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions LuaMenu/widgets/gui_optionpresets_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,16 @@ local function applyPreset(presetName)
-- only apply in multiplayer
local presetMPBattleSettings = presetObj["Multiplayer Battle Settings"]
if presetMPBattleSettings ~= nil and multiplayer and enabledOptions["Multiplayer Battle Settings"] then
battleLobby:SayBattle("!preset " .. presetMPBattleSettings["preset"])
WG.Delay(battleLobby:SayBattle("!preset " .. presetMPBattleSettings["preset"]), 0.25)
if presetMPBattleSettings["locked"] then
battleLobby:SayBattle("!lock")
WG.Delay(battleLobby:SayBattle("!lock"), 0.5)
else
battleLobby:SayBattle("!unlock")
WG.Delay(battleLobby:SayBattle("!unlock"), 0.5)
end
battleLobby:SayBattle("!autobalance " .. presetMPBattleSettings["autoBalance"])
battleLobby:SayBattle("!balanceMode " .. presetMPBattleSettings["balanceMode"])
battleLobby:SayBattle("!set teamSize " .. presetMPBattleSettings["teamSize"])
battleLobby:SayBattle("!nbTeams " .. presetMPBattleSettings["nbTeams"])
WG.Delay(battleLobby:SayBattle("!autobalance " .. presetMPBattleSettings["autoBalance"]), 0.75)
WG.Delay(battleLobby:SayBattle("!balanceMode " .. presetMPBattleSettings["balanceMode"]), 1.0)
WG.Delay(battleLobby:SayBattle("!set teamSize " .. presetMPBattleSettings["teamSize"]), 1.25)
WG.Delay(battleLobby:SayBattle("!nbTeams " .. presetMPBattleSettings["nbTeams"]), 1.5)
end

-- modoptions
Expand Down

0 comments on commit f78808d

Please sign in to comment.