Merge pull request #3504 from pchote/more-lobby-polish

Overhaul lobby layout
This commit is contained in:
Matthias Mailänder
2013-06-30 10:42:17 -07:00
13 changed files with 549 additions and 362 deletions

View File

@@ -105,6 +105,41 @@ namespace OpenRA.Widgets
panel.Bounds.Height = Math.Min(height, panel.ContentHeight);
AttachPanel(panel);
}
public void ShowDropDown<T>(string panelTemplate, int height, Dictionary<string, IEnumerable<T>> groups, Func<T, ScrollItemWidget, ScrollItemWidget> setupItem)
{
var substitutions = new Dictionary<string,int>() {{ "DROPDOWN_WIDTH", Bounds.Width }};
var panel = (ScrollPanelWidget)Ui.LoadWidget(panelTemplate, null, new WidgetArgs()
{{ "substitutions", substitutions }});
var headerTemplate = panel.Get<ScrollItemWidget>("HEADER");
var itemTemplate = panel.Get<ScrollItemWidget>("TEMPLATE");
panel.RemoveChildren();
foreach (var kv in groups)
{
var group = kv.Key;
if (group.Length > 0)
{
var header = ScrollItemWidget.Setup(headerTemplate, () => true, () => {});
header.Get<LabelWidget>("LABEL").GetText = () => group;
panel.AddChild(header);
}
foreach (var option in kv.Value)
{
var o = option;
var item = setupItem(o, itemTemplate);
var onClick = item.OnClick;
item.OnClick = () => { onClick(); RemovePanel(); };
panel.AddChild(item);
}
}
panel.Bounds.Height = Math.Min(height, panel.ContentHeight);
AttachPanel(panel);
}
}
public class MaskWidget : Widget

View File

@@ -335,46 +335,35 @@ namespace OpenRA.Mods.RA.Server
return true;
}
int teams;
if (!int.TryParse(s, out teams))
int teamCount;
if (!int.TryParse(s, out teamCount))
{
server.SendOrderTo(conn, "Message", "Number of teams could not be parsed: {0}".F(s));
return true;
}
teams = teams.Clamp(1, 8);
var maxTeams = (server.lobbyInfo.Clients.Count(c => c.Slot != null) + 1) / 2;
teamCount = teamCount.Clamp(0, maxTeams);
var players = server.lobbyInfo.Slots
.Select(slot => server.lobbyInfo.Clients.SingleOrDefault(c => c.Slot == slot.Key))
.Where(c => c != null && !server.lobbyInfo.Slots[c.Slot].LockTeam).ToArray();
if (players.Length < 2)
.Select(slot => server.lobbyInfo.ClientInSlot(slot.Key))
.Where(c => c != null && !server.lobbyInfo.Slots[c.Slot].LockTeam);
var assigned = 0;
var playerCount = players.Count();
foreach (var player in players)
{
server.SendOrderTo(conn, "Message", "Not enough players to assign teams");
return true;
}
if (teams > players.Length)
{
server.SendOrderTo(conn, "Message", "Too many teams for the number of players");
return true;
// Free for all
if (teamCount == 0)
player.Team = 0;
// Humans vs Bots
else if (teamCount == 1)
player.Team = player.Bot == null ? 1 : 2;
else
player.Team = assigned++ * teamCount / playerCount + 1;
}
var teamSizes = new int[players.Length];
for (var i = 0; i < players.Length; i++)
teamSizes[i % teams]++;
var playerIndex = 0;
for (var team = 1; team <= teams; team++)
{
for (var teamPlayerIndex = 0; teamPlayerIndex < teamSizes[team - 1]; playerIndex++, teamPlayerIndex++)
{
var cl = players[playerIndex];
if (cl.Bot == null)
cl.State = Session.ClientState.NotReady;
cl.Team = team;
}
}
// All vs Host
if (teams == 1)
client.Team = 2;
server.SyncLobbyInfo();
return true;
}},

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
class KickClientLogic
{
[ObjectCreator.UseCtor]
public KickClientLogic(Widget widget, string clientName, Action<bool> okPressed)
public KickClientLogic(Widget widget, string clientName, Action<bool> okPressed, Action cancelPressed)
{
widget.Get<LabelWidget>("TITLE").GetText = () => "Kick {0}?".F(clientName);
@@ -31,7 +31,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
okPressed(tempBan);
};
widget.Get<ButtonWidget>("CANCEL_BUTTON").OnClick = () => widget.Parent.RemoveChild(widget);
widget.Get<ButtonWidget>("CANCEL_BUTTON").OnClick = () =>
{
widget.Parent.RemoveChild(widget);
cancelPressed();
};
}
}
}

View File

