Skip to content

Commit

Permalink
Merge pull request #614 from AntlerForce/master
Browse files Browse the repository at this point in the history
New top bar graphic, text, and bigger buttons for leave/resume game
  • Loading branch information
AntlerForce authored Mar 27, 2024
2 parents dc2c92b + 55063bc commit 0f3fc11
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
Binary file modified LuaMenu/images/top-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 19 additions & 21 deletions LuaMenu/widgets/chobby/components/interface_root.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function GetInterfaceRoot(optionsParent, mainWindowParent, fontFunction)
local statusButtonWidth = 265
local statusButtonWidthSmall = 265

local topBarHeight = 42
local topBarHeight = 49

-- Switch to single panel mode when below the minimum screen width
local minScreenWidth = 1350
Expand Down Expand Up @@ -909,14 +909,18 @@ function GetInterfaceRoot(optionsParent, mainWindowParent, fontFunction)
-- Top bar initialisation
-------------------------------------------------------------------

local function LeaveGameFunction()
Spring.Reload("")
end

local switchToMenuButton = Button:New {
y = 2,
right = 3,
width = 108,
height = 38,
name = "switchToMenuButton",
caption = "Menu",
objectOverrideFont = WG.Chobby.Configuration:GetFont(2),
objectOverrideFont = WG.Chobby.Configuration:GetFont(3),
parent = ingameInterfaceHolder,
resizable = false,
draggable = false,
Expand All @@ -929,14 +933,13 @@ function GetInterfaceRoot(optionsParent, mainWindowParent, fontFunction)
}
}
local switchToGameButton = Button:New {
y = 2,
right = 3,
width = 150,
height = 38,
x = "50.12%",
right = "30%",
y = 3,
bottom = 9,
name = "switchToGameButton",
caption = "Back to Game",
captionHorAlign = 5,
objectOverrideFont = WG.Chobby.Configuration:GetFont(2),
caption = "Return to Battle",
objectOverrideFont = WG.Chobby.Configuration:GetFont(5),
parent = holder_topBar,
resizable = false,
draggable = false,
Expand All @@ -948,19 +951,14 @@ function GetInterfaceRoot(optionsParent, mainWindowParent, fontFunction)
end
}
}

local function LeaveGameFunction()
Spring.Reload("")
end

local leaveGameButton = Button:New {
y = 2,
right = 156,
width = 108,
height = 38,
x = "30%",
right = "50.12%",
y = 3,
bottom = 9,
name = "leaveGameButton",
caption = "Leave",
objectOverrideFont = WG.Chobby.Configuration:GetFont(2),
caption = "Leave Battle",
objectOverrideFont = WG.Chobby.Configuration:GetFont(5),
parent = holder_topBar,
resizable = false,
draggable = false,
Expand All @@ -981,7 +979,7 @@ function GetInterfaceRoot(optionsParent, mainWindowParent, fontFunction)
file = IMAGE_TOP_BACKGROUND,
parent = holder_topBar,
keepAspect = false,
color = {0, 0, 0, 0.0},
color = {1, 1, 1, 0.87},
}

-------------------------------------------------------------------
Expand Down

0 comments on commit 0f3fc11

Please sign in to comment.