Skip to content

Commit

Permalink
Merge pull request #680 from AntlerForce/caribou
Browse files Browse the repository at this point in the history
Make modoptions panel resizeable
  • Loading branch information
AntlerForce authored May 12, 2024
2 parents d61c0a2 + 1d26b1d commit 745c3af
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion LuaMenu/widgets/gui_modoptions_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ local function CreateModoptionWindow()
width = math.min(1366, ww - 50),
height = math.min(720, wh - 50),
resizable = true,
draggable = true,
draggable = false,
classname = "main_window",
}

Expand Down Expand Up @@ -493,6 +493,24 @@ local function CreateModoptionWindow()
}

local popupHolder = WG.Chobby.PriorityPopup(modoptionsSelectionWindow, CancelFunc, AcceptFunc)

WG.Chobby.lobbyInterfaceHolder.OnResize = WG.Chobby.lobbyInterfaceHolder.OnResize or {}
WG.Chobby.lobbyInterfaceHolder.OnResize[#WG.Chobby.lobbyInterfaceHolder.OnResize +1] = function()
local ww, wh = Spring.GetWindowGeometry()

local neww = math.min(1366, ww - 50)
local newx = (WG.Chobby.lobbyInterfaceHolder.width - neww) / 2

local newh = math.min(720, wh - 50)
local newy = (WG.Chobby.lobbyInterfaceHolder.height - newh) / 2

modoptionsSelectionWindow:SetPos(
newx,
newy,
neww,
newh
)
end
end

local function getModOptionByKey(key)
Expand Down

0 comments on commit 745c3af

Please sign in to comment.