@@ -20,6 +20,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
{
public class LobbyLogic
{
enum PanelType { Players, Options, Kick }
PanelType panel = PanelType.Players;
Widget lobby;
Widget EditablePlayerTemplate, NonEditablePlayerTemplate, EmptySlotTemplate,
EditableSpectatorTemplate, NonEditableSpectatorTemplate, NewSpectatorTemplate;
@@ -37,8 +40,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
readonly Action onExit;
readonly OrderManager orderManager;
public bool TeamGame;
// Listen for connection failures
void ConnectionStateChanged(OrderManager om)
{
@@ -102,7 +103,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
name.GetText = () => orderManager.LobbyInfo.GlobalSettings.ServerName;
UpdateCurrentMap();
Players = Ui.LoadWidget<ScrollPanelWidget>("LOBBY_PLAYER_BIN", lobby, new WidgetArgs());
Players = Ui.LoadWidget<ScrollPanelWidget>("LOBBY_PLAYER_BIN", lobby.Get("PLAYER_BIN_ROOT"), new WidgetArgs());
Players.IsVisible = () => panel == PanelType.Players;
EditablePlayerTemplate = Players.Get("TEMPLATE_EDITABLE_PLAYER");
NonEditablePlayerTemplate = Players.Get("TEMPLATE_NONEDITABLE_PLAYER");
EmptySlotTemplate = Players.Get("TEMPLATE_EMPTY");
@@ -145,102 +148,158 @@ namespace OpenRA.Mods.RA.Widgets.Logic
CountryNames.Add("random", "Any");
var gameStarting = false;
Func<bool> configurationDisabled = () => !Game.IsHost || gameStarting || panel == PanelType.Kick ||
orderManager.LocalClient == null || orderManager.LocalClient.IsReady;
var mapButton = lobby.Get<ButtonWidget>("CHANGEMAP_BUTTON");
mapButton.OnClick = () =>
var mapButton = lobby.GetOrNull<ButtonWidget>("CHANGEMAP_BUTTON");
if (mapButton != null)
{
var onSelect = new Action<Map>(m =>
mapButton.IsDisabled = configurationDisabled;
mapButton.OnClick = () =>
{
orderManager.IssueOrder(Order.Command("map " + m.Uid));
Game.Settings.Server.Map = m.Uid;
Game.Settings.Save();
});
Ui.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs()
{
{ "initialMap", Map.Uid },
{ "onExit", () => {} },
{ "onSelect", onSelect }
});
};
mapButton.IsVisible = () => mapButton.Visible && Game.IsHost;
var assignTeams = lobby.GetOrNull<DropDownButtonWidget>("ASSIGNTEAMS_DROPDOWNBUTTON");
if (assignTeams != null)
{
assignTeams.IsVisible = () => Game.IsHost;
assignTeams.IsDisabled = () => gameStarting || orderManager.LobbyInfo.Clients.Count(c => c.Slot != null) < 2
|| orderManager.LocalClient == null || orderManager.LocalClient.IsReady;
assignTeams.OnMouseDown = _ =>
{
var options = Enumerable.Range(1, orderManager.LobbyInfo.Clients.Count(c => c.Slot != null).Clamp(1, 8) - 1).Select(d => new DropDownOption
var onSelect = new Action<Map>(m =>
{
Title = (d == 1 ? "All vs Host" : "{0} Teams".F(d)),
IsSelected = () => false,
OnClick = () => orderManager.IssueOrder(Order.Command("assignteams {0}".F(d.ToString())))
orderManager.IssueOrder(Order.Command("map " + m.Uid));
Game.Settings.Server.Map = m.Uid;
Game.Settings.Save();
});
Ui.OpenWindow("MAPCHOOSER_PANEL", new WidgetArgs()
{
{ "initialMap", Map.Uid },
{ "onExit", () => {} },
{ "onSelect", onSelect }
});
};
}
var slotsButton = lobby.GetOrNull<DropDownButtonWidget>("SLOTS_DROPDOWNBUTTON");
if (slotsButton != null)
{
slotsButton.IsDisabled = () => configurationDisabled() || panel != PanelType.Players ||
!orderManager.LobbyInfo.Slots.Values.Any(s => s.AllowBots || !s.LockTeam);
var aiModes = Rules.Info["player"].Traits.WithInterface<IBotInfo>().Select(t => t.Name);
slotsButton.OnMouseDown = _ =>
{
var options = new Dictionary<string, IEnumerable<DropDownOption>>();
var botController = orderManager.LobbyInfo.Clients.Where(c => c.IsAdmin).FirstOrDefault();
if (orderManager.LobbyInfo.Slots.Values.Any(s => s.AllowBots))
{
var botOptions = new List<DropDownOption>(){ new DropDownOption()
{
Title = "Add",
IsSelected = () => false,
OnClick = () =>
{
foreach (var slot in orderManager.LobbyInfo.Slots)
{
var bot = aiModes.Random(Game.CosmeticRandom);
var c = orderManager.LobbyInfo.ClientInSlot(slot.Key);
if (slot.Value.AllowBots == true && (c == null || c.Bot != null))
orderManager.IssueOrder(Order.Command("slot_bot {0} {1} {2}".F(slot.Key, botController.Index, bot)));
}
}
}};
if (orderManager.LobbyInfo.Clients.Any(c => c.Bot != null))
{
botOptions.Add(new DropDownOption()
{
Title = "Remove",
IsSelected = () => false,
OnClick = () =>
{
foreach (var slot in orderManager.LobbyInfo.Slots)
{
var c = orderManager.LobbyInfo.ClientInSlot(slot.Key);
if (c != null && c.Bot != null)
orderManager.IssueOrder(Order.Command("slot_open "+slot.Value.PlayerReference));
}
}
});
}
options.Add("Configure Bots", botOptions);
}
var teamCount = (orderManager.LobbyInfo.Slots.Count(s => !s.Value.LockTeam && orderManager.LobbyInfo.ClientInSlot(s.Key) != null) + 1) / 2;
if (teamCount >= 1)
{
var teamOptions = Enumerable.Range(0, teamCount + 1).Reverse().Select(d => new DropDownOption
{
Title = (d > 1 ? "{0} Teams".F(d) : d == 1 ? "Humans vs Bots" : "Free for all"),
IsSelected = () => false,
OnClick = () => orderManager.IssueOrder(Order.Command("assignteams {0}".F(d.ToString())))
});
options.Add("Configure Teams", teamOptions);
}
Func<DropDownOption, ScrollItemWidget, ScrollItemWidget> setupItem = (option, template) =>
{
var item = ScrollItemWidget.Setup(template, option.IsSelected, option.OnClick);
item.Get<LabelWidget>("LABEL").GetText = () => option.Title;
return item;
};
assignTeams.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", options.Count() * 30, options, setupItem);
slotsButton.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 175, options, setupItem);
};
}
var disconnectButton = lobby.Get<ButtonWidget>("DISCONNECT_BUTTON");
disconnectButton.OnClick = () => { CloseWindow(); onExit(); };
var optionsBin = Ui.LoadWidget("LOBBY_OPTIONS_BIN", lobby, new WidgetArgs());
optionsBin.IsVisible = () => panel == PanelType.Options;
var addBotsButton = lobby.Get<ButtonWidget>("ADD_BOTS");
addBotsButton.IsVisible = () => Game.IsHost;
addBotsButton.IsDisabled = () => !Game.IsHost || gameStarting || orderManager.LocalClient == null
|| orderManager.LocalClient.IsReady || !orderManager.LobbyInfo.Slots.Values.Any(s => s.AllowBots);
addBotsButton.OnClick = () => {
var aiModes = Rules.Info["player"].Traits.WithInterface<IBotInfo>().Select(t => t.Name);
foreach (var slot in orderManager.LobbyInfo.Slots)
var optionsButton = lobby.Get<ButtonWidget>("OPTIONS_BUTTON");
optionsButton.IsDisabled = () => panel == PanelType.Kick;
optionsButton.GetText = () => panel == PanelType.Options ? "Players" : "Options";
optionsButton.OnClick = () => panel = (panel == PanelType.Options) ? PanelType.Players : PanelType.Options;
var startGameButton = lobby.GetOrNull<ButtonWidget>("START_GAME_BUTTON");
if (startGameButton != null)
{
startGameButton.IsDisabled = () => configurationDisabled() ||
orderManager.LobbyInfo.Slots.Any(sl => sl.Value.Required && orderManager.LobbyInfo.ClientInSlot(sl.Key) == null);
startGameButton.OnClick = () =>
{
var bot = aiModes.Random(Game.CosmeticRandom);
var c = orderManager.LobbyInfo.ClientInSlot(slot.Key);
if (slot.Value.AllowBots == true && (c == null || c.Bot != null))
orderManager.IssueOrder(Order.Command("slot_bot {0} {1} {2}".F(slot.Key,0,bot)));
}
};
gameStarting = true;
orderManager.IssueOrder(Order.Command("startgame"));
};
}
var allowCheats = lobby.Get<CheckboxWidget>("ALLOWCHEATS_CHECKBOX");
allowCheats.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.AllowCheats;
allowCheats.IsDisabled = () => !Game.IsHost || gameStarting || orderManager.LocalClient == null
|| orderManager.LocalClient.IsReady;
allowCheats.OnClick = () => orderManager.IssueOrder(Order.Command(
// Options panel
var allowCheats = optionsBin.GetOrNull<CheckboxWidget>("ALLOWCHEATS_CHECKBOX");
if (allowCheats != null)
{
allowCheats.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.AllowCheats;
allowCheats.IsDisabled = configurationDisabled;
allowCheats.OnClick = () => orderManager.IssueOrder(Order.Command(
"allowcheats {0}".F(!orderManager.LobbyInfo.GlobalSettings.AllowCheats)));
}
var crates = lobby.GetOrNull<CheckboxWidget>("CRATES_CHECKBOX");
var crates = optionsBin.GetOrNull<CheckboxWidget>("CRATES_CHECKBOX");
if (crates != null)
{
crates.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.Crates;
crates.IsDisabled = () => !Game.IsHost || gameStarting || orderManager.LocalClient == null
|| orderManager.LocalClient.IsReady; // maybe disable the checkbox if a map forcefully removes CrateDrop?
crates.IsDisabled = configurationDisabled;
crates.OnClick = () => orderManager.IssueOrder(Order.Command(
"crates {0}".F(!orderManager.LobbyInfo.GlobalSettings.Crates)));
}
var fragileAlliance = lobby.GetOrNull<CheckboxWidget>("FRAGILEALLIANCES_CHECKBOX");
var fragileAlliance = optionsBin.GetOrNull<CheckboxWidget>("FRAGILEALLIANCES_CHECKBOX");
if (fragileAlliance != null)
{
fragileAlliance.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.FragileAlliances;
fragileAlliance.IsDisabled = () => !Game.IsHost || gameStarting
|| orderManager.LocalClient == null || orderManager.LocalClient.IsReady;
fragileAlliance.IsDisabled = configurationDisabled;
fragileAlliance.OnClick = () => orderManager.IssueOrder(Order.Command(
"fragilealliance {0}".F(!orderManager.LobbyInfo.GlobalSettings.FragileAlliances)));
};
var difficulty = lobby.GetOrNull<DropDownButtonWidget>("DIFFICULTY_DROPDOWNBUTTON");
var difficulty = optionsBin.GetOrNull<DropDownButtonWidget>("DIFFICULTY_DROPDOWNBUTTON");
if (difficulty != null)
{
difficulty.IsVisible = () => Map != null && Map.Difficulties != null && Map.Difficulties.Any();
difficulty.IsDisabled = () => !Game.IsHost || gameStarting || orderManager.LocalClient == null || orderManager.LocalClient.IsReady;
difficulty.IsDisabled = configurationDisabled;
difficulty.GetText = () => orderManager.LobbyInfo.GlobalSettings.Difficulty;
difficulty.OnMouseDown = _ =>
{
@@ -258,17 +317,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
};
difficulty.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", options.Count() * 30, options, setupItem);
};
var difficultyDesc = optionsBin.GetOrNull<LabelWidget>("DIFFICULTY_DESC");
difficultyDesc.IsVisible = difficulty.IsVisible;
}
var startGameButton = lobby.Get<ButtonWidget>("START_GAME_BUTTON");
startGameButton.IsVisible = () => Game.IsHost;
startGameButton.IsDisabled = () => gameStarting
|| orderManager.LobbyInfo.Slots.Any(sl => sl.Value.Required && orderManager.LobbyInfo.ClientInSlot(sl.Key) == null);
startGameButton.OnClick = () =>
{
gameStarting = true;
orderManager.IssueOrder(Order.Command("startgame"));
};
var disconnectButton = lobby.Get<ButtonWidget>("DISCONNECT_BUTTON");
disconnectButton.OnClick = () => { CloseWindow(); onExit(); };
bool teamChat = false;
var chatLabel = lobby.Get<LabelWidget>("LABEL_CHATTYPE");
@@ -367,8 +422,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
void UpdatePlayerList()
{
var idx = 0;
TeamGame = false;
foreach (var kv in orderManager.LobbyInfo.Slots)
{
var key = kv.Key;
@@ -415,9 +468,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
LobbyUtils.SetupEditableFactionWidget(template, slot, client, orderManager, CountryNames);
LobbyUtils.SetupEditableTeamWidget(template, slot, client, orderManager, Map.GetSpawnPoints().Length);
LobbyUtils.SetupEditableReadyWidget(template, slot, client, orderManager);
if (slot.LockTeam || client.Team > 0)
TeamGame = true;
}
else
{ // Non-editable player in slot
@@ -426,7 +476,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
LobbyUtils.SetupClientWidget(template, slot, client, orderManager, client.Bot == null);
LobbyUtils.SetupNameWidget(template, slot, client);
LobbyUtils.SetupKickWidget(template, slot, client, orderManager, lobby);
LobbyUtils.SetupKickWidget(template, slot, client, orderManager, lobby,
() => panel = PanelType.Kick, () => panel = PanelType.Players);
LobbyUtils.SetupColorWidget(template, slot, client);
LobbyUtils.SetupFactionWidget(template, slot, client, CountryNames);
LobbyUtils.SetupTeamWidget(template, slot, client);
@@ -468,7 +519,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
template = NonEditableSpectatorTemplate.Clone();
LobbyUtils.SetupNameWidget(template, null, client);
LobbyUtils.SetupKickWidget(template, null, client, orderManager, lobby);
LobbyUtils.SetupKickWidget(template, null, client, orderManager, lobby,
() => panel = PanelType.Kick, () => panel = PanelType.Players);
}
LobbyUtils.SetupClientWidget(template, null, c, orderManager, true);

View File

@@ -38,21 +38,25 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public static void ShowSlotDropDown(DropDownButtonWidget dropdown, Session.Slot slot,
Session.Client client, OrderManager orderManager)
{
var options = new List<SlotDropDownOption>()
var options = new Dictionary<string, IEnumerable<SlotDropDownOption>>() {{"Slot", new List<SlotDropDownOption>()
{
new SlotDropDownOption("Open", "slot_open "+slot.PlayerReference, () => (!slot.Closed && client == null)),
new SlotDropDownOption("Closed", "slot_close "+slot.PlayerReference, () => slot.Closed)
};
}}};
var bots = new List<SlotDropDownOption>();
if (slot.AllowBots)
{
foreach (var b in Rules.Info["player"].Traits.WithInterface<IBotInfo>().Select(t => t.Name))
{
var bot = b;
var botController = orderManager.LobbyInfo.Clients.Where(c => c.IsAdmin).FirstOrDefault();
options.Add(new SlotDropDownOption("Bot: {0}".F(bot),
bots.Add(new SlotDropDownOption(bot,
"slot_bot {0} {1} {2}".F(slot.PlayerReference, botController.Index, bot),
() => client != null && client.Bot == bot));
}
}
options.Add(bots.Any() ? "Bots" : "Bots Disabled", bots);
Func<SlotDropDownOption, ScrollItemWidget, ScrollItemWidget> setupItem = (o, itemTemplate) =>
{
@@ -63,7 +67,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return item;
};
dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 150, options, setupItem);
dropdown.ShowDropDown<SlotDropDownOption>("LABEL_DROPDOWN_TEMPLATE", 167, options, setupItem);
}
public static void ShowTeamDropDown(DropDownButtonWidget dropdown, Session.Client client,
@@ -262,17 +266,23 @@ namespace OpenRA.Mods.RA.Widgets.Logic
slot.IsVisible = () => false;
}
public static void SetupKickWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, Widget lobby)
public static void SetupKickWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, Widget lobby, Action before, Action after)
{
var button = parent.Get<ButtonWidget>("KICK");
button.IsVisible = () => Game.IsHost && c.Index != orderManager.LocalClient.Index;
button.IsDisabled = () => orderManager.LocalClient.IsReady;
Action<bool> okPressed = tempBan => orderManager.IssueOrder(Order.Command("kick {0} {1}".F(c.Index, tempBan)));
button.OnClick = () => Game.LoadWidget(null, "KICK_CLIENT_DIALOG", lobby, new WidgetArgs
Action<bool> okPressed = tempBan => { orderManager.IssueOrder(Order.Command("kick {0} {1}".F(c.Index, tempBan))); after(); };
button.OnClick = () =>
{
{ "clientName", c.Name },
{ "okPressed", okPressed }
});
before();
Game.LoadWidget(null, "KICK_CLIENT_DIALOG", lobby, new WidgetArgs
{
{ "clientName", c.Name },
{ "okPressed", okPressed },
{ "cancelPressed", after }
});
};
}
public static void SetupEditableColorWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, ColorPreviewManagerWidget colorPreview)

