Add short game option to GUI
This commit is contained in:
@@ -57,6 +57,9 @@ namespace OpenRA.Mods.Common.Server
|
|||||||
|
|
||||||
if (server.LobbyInfo.GlobalSettings.TechLevel != defaults.TechLevel)
|
if (server.LobbyInfo.GlobalSettings.TechLevel != defaults.TechLevel)
|
||||||
server.SendOrderTo(conn, "Message", "Tech Level: {0}".F(server.LobbyInfo.GlobalSettings.TechLevel));
|
server.SendOrderTo(conn, "Message", "Tech Level: {0}".F(server.LobbyInfo.GlobalSettings.TechLevel));
|
||||||
|
|
||||||
|
if (server.LobbyInfo.GlobalSettings.ShortGame != defaults.ShortGame)
|
||||||
|
server.SendOrderTo(conn, "Message", "Short Game: {0}".F(server.LobbyInfo.GlobalSettings.ShortGame));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,6 +352,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
"fragilealliance {0}".F(!orderManager.LobbyInfo.GlobalSettings.FragileAlliances)));
|
"fragilealliance {0}".F(!orderManager.LobbyInfo.GlobalSettings.FragileAlliances)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var shortGame = optionsBin.GetOrNull<CheckboxWidget>("SHORTGAME_CHECKBOX");
|
||||||
|
if (shortGame != null)
|
||||||
|
{
|
||||||
|
shortGame.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.ShortGame;
|
||||||
|
shortGame.IsDisabled = () => Map.Status != MapStatus.Available || Map.Map.Options.ShortGame.HasValue || configurationDisabled();
|
||||||
|
shortGame.OnClick = () => orderManager.IssueOrder(Order.Command(
|
||||||
|
"shortgame {0}".F(!orderManager.LobbyInfo.GlobalSettings.ShortGame)));
|
||||||
|
}
|
||||||
|
|
||||||
var difficulty = optionsBin.GetOrNull<DropDownButtonWidget>("DIFFICULTY_DROPDOWNBUTTON");
|
var difficulty = optionsBin.GetOrNull<DropDownButtonWidget>("DIFFICULTY_DROPDOWNBUTTON");
|
||||||
if (difficulty != null)
|
if (difficulty != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -122,20 +122,27 @@ Background@LOBBY_OPTIONS_BIN:
|
|||||||
Font: Regular
|
Font: Regular
|
||||||
Text: Fog of War
|
Text: Fog of War
|
||||||
Checkbox@CRATES_CHECKBOX:
|
Checkbox@CRATES_CHECKBOX:
|
||||||
X: 160
|
X: 140
|
||||||
Width: 230
|
Width: 230
|
||||||
Height: 20
|
Height: 20
|
||||||
Font: Regular
|
Font: Regular
|
||||||
Text: Crates Appear
|
Text: Crates
|
||||||
Checkbox@ALLYBUILDRADIUS_CHECKBOX:
|
Checkbox@ALLYBUILDRADIUS_CHECKBOX:
|
||||||
X: 160
|
X: 140
|
||||||
Y: 35
|
Y: 35
|
||||||
Width: 230
|
Width: 230
|
||||||
Height: 20
|
Height: 20
|
||||||
Font: Regular
|
Font: Regular
|
||||||
Text: Build off Ally ConYards
|
Text: Build off Allies' ConYards
|
||||||
|
Checkbox@SHORTGAME_CHECKBOX:
|
||||||
|
X: 365
|
||||||
|
Width: 230
|
||||||
|
Height: 20
|
||||||
|
Font: Regular
|
||||||
|
Text: Short Game
|
||||||
Checkbox@ALLOWCHEATS_CHECKBOX:
|
Checkbox@ALLOWCHEATS_CHECKBOX:
|
||||||
X: 325
|
X: 365
|
||||||
|
Y: 35
|
||||||
Width: 230
|
Width: 230
|
||||||
Height: 20
|
Height: 20
|
||||||
Font: Regular
|
Font: Regular
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ Background@LOBBY_OPTIONS_BIN:
|
|||||||
Children:
|
Children:
|
||||||
Label@TITLE:
|
Label@TITLE:
|
||||||
X: 0
|
X: 0
|
||||||
Y: 30
|
Y: 5
|
||||||
Width: PARENT_RIGHT
|
Width: PARENT_RIGHT
|
||||||
Height: 25
|
Height: 25
|
||||||
Font: Bold
|
Font: Bold
|
||||||
@@ -105,89 +105,94 @@ Background@LOBBY_OPTIONS_BIN:
|
|||||||
Text: Map Options
|
Text: Map Options
|
||||||
Container:
|
Container:
|
||||||
X: 30
|
X: 30
|
||||||
Y: 70
|
Y: 50
|
||||||
Width: PARENT_RIGHT-60
|
Width: PARENT_RIGHT-60
|
||||||
Height: PARENT_BOTTOM-75
|
Height: PARENT_BOTTOM-75
|
||||||
Children:
|
Children:
|
||||||
Checkbox@SHROUD_CHECKBOX:
|
Checkbox@SHROUD_CHECKBOX:
|
||||||
Width: 230
|
Width: 140
|
||||||
Height: 20
|
Height: 20
|
||||||
Text: Shroud
|
Text: Shroud
|
||||||
Checkbox@FOG_CHECKBOX:
|
Checkbox@FOG_CHECKBOX:
|
||||||
Y: 40
|
Y: 35
|
||||||
Width: 230
|
Width: 140
|
||||||
Height: 20
|
Height: 20
|
||||||
Text: Fog of War
|
Text: Fog of War
|
||||||
|
Checkbox@SHORTGAME_CHECKBOX:
|
||||||
|
X: 150
|
||||||
|
Width: 140
|
||||||
|
Height: 20
|
||||||
|
Text: Short Game
|
||||||
Checkbox@CRATES_CHECKBOX:
|
Checkbox@CRATES_CHECKBOX:
|
||||||
X: 125
|
X: 150
|
||||||
Width: 230
|
Y: 35
|
||||||
|
Width: 140
|
||||||
Height: 20
|
Height: 20
|
||||||
Text: Crates Appear
|
Text: Crates
|
||||||
Checkbox@ALLYBUILDRADIUS_CHECKBOX:
|
Checkbox@ALLYBUILDRADIUS_CHECKBOX:
|
||||||
X: 125
|
X: 290
|
||||||
Y: 40
|
Width: 140
|
||||||
Width: 230
|
|
||||||
Height: 20
|
Height: 20
|
||||||
Text: Build off Ally ConYards
|
Text: Build off Allies' ConYards
|
||||||
Checkbox@ALLOWCHEATS_CHECKBOX:
|
|
||||||
X: 320
|
|
||||||
Width: 230
|
|
||||||
Height: 20
|
|
||||||
Text: Debug Menu
|
|
||||||
Checkbox@FRAGILEALLIANCES_CHECKBOX:
|
Checkbox@FRAGILEALLIANCES_CHECKBOX:
|
||||||
X: 320
|
X: 290
|
||||||
Y: 40
|
Y: 35
|
||||||
Width: 220
|
Width: 140
|
||||||
Height: 20
|
Height: 20
|
||||||
Text: Diplomacy Changes
|
Text: Diplomacy Changes
|
||||||
|
Checkbox@ALLOWCHEATS_CHECKBOX:
|
||||||
|
Y: 70
|
||||||
|
Width: 140
|
||||||
|
Height: 20
|
||||||
|
Text: Debug Menu
|
||||||
Label@STARTINGCASH_DESC:
|
Label@STARTINGCASH_DESC:
|
||||||
Y: 87
|
Y: 110
|
||||||
Width: 80
|
Width: 80
|
||||||
Height: 25
|
Height: 25
|
||||||
Text: Starting Cash:
|
Text: Starting Cash:
|
||||||
Align: Right
|
Align: Right
|
||||||
DropDownButton@STARTINGCASH_DROPDOWNBUTTON:
|
DropDownButton@STARTINGCASH_DROPDOWNBUTTON:
|
||||||
X: 85
|
X: 85
|
||||||
Y: 87
|
Y: 110
|
||||||
Width: 130
|
Width: 130
|
||||||
Height: 25
|
Height: 25
|
||||||
Font: Regular
|
Font: Regular
|
||||||
Text: $5000
|
Text: $5000
|
||||||
Label@STARTINGUNITS_DESC:
|
Label@STARTINGUNITS_DESC:
|
||||||
X: PARENT_RIGHT - WIDTH - 145
|
X: PARENT_RIGHT - WIDTH - 145
|
||||||
Y: 87
|
Y: 110
|
||||||
Width: 120
|
Width: 120
|
||||||
Height: 25
|
Height: 25
|
||||||
Text: Starting Units:
|
Text: Starting Units:
|
||||||
Align: Right
|
Align: Right
|
||||||
DropDownButton@STARTINGUNITS_DROPDOWNBUTTON:
|
DropDownButton@STARTINGUNITS_DROPDOWNBUTTON:
|
||||||
X: PARENT_RIGHT - WIDTH
|
X: PARENT_RIGHT - WIDTH
|
||||||
Y: 87
|
Y: 110
|
||||||
Width: 140
|
Width: 140
|
||||||
Height: 25
|
Height: 25
|
||||||
Font: Regular
|
Font: Regular
|
||||||
Label@DIFFICULTY_DESC:
|
Label@DIFFICULTY_DESC:
|
||||||
X: PARENT_RIGHT - WIDTH - 145
|
X: PARENT_RIGHT - WIDTH - 145
|
||||||
Y: 122
|
Y: 150
|
||||||
Width: 120
|
Width: 120
|
||||||
Height: 25
|
Height: 25
|
||||||
Text: Mission Difficulty:
|
Text: Mission Difficulty:
|
||||||
Align: Right
|
Align: Right
|
||||||
DropDownButton@DIFFICULTY_DROPDOWNBUTTON:
|
DropDownButton@DIFFICULTY_DROPDOWNBUTTON:
|
||||||
X: PARENT_RIGHT - WIDTH
|
X: PARENT_RIGHT - WIDTH
|
||||||
Y: 122
|
Y: 150
|
||||||
Width: 140
|
Width: 140
|
||||||
Height: 25
|
Height: 25
|
||||||
Font: Regular
|
Font: Regular
|
||||||
DropDownButton@TECHLEVEL_DROPDOWNBUTTON:
|
DropDownButton@TECHLEVEL_DROPDOWNBUTTON:
|
||||||
X: 85
|
X: 85
|
||||||
Y: 127
|
Y: 150
|
||||||
Width: 130
|
Width: 130
|
||||||
Height: 25
|
Height: 25
|
||||||
Font: Regular
|
Font: Regular
|
||||||
Text: 10
|
Text: 10
|
||||||
Label@TECHLEVEL_DESC:
|
Label@TECHLEVEL_DESC:
|
||||||
Y: 127
|
Y: 150
|
||||||
Width: 80
|
Width: 80
|
||||||
Height: 25
|
Height: 25
|
||||||
Text: Tech Level:
|
Text: Tech Level:
|
||||||
|
|||||||
Reference in New Issue
Block a user