Skip to content

Commit

Permalink
Merge pull request #916 from AntlerForce/master
Browse files Browse the repository at this point in the history
Add Close button to Skirmish and Simple Skirmish panels
  • Loading branch information
AntlerForce authored Feb 15, 2025
2 parents 8772cf5 + 9b0bb56 commit 1d72c2d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
1 change: 1 addition & 0 deletions LuaMenu/widgets/chobby/i18n/chililobby.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ return {
submit = "Submit",
time_in_queue = "Time in queue",
leave = "Leave",
leave_lobby = "Leave Lobby",
invite_friends = "Invite Friends",
users = "Users",
battles = "Battles",
Expand Down
33 changes: 14 additions & 19 deletions LuaMenu/widgets/gui_battle_room_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ local function SetupInfoButtonsPanel(leftInfo, rightInfo, battle, battleID, myUs
if battleLobby.name == "singleplayer" and WG.Chobby.Configuration.simplifiedSkirmishSetup ~= true and config.devMode then
local comboboxstartpostype = ComboBox:New{
name = 'comboboxstartpostype',
x = "67.15%",
right = 13,
x = "60%",
right = 98,
y = 15,
height = 30,
itemHeight = 22,
Expand Down Expand Up @@ -2991,31 +2991,26 @@ local function InitializeControls(battleID, oldLobby, topPoportion, setupData)

local infoHandler = SetupInfoButtonsPanel(leftInfo, rightInfo, battle, battleID, battleLobby:GetMyUserName())

if not isSingleplayer then
local btnQuitBattle = Button:New {
name = 'btnQuitBattle',
right = 12,
y = 7,
width = 160,
height = 45,
objectOverrideFont = WG.Chobby.Configuration:GetFont(3),
caption = "Leave Lobby",
classname = "negative_button",
tooltip = "Leave the multiplayer battleroom",
local btnQuitBattle = Button:New {
name = 'btnQuitBattle',
right = 12,
y = 7,
width = (isSingleplayer and 80) or 160,
height = 45,
objectOverrideFont = WG.Chobby.Configuration:GetFont(3),
caption = (isSingleplayer and i18n("close")) or i18n("leave_lobby"),
classname = "negative_button",
tooltip = (isSingleplayer and "Close the battleroom") or "Leave the multiplayer battleroom",
OnClick = {
function()
battleLobby:LeaveBattle()
if WG and WG.Chobby and
WG.Chobby.interfaceRoot and
WG.Chobby.interfaceRoot.OpenMultiplayerTabByName then

if WG and WG.Chobby and WG.Chobby.interfaceRoot and WG.Chobby.interfaceRoot.OpenMultiplayerTabByName and not isSingleplayer then
WG.Chobby.interfaceRoot.OpenMultiplayerTabByName("multiplayer")
end
end
},
parent = mainWindow,
}
end
}

local btnInviteFriends = Button:New {
name = 'btnInviteFriends',
Expand Down
4 changes: 0 additions & 4 deletions libs/liblobby/lobby/lobby.lua
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,6 @@ function Lobby:JoinBattle(battleID, password, scriptPassword)
end

function Lobby:LeaveBattle()
local myBattleID = self:GetMyBattleID()
if myBattleID then
self:_OnLeaveBattle(myBattleID)
end
return self
end

Expand Down

0 comments on commit 1d72c2d

Please sign in to comment.