View File

@@ -46,6 +46,18 @@ ScrollPanel@LABEL_DROPDOWN_TEMPLATE:
Width:DROPDOWN_WIDTH
Background:panel-black
Children:
ScrollItem@HEADER:
Width:PARENT_RIGHT-27
Height:13
X:2
Y:0
Visible:false
Children:
Label@LABEL:
Font:TinyBold
Width:PARENT_RIGHT
Height:10
Align:Center
ScrollItem@TEMPLATE:
Width:PARENT_RIGHT-27
Height:25
@@ -136,10 +148,10 @@ Container@CONFIRM_PROMPT:
Background@KICK_CLIENT_DIALOG:
X:15
Y:30
Width:503
Width:501
Height:219
Logic:KickClientLogic
Background:panel-black
Background:scrollpanel-bg
Children:
Label@TITLE:
X:0
@@ -183,4 +195,50 @@ Background@KICK_CLIENT_DIALOG:
Width:120
Height:25
Text:Cancel
Font:Bold
Background@LOBBY_OPTIONS_BIN:
X:15
Y:30
Width:501
Height:219
Background:scrollpanel-bg
Children:
Label@TITLE:
X:0
Y:50
Width:PARENT_RIGHT
Height:25
Font:Bold
Align:Center
Text: Map Options
Checkbox@ALLOWCHEATS_CHECKBOX:
X:150
Y:80
Width:80
Height:20
Text:Enable Cheats / Debug Menu
Checkbox@CRATES_CHECKBOX:
X:150
Y:110
Width:80
Height:20
Text:Enable Crates
Checkbox@FRAGILEALLIANCES_CHECKBOX:
X:150
Y:140
Width:80
Height:20
Text:Allow Team Changes
Label@DIFFICULTY_DESC:
X:150
Y:170
Width:120
Height:25
Text:Mission Difficulty:
DropDownButton@DIFFICULTY_DROPDOWNBUTTON:
X:265
Y:170
Width:100
Height:25
Font:Bold

