Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions LuaMenu/widgets/gui_battle_room_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -958,12 +958,14 @@ local function SetupInfoButtonsPanel(leftInfo, rightInfo, battle, battleID, myUs
--or "Error: Could not retrieve modoptions, your game files may be corrupted or the lobby may be invalid"
or "Game Update may still be downloading"
local modoptionsLoaded = modoptions
local btnModoptions = Button:New {

local devMode = battleLobby.name == "singleplayer" and config.devMode
local btnModoptions, btnReloadModoptions = Button:New {
name = 'btnModoptions',
x = 5,
y = leftOffset,
height = 35,
right = 5,
right = devMode and "25%" or 5,
classname = "option_button",
caption = "Adv Options" .. "\b",
objectOverrideFont = config:GetFont(2),
Expand All @@ -979,6 +981,31 @@ local function SetupInfoButtonsPanel(leftInfo, rightInfo, battle, battleID, myUs
},
parent = leftInfo,
}
if devMode then
btnReloadModoptions = Button:New {
name = 'btnReloadModoptions',
x = "75%",
y = leftOffset,
height = 35,
right = 5,
classname = "option_button",
caption = "🔁",
objectOverrideFont = config:GetFont(2),
objectOverrideDisabledFont = config:GetFont(1),
hasDisabledFont = true,
tooltip = tooltip,
OnClick = {
function()
if modoptionsLoaded then
WG.ModoptionsPanel.LoadModoptions(battle.gameName, battleLobby, true)
WG.ModoptionsPanel.ShowModoptions()
end
end
},
parent = leftInfo,
}
end

leftOffset = leftOffset + 40


Expand Down Expand Up @@ -1164,6 +1191,7 @@ local function SetupInfoButtonsPanel(leftInfo, rightInfo, battle, battleID, myUs
btnPickMap:SetPos(nil, offset)
offset = offset + 38
btnModoptions:SetPos(nil, offset)
if btnReloadModoptions then btnReloadModoptions:SetPos(nil, offset) end
offset = offset + 40
btnOptionPresets:SetPos(nil, offset)
offset = offset + 40
Expand Down
4 changes: 2 additions & 2 deletions LuaMenu/widgets/gui_modoptions_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ function ModoptionsPanel.RefreshModoptions()
end
end

function ModoptionsPanel.LoadModoptions(gameName, newBattleLobby)
function ModoptionsPanel.LoadModoptions(gameName, newBattleLobby, forceReload)
battleLobby = newBattleLobby

if not (gameName and VFS.HasArchive(gameName)) then
Expand All @@ -1065,7 +1065,7 @@ function ModoptionsPanel.LoadModoptions(gameName, newBattleLobby)
return VFS.Include("modoptions.lua", nil, VFS.ZIP)
end

if modoptionsByGame[gameName] then
if modoptionsByGame[gameName] and not forceReload then
modoptions = modoptionsByGame[gameName]
else

Expand Down