Skip to content

Commit

Permalink
Merge pull request #845 from AntlerForce/fixmainmenu
Browse files Browse the repository at this point in the history
Fix main menu not initializing if campaignConfigName is nil
  • Loading branch information
AntlerForce authored Dec 6, 2024
2 parents 2d40461 + 5c7ac5b commit 8e832eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
9 changes: 2 additions & 7 deletions LuaMenu/widgets/chobby/components/interface_root.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1226,15 +1226,8 @@ function GetInterfaceRoot(optionsParent, mainWindowParent, fontFunction)
heading_image.file = Configuration:GetHeadingImage(doublePanelMode, mainWindowHandler.GetSubheadingName())
heading_image:Invalidate()

local replacementTabs = Configuration.gameConfig.singleplayerConfig
--local replacementHelpTabs = Configuration.gameConfig.helpSubmenuConfig

WG.BattleRoomWindow.LeaveBattle(false, true)

mainWindowHandler.OpenSubmenu(1)

--mainWindowHandler.ReplaceSubmenu(SINGLEPLAYER_INDEX, replacementTabs)
--mainWindowHandler.ReplaceSubmenu(HELP_INDEX, replacementHelpTabs)
end
end
Configuration:AddListener("OnConfigurationChange", onConfigurationChange)
Expand Down Expand Up @@ -1266,6 +1259,8 @@ function GetInterfaceRoot(optionsParent, mainWindowParent, fontFunction)
-------------------------------------------------------------------
local screenWidth, screenHeight = Spring.GetViewSizes()

mainWindowHandler.OpenSubmenu(1)

battleStatusPanelHandler.Rescale(2, 70)
rightPanelHandler.Rescale(2, 70)
RescaleMainWindow(3, 70, 50)
Expand Down
5 changes: 0 additions & 5 deletions LuaMenu/widgets/gui_login_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ local function ResetRegisterRecieved()
registerRecieved = false
end

local function LoadMainMenu()
WG.Chobby.interfaceRoot.GetMainWindowHandler().OpenSubmenu(1)
end

local wantLoginStatus = {
["offline"] = true,
["closed"] = true,
Expand Down Expand Up @@ -109,7 +105,6 @@ local function CheckFirstTimeRegister()
end
local Configuration = WG.Chobby.Configuration
if Configuration.firstLoginEver then
LoadMainMenu()
LoginWindowHandler.TryLogin()
end
end
Expand Down

0 comments on commit 8e832eb

Please sign in to comment.