View File

@@ -1,9 +1,9 @@
ScrollPanel@LOBBY_PLAYER_BIN:
X:15
Y:30
Width:503
ItemSpacing:5
Width:501
Height:219
ItemSpacing:5
Children:
Container@TEMPLATE_EDITABLE_PLAYER:
X:5
@@ -94,7 +94,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
ImageName:checked
Checkbox@STATUS_CHECKBOX:
Visible:false
X:448
X:446
Y:2
Width:20
Height:20
@@ -129,11 +129,10 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Width:11
Height:25
Label@NAME:
Text:Name
Width:185
Height:25
X:15
X:20
Y:0-1
Width:180
Height:25
Button@KICK:
Width:25
Height:25
@@ -174,7 +173,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Y:0
Image@STATUS_IMAGE:
Visible:false
X:450
X:448
Y:4
Width:20
Height:20
@@ -195,16 +194,15 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Font:Regular
Visible:false
Label@NAME:
Text:Name
Width:200
Height:25
X:15
X:20
Y:0-1
Width:195
Height:25
Visible:false
Button@JOIN:
Text:Play in this slot
Font:Regular
Width:315-55
Width:257
Height:25
X:210
Y:0
@@ -283,11 +281,10 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Width:11
Height:25
Label@NAME:
Text:Name
Width:185
Height:25
X:15
X:20
Y:0-1
Width:180
Height:25
Button@KICK:
Text:X
Width:25
@@ -306,14 +303,14 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Container@TEMPLATE_NEW_SPECTATOR:
X:5
Y:0
Width:475
Width:474
Height:25
Visible:false
Children:
Button@SPECTATE:
Text:Spectate
Font:Regular
Width:455
Width:453
Height:25
X:15
Y:0

View File

@@ -83,39 +83,36 @@ Container@SERVER_LOBBY:
Align:Center
Font:Bold
Label@STATUS:
X:448
X:446
Width:20
Height:25
Text:Ready
Align:Left
Font:Bold
Checkbox@ALLOWCHEATS_CHECKBOX:
Container@PLAYER_BIN_ROOT:
Button@OPTIONS_BUTTON:
X:15
Y:257
Width:130
Height:20
Text: Debug Menu
Checkbox@CRATES_CHECKBOX:
X:160
Y:257
Width:80
Height:20
Text: Crates
Button@ADD_BOTS:
X:398-120-10
Y:255
Width:120
Y:254
Width:112
Height:25
Text:Add Bots
Font:Bold
DropDownButton@ASSIGNTEAMS_DROPDOWNBUTTON:
X:398
Y:255
Width:120
DropDownButton@SLOTS_DROPDOWNBUTTON:
X:132
Y:254
Width:150
Height:25
Font:Bold
Visible:false
Text:Assign
Text:Slot Admin
Button@CHANGEMAP_BUTTON:
X:287
Y:254
Width:112
Height:25
Text:Change Map
Button@START_GAME_BUTTON:
X:404
Y:254
Width:112
Height:25
Text:Start Game
ScrollPanel@CHAT_DISPLAY:
X:15
Y:285
@@ -159,27 +156,15 @@ Container@SERVER_LOBBY:
Align:Right
Text:Chat:
Button@DISCONNECT_BUTTON:
X:0
X:600
Y:499
Width:140
Height:35
Text:Leave Game
Button@MUSIC_BUTTON:
X:150
Y:499
Width:140
Height:35
Text:Music
Button@CHANGEMAP_BUTTON:
X:450
Y:499
Width:140
Height:35
Text:Change Map
Button@START_GAME_BUTTON:
X:600
Y:499
Width:140
Height:35
Text:Start Game
Text:Music
TooltipContainer@TOOLTIP_CONTAINER:

View File

@@ -2,7 +2,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
X:20
Y:67
ItemSpacing:5
Width:504
Width:535
Height:235
Children:
Container@TEMPLATE_EDITABLE_PLAYER:
@@ -37,21 +37,20 @@ ScrollPanel@LOBBY_PLAYER_BIN:
TextField@NAME:
Text:Name
X:15
Width:135
Width:165
Height:25
MaxLength:16
DropDownButton@SLOT_OPTIONS:
Text:Name
X:15
Width:135
Width:165
Height:25
Font:Regular
Visible:false
DropDownButton@COLOR:
X:190
Width:80
Height:25
X:160
Y:0
Children:
ColorBlock@COLORBLOCK:
X:5
@@ -59,37 +58,35 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Width:PARENT_RIGHT-35
Height:PARENT_BOTTOM-12
DropDownButton@FACTION:
X:280
Width:130
Height:25
X:250
Y:0
Children:
Image@FACTIONFLAG:
Width:23
Height:23
X:5
X:4
Y:2
Label@FACTIONNAME:
Text:Faction
Width:70
Height:25
X:30
X:34
Y:0
DropDownButton@TEAM:
Text:Team
X:420
Width:48
Height:25
X:390
Y:0
Text:Team
Checkbox@STATUS_CHECKBOX:
X:448
X:477
Y:2
Width:20
Height:20
Visible:false
Image@STATUS_IMAGE:
Visible:false
X:450
X:479
Y:4
Width:20
Height:20
@@ -127,7 +124,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Height:25
Label@NAME:
Text:Name
Width:130
Width:165
Height:25
X:20
Y:0-1
@@ -135,41 +132,41 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Text:X
Width:25
Height:23
X:125
X:155
Y:2
Font:Bold
ColorBlock@COLORBLOCK:
X:165
X:195
Y:6
Width:45
Height:13
Container@FACTION:
Width:130
Width:160
Height:25
X:250
X:280
Y:0
Children:
Image@FACTIONFLAG:
Width:23
Height:23
X:5
X:4
Y:2
Label@FACTIONNAME:
Text:Faction
Width:60
Height:25
X:40
X:34
Y:0
Label@TEAM:
Text:Team
Width:23
Height:25
Align:Center
X:390
X:420
Y:0
Image@STATUS_IMAGE:
Visible:false
X:450
X:479
Y:4
Width:20
Height:20
@@ -184,13 +181,13 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Children:
Label@NAME:
Text:Name
Width:130
Width:165
Height:25
X:20
Y:0-1
DropDownButton@SLOT_OPTIONS:
Text:Name
Width:135
Width:165
Height:25
X:15
Y:0
@@ -199,7 +196,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Text:Play in this slot
Width:278
Height:25
X:160
X:190
Y:0
Container@TEMPLATE_EDITABLE_SPECTATOR:
X:5
@@ -233,14 +230,14 @@ ScrollPanel@LOBBY_PLAYER_BIN:
TextField@NAME:
Text:Name
X:15
Width:135
Width:165
Height:25
MaxLength:16
Label@SPECTATOR:
Text:Spectator
Width:278
Height:25
X:160
X:190
Y:0
Align:Center
Font:Bold
@@ -275,7 +272,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Height:25
Label@NAME:
Text:Name
Width:130
Width:160
Height:25
X:20
Y:0-1
@@ -283,14 +280,14 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Text:X
Width:25
Height:23
X:125
X:155
Y:2
Font:Bold
Label@SPECTATOR:
Text:Spectator
Width:278
Height:25
X:160
X:190
Y:0
Align:Center
Font:Bold
@@ -306,5 +303,25 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Font:Regular
Width:278
Height:25
X:160
Y:0
X:190
Y:0
ScrollPanel@RACE_DROPDOWN_TEMPLATE:
Width:DROPDOWN_WIDTH
Children:
ScrollItem@TEMPLATE:
Width:PARENT_RIGHT-27
Height:25
X:2
Y:0
Visible:false
Children:
Image@FLAG:
X:2
Y:2
Width:30
Height:15
Label@LABEL:
X:30
Width:70
Height:25

View File

@@ -1,6 +1,18 @@
ScrollPanel@LABEL_DROPDOWN_TEMPLATE:
Width:DROPDOWN_WIDTH
Children:
ScrollItem@HEADER:
Width:PARENT_RIGHT-27
Height:13
X:2
Y:0
Visible:false
Children:
Label@LABEL:
Font:TinyBold
Width:PARENT_RIGHT
Height:10
Align:Center
ScrollItem@TEMPLATE:
Width:PARENT_RIGHT-27
Height:25
@@ -13,26 +25,6 @@ ScrollPanel@LABEL_DROPDOWN_TEMPLATE:
Width:PARENT_RIGHT-20
Height:25
ScrollPanel@RACE_DROPDOWN_TEMPLATE:
Width:DROPDOWN_WIDTH
Children:
ScrollItem@TEMPLATE:
Width:PARENT_RIGHT-27
Height:25
X:2
Y:0
Visible:false
Children:
Image@FLAG:
X:5
Y:5
Width:30
Height:15
Label@LABEL:
X:40
Width:60
Height:25
ScrollPanel@TEAM_DROPDOWN_TEMPLATE:
Width:DROPDOWN_WIDTH
Children:

View File

@@ -1,7 +1,7 @@
Background@KICK_CLIENT_DIALOG:
X:20
Y:67
Width:504
Width:535
Height:235
Logic:KickClientLogic
Background:dialog3
@@ -48,4 +48,50 @@ Background@KICK_CLIENT_DIALOG:
Width:120
Height:25
Text:Cancel
Font:Bold
Background@LOBBY_OPTIONS_BIN:
X:20
Y:67
Width:535
Height:235
Background:dialog3
Children:
Label@TITLE:
X:0
Y:50
Width:PARENT_RIGHT
Height:25
Font:Bold
Align:Center
Text: Map Options
Checkbox@ALLOWCHEATS_CHECKBOX:
X:150
Y:80
Width:80
Height:20
Text:Enable Cheats / Debug Menu
Checkbox@CRATES_CHECKBOX:
X:150
Y:110
Width:80
Height:20
Text:Enable Crates
Checkbox@FRAGILEALLIANCES_CHECKBOX:
X:150
Y:140
Width:80
Height:20
Text:Allow Team Changes
Label@DIFFICULTY_DESC:
X:150
Y:170
Width:120
Height:25
Text:Mission Difficulty:
DropDownButton@DIFFICULTY_DROPDOWNBUTTON:
X:265
Y:170
Width:100
Height:25
Font:Bold

View File

@@ -2,7 +2,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
X:20
Y:67
ItemSpacing:5
Width:504
Width:535
Height:235
Children:
Container@TEMPLATE_EDITABLE_PLAYER:
@@ -37,21 +37,20 @@ ScrollPanel@LOBBY_PLAYER_BIN:
TextField@NAME:
Text:Name
X:15
Width:135
Width:165
Height:25
MaxLength:16
DropDownButton@SLOT_OPTIONS:
Text:Name
X:15
Width:135
Width:165
Height:25
Font:Regular
Visible:false
DropDownButton@COLOR:
X:190
Width:80
Height:25
X:160
Y:0
Children:
ColorBlock@COLORBLOCK:
X:5
@@ -59,10 +58,9 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Width:PARENT_RIGHT-35
Height:PARENT_BOTTOM-12
DropDownButton@FACTION:
X:280
Width:130
Height:25
X:250
Y:0
Children:
Image@FACTIONFLAG:
Width:30
@@ -76,20 +74,19 @@ ScrollPanel@LOBBY_PLAYER_BIN:
X:40
Y:0
DropDownButton@TEAM:
Text:Team
X:420
Width:48
Height:25
X:390
Y:0
Text:Team
Checkbox@STATUS_CHECKBOX:
X:448
X:477
Y:2
Width:20
Height:20
Visible:false
Image@STATUS_IMAGE:
Visible:false
X:450
X:479
Y:4
Width:20
Height:20
@@ -127,7 +124,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Height:25
Label@NAME:
Text:Name
Width:130
Width:165
Height:25
X:20
Y:0-1
@@ -135,18 +132,18 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Text:X
Width:25
Height:23
X:125
X:155
Y:2
Font:Bold
ColorBlock@COLORBLOCK:
X:165
X:195
Y:6
Width:45
Height:13
Container@FACTION:
Width:130
Width:160
Height:25
X:250
X:280
Y:0
Children:
Image@FACTIONFLAG:
@@ -165,11 +162,11 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Width:23
Height:25
Align:Center
X:390
X:420
Y:0
Image@STATUS_IMAGE:
Visible:false
X:450
X:479
Y:4
Width:20
Height:20
@@ -184,13 +181,13 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Children:
Label@NAME:
Text:Name
Width:130
Width:165
Height:25
X:20
Y:0-1
DropDownButton@SLOT_OPTIONS:
Text:Name
Width:135
Width:165
Height:25
X:15
Y:0
@@ -199,7 +196,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Text:Play in this slot
Width:278
Height:25
X:160
X:190
Y:0
Container@TEMPLATE_EDITABLE_SPECTATOR:
X:5
@@ -233,14 +230,14 @@ ScrollPanel@LOBBY_PLAYER_BIN:
TextField@NAME:
Text:Name
X:15
Width:135
Width:165
Height:25
MaxLength:16
Label@SPECTATOR:
Text:Spectator
Width:278
Height:25
X:160
X:190
Y:0
Align:Center
Font:Bold
@@ -275,7 +272,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Height:25
Label@NAME:
Text:Name
Width:130
Width:160
Height:25
X:20
Y:0-1
@@ -283,14 +280,14 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Text:X
Width:25
Height:23
X:125
X:155
Y:2
Font:Bold
Label@SPECTATOR:
Text:Spectator
Width:278
Height:25
X:160
X:190
Y:0
Align:Center
Font:Bold
@@ -306,5 +303,25 @@ ScrollPanel@LOBBY_PLAYER_BIN:
Font:Regular
Width:278
Height:25
X:160
Y:0
X:190
Y:0
ScrollPanel@RACE_DROPDOWN_TEMPLATE:
Width:DROPDOWN_WIDTH
Children:
ScrollItem@TEMPLATE:
Width:PARENT_RIGHT-27
Height:25
X:2
Y:0
Visible:false
Children:
Image@FLAG:
X:5
Y:5
Width:30
Height:15
Label@LABEL:
X:40
Width:60
Height:25

View File

@@ -10,78 +10,116 @@ Background@SERVER_LOBBY:
X:0
Y:17
Align:Center
Width:530
Width:PARENT_RIGHT
Height:20
Font:Bold
Label@MAP_TITLE:
X:532
Y:17
Align:Center
Width:250
Height:20
Font:Bold
Background@LOBBY_MAP_BG:
X:PARENT_RIGHT-268
Y:50
Width:252
Height:252
Background@MAP_BG:
X:PARENT_RIGHT-20-WIDTH
Y:67
Width:214
Height:214
Background:dialog3
Children:
MapPreview@MAP_PREVIEW:
X:4
Y:4
Width:244
Height:244
X:2
Y:2
Width:210
Height:210
TooltipContainer:TOOLTIP_CONTAINER
Label@MAP_TITLE:
X:PARENT_RIGHT-20-WIDTH
Y:282
Width:214
Height:25
Font:Bold
Align:Center
Label@MAP_TYPE:
X:PARENT_RIGHT-20-WIDTH
Y:297
Width:214
Height:25
Font:TinyBold
Align:Center
Label@MAP_AUTHOR:
X:PARENT_RIGHT-20-WIDTH
Y:310
Width:214
Height:25
Font:Tiny
Align:Center
Container@LABEL_CONTAINER:
X:25
Y:40
Children:
Label@LABEL_LOBBY_NAME:
Width:150
Height:25
X:0
Y:0
Width:180
Height:25
Text:Name
Align:Center
Font:Bold
Label@LABEL_LOBBY_COLOR:
X:190
Width:80
Height:25
X:160
Y:0
Text:Color
Align:Center
Font:Bold
Label@LABEL_LOBBY_FACTION:
X:280
Width:130
Height:25
X:250
Y:0
Text:Faction
Align:Center
Font:Bold
Label@LABEL_LOBBY_TEAM:
X:420
Width:48
Height:25
X:390
Y:0
Text:Team
Align:Center
Font:Bold
Label@LABEL_LOBBY_STATUS:
X:448
Y:0
X:477
Width:20
Height:25
Text:Ready
Align:Left
Font:Bold
Container@PLAYER_BIN_ROOT:
DropDownButton@SLOTS_DROPDOWNBUTTON:
X:20
Y:PARENT_BOTTOM - 291
Width:151
Height:25
Font:Bold
Text:Slot Admin
Button@OPTIONS_BUTTON:
X:178
Y:PARENT_BOTTOM - 291
Width:121
Height:25
Font:Bold
Text:Game Options
Button@CHANGEMAP_BUTTON:
X:306
Y:PARENT_BOTTOM - 291
Width:121
Height:25
Text:Change Map
Font:Bold
Button@START_GAME_BUTTON:
X:434
Y:PARENT_BOTTOM - 291
Width:121
Height:25
Text:Start Game
Font:Bold
ScrollPanel@CHAT_DISPLAY:
X:20
Y:PARENT_BOTTOM - 289
Width:PARENT_RIGHT - 200
Height:230
Y:PARENT_BOTTOM - HEIGHT - 52
Width:760
Height:210
ItemSpacing:1
Children:
Container@CHAT_TEMPLATE:
@@ -106,77 +144,24 @@ Background@SERVER_LOBBY:
Height:15
WordWrap:true
VAlign:Top
Label@LABEL_CHATTYPE:
Width:65
Height:25
X:0
Y:PARENT_BOTTOM - 50
Text:Chat:
Align:Right
TextField@CHAT_TEXTFIELD:
X:70
Y:PARENT_BOTTOM - 49
Width:550
X:20
Y:PARENT_BOTTOM - HEIGHT - 20
Width:PARENT_RIGHT - 167
Height:25
Button@CHANGEMAP_BUTTON:
X:PARENT_RIGHT-154
Y:PARENT_BOTTOM-289
Width:120
Height:25
Text:Change Map
Font:Bold
Button@ADD_BOTS:
X:PARENT_RIGHT-154
Y:PARENT_BOTTOM-(289-25-5)
Width:120
Height:25
Text:Add Bots
Font:Bold
DropDownButton@ASSIGNTEAMS_DROPDOWNBUTTON:
X:PARENT_RIGHT-154
Y:PARENT_BOTTOM-229
Width:120
Height:25
Font:Bold
Visible:false
Text:Assign
DropDownButton@DIFFICULTY_DROPDOWNBUTTON:
X:PARENT_RIGHT-154
Y:PARENT_BOTTOM-199
Width:120
Height:25
Font:Bold
Visible:false
Checkbox@ALLOWCHEATS_CHECKBOX:
X: PARENT_RIGHT-154
Y: PARENT_BOTTOM-169
Width: 80
Height: 20
Text: Allow Cheats
Checkbox@CRATES_CHECKBOX:
X: PARENT_RIGHT-154
Y: PARENT_BOTTOM-144
Width: 80
Height: 20
Text: Crates
Checkbox@FRAGILEALLIANCES_CHECKBOX:
X: PARENT_RIGHT-154
Y: PARENT_BOTTOM-119
Width: 80
Height: 20
Text: Fragile Alliances
LeftMargin:50
Children:
Label@LABEL_CHATTYPE:
Y:0-1
Width:45
Height:25
Align:Right
Text:Chat:
Button@DISCONNECT_BUTTON:
X:PARENT_RIGHT-154
Y:PARENT_BOTTOM-94
X:PARENT_RIGHT - WIDTH - 20
Y:PARENT_BOTTOM - HEIGHT - 20
Width:120
Height:25
Text:Disconnect
Font:Bold
Button@START_GAME_BUTTON:
X:PARENT_RIGHT-154
Y:PARENT_BOTTOM-49
Width:120
Height:25
Text:Start Game
Font:Bold
TooltipContainer@TOOLTIP_CONTAINER: