Tweaks. The primary button feels better on the right.

This commit is contained in:
Paul Chote
2011-05-08 11:24:03 +12:00
parent c9dd1aa4bd
commit 9f4eba9003
5 changed files with 113 additions and 113 deletions

View File

@@ -89,14 +89,14 @@ namespace OpenRA.Mods.Cnc.Widgets
progressText.IsVisible = () => searchStatus != SearchStatus.Hidden; progressText.IsVisible = () => searchStatus != SearchStatus.Hidden;
progressText.GetText = ProgressLabelText; progressText.GetText = ProgressLabelText;
// Map preview
var preview = panel.GetWidget<MapPreviewWidget>("MAP_PREVIEW");
preview.Map = () => CurrentMap();
preview.IsVisible = () => CurrentMap() != null;
// Server info // Server info
var infoPanel = panel.GetWidget("SERVER_INFO"); var infoPanel = panel.GetWidget("SERVER_INFO");
infoPanel.IsVisible = () => currentServer != null; infoPanel.IsVisible = () => currentServer != null;
var preview = infoPanel.GetWidget<MapPreviewWidget>("MAP_PREVIEW");
preview.Map = () => CurrentMap();
preview.IsVisible = () => CurrentMap() != null;
infoPanel.GetWidget<LabelWidget>("SERVER_IP").GetText = () => currentServer.Address; infoPanel.GetWidget<LabelWidget>("SERVER_IP").GetText = () => currentServer.Address;
infoPanel.GetWidget<LabelWidget>("SERVER_MODS").GetText = () => ServerBrowserDelegate.GenerateModsLabel(currentServer); infoPanel.GetWidget<LabelWidget>("SERVER_MODS").GetText = () => ServerBrowserDelegate.GenerateModsLabel(currentServer);
infoPanel.GetWidget<LabelWidget>("MAP_TITLE").GetText = () => (CurrentMap() != null) ? CurrentMap().Title : "Unknown"; infoPanel.GetWidget<LabelWidget>("MAP_TITLE").GetText = () => (CurrentMap() != null) ? CurrentMap().Title : "Unknown";
@@ -160,7 +160,7 @@ namespace OpenRA.Mods.Cnc.Widgets
var game = loop; var game = loop;
var template = serverTemplate.Clone() as ContainerWidget; var template = serverTemplate.Clone() as ContainerWidget;
template.GetBackground = () => (currentServer == game) ? "dialog2" : null; template.GetBackground = () => (currentServer == game) ? "panel-darkred" : null;
template.OnMouseDown = mi => { if (mi.Button != MouseButton.Left) return false; currentServer = game; return true; }; template.OnMouseDown = mi => { if (mi.Button != MouseButton.Left) return false; currentServer = game; return true; };
template.IsVisible = () => true; template.IsVisible = () => true;
template.GetWidget<LabelWidget>("TITLE").GetText = () => game.Name; template.GetWidget<LabelWidget>("TITLE").GetText = () => game.Name;

View File

@@ -44,17 +44,17 @@ Container@DIRECTCONNECT_PANEL:
Y:50 Y:50
Width:200 Width:200
Height:25 Height:25
CncMenuButton@JOIN_BUTTON: CncMenuButton@BACK_BUTTON:
Id:JOIN_BUTTON Id:BACK_BUTTON
X:0 X:0
Y:89 Y:89
Width:140 Width:140
Height:35 Height:35
Text:Join Text:Back
CncMenuButton@BACK_BUTTON: CncMenuButton@JOIN_BUTTON:
Id:BACK_BUTTON Id:JOIN_BUTTON
X:230 X:230
Y:89 Y:89
Width:140 Width:140
Height:35 Height:35
Text:Back Text:Join

View File

@@ -335,7 +335,7 @@ Container@SERVER_LOBBY:
Children: Children:
Container@CHAT_TEMPLATE: Container@CHAT_TEMPLATE:
Id:CHAT_TEMPLATE Id:CHAT_TEMPLATE
Width:PARENT_RIGHT-28 Width:PARENT_RIGHT-27
Height:14 Height:14
X:2 X:2
Y:0 Y:0
@@ -357,27 +357,27 @@ Container@SERVER_LOBBY:
Height:14 Height:14
Width:PARENT_RIGHT - 100 - 10 Width:PARENT_RIGHT - 100 - 10
WordWrap:true WordWrap:true
CncMenuButton@START_GAME_BUTTON: CncMenuButton@DISCONNECT_BUTTON:
Id:START_GAME_BUTTON Id:DISCONNECT_BUTTON
X:0 X:0
Y:499 Y:499
Width:140 Width:140
Height:35 Height:35
Text:Start Game Text:Leave Game
CncMenuButton@CHANGEMAP_BUTTON: CncMenuButton@CHANGEMAP_BUTTON:
Id:CHANGEMAP_BUTTON Id:CHANGEMAP_BUTTON
X:150 X:450
Y:499 Y:499
Width:140 Width:140
Height:35 Height:35
Text:Change Map Text:Change Map
CncMenuButton@DISCONNECT_BUTTON: CncMenuButton@START_GAME_BUTTON:
Id:DISCONNECT_BUTTON Id:START_GAME_BUTTON
X:600 X:600
Y:499 Y:499
Width:140 Width:140
Height:35 Height:35
Text:Leave Game Text:Start Game
Background@COLOR_CHOOSER: Background@COLOR_CHOOSER:
Id:COLOR_CHOOSER Id:COLOR_CHOOSER
Background:dialog2 Background:dialog2

View File

@@ -40,7 +40,7 @@ Container@MAP_CHOOSER:
Children: Children:
Container@MAP_TEMPLATE: Container@MAP_TEMPLATE:
Id:MAP_TEMPLATE Id:MAP_TEMPLATE
Width:PARENT_RIGHT-28 Width:PARENT_RIGHT-27
Height:25 Height:25
X:2 X:2
Y:0 Y:0

View File

@@ -23,11 +23,11 @@ Container@SERVERBROWSER_PANEL:
X:15 X:15
Y:30 Y:30
Width:710 Width:710
Height:300 Height:315
Children: Children:
Container@SERVER_TEMPLATE: Container@SERVER_TEMPLATE:
Id:SERVER_TEMPLATE Id:SERVER_TEMPLATE
Width:PARENT_RIGHT-28 Width:PARENT_RIGHT-27
Height:25 Height:25
X:2 X:2
Y:0 Y:0
@@ -103,102 +103,102 @@ Container@SERVERBROWSER_PANEL:
Font:Bold Font:Bold
Align:Center Align:Center
Visible:false Visible:false
Background@INFO_BG: Background@MAP_BG:
X:15 X:15
Y:345 Y:355
Width:710 Width:130
Height:140 Height:130
Background:panel-gray Background:panel-gray
Children: Children:
Container@SERVER_INFO: MapPreview@MAP_PREVIEW:
Id:SERVER_INFO Id:MAP_PREVIEW
Width:PARENT_RIGHT X:1
Height:PARENT_BOTTOM Y:1
Visible:false Width:128
Height:128
Container@SERVER_INFO:
Id:SERVER_INFO
Width:PARENT_RIGHT
Height:PARENT_BOTTOM
Visible:false
Children:
Container@STATS_BIN:
X:150
Y:375
Width:150
Children: Children:
MapPreview@MAP_PREVIEW: Label@SERVER_IP_LABEL:
Id:MAP_PREVIEW Id:SERVER_IP_LABEL
X:10 X:0
Y:10 Y:0
Width:128 Align:Right
Height:128 Width:70
Container@STATS_BIN: Height:20
X:200 Text:Server:
Y:30 Font:Bold
Width:150 Label@SERVER_IP:
Children: Id:SERVER_IP
Label@SERVER_IP_LABEL: X:70
Id:SERVER_IP_LABEL Y:0
X:0 Align:Left
Y:0 Width:70
Align:Right Height:20
Width:70 Label@MAP_PLAYERS_LABEL:
Height:20 Id:MAP_PLAYERS_LABEL
Text:Server: X:0
Font:Bold Y:20
Label@SERVER_IP: Align:Right
Id:SERVER_IP Width:70
X:70 Height:20
Y:0 Text:Players:
Align:Left Font:Bold
Width:70 Label@MAP_PLAYERS:
Height:20 Id:MAP_PLAYERS
Label@MAP_PLAYERS_LABEL: X:70
Id:MAP_PLAYERS_LABEL Y:20
X:0 Align:Left
Y:20 Width:70
Align:Right Height:20
Width:70 Label@MAP_TITLE_LABEL:
Height:20 Id:MAP_TITLE_LABEL
Text:Players: X:0
Font:Bold Y:40
Label@MAP_PLAYERS: Align:Right
Id:MAP_PLAYERS Width:70
X:70 Height:20
Y:20 Text:Map:
Align:Left Font:Bold
Width:70 Label@MAP_TITLE:
Height:20 Id:MAP_TITLE
Label@MAP_TITLE_LABEL: X:70
Id:MAP_TITLE_LABEL Y:40
X:0 Align:Left
Y:40 Width:70
Align:Right Height:20
Width:70 Label@SERVER_MODS_LABEL:
Height:20 Id:SERVER_MODS_LABEL
Text:Map: X:0
Font:Bold Y:60
Label@MAP_TITLE: Align:Right
Id:MAP_TITLE Width:70
X:70 Height:20
Y:40 Text:Mods:
Align:Left Font:Bold
Width:70 Label@SERVER_MODS:
Height:20 Id:SERVER_MODS
Label@SERVER_MODS_LABEL: X:70
Id:SERVER_MODS_LABEL Y:63
X:0 Align:Left
Y:60 VAlign:Top
Align:Right Width:70
Width:70 Height:20
Height:20 CncMenuButton@BACK_BUTTON:
Text:Mods: Id:BACK_BUTTON
Font:Bold
Label@SERVER_MODS:
Id:SERVER_MODS
X:70
Y:63
Align:Left
VAlign:Top
Width:70
Height:20
CncMenuButton@JOIN_BUTTON:
Id:JOIN_BUTTON
X:0 X:0
Y:499 Y:499
Width:140 Width:140
Height:35 Height:35
Text:Join Text:Back
CncMenuButton@REFRESH_BUTTON: CncMenuButton@REFRESH_BUTTON:
Id:REFRESH_BUTTON Id:REFRESH_BUTTON
X:450 X:450
@@ -206,10 +206,10 @@ Container@SERVERBROWSER_PANEL:
Width:140 Width:140
Height:35 Height:35
Text:Refresh Text:Refresh
CncMenuButton@BACK_BUTTON: CncMenuButton@JOIN_BUTTON:
Id:BACK_BUTTON Id:JOIN_BUTTON
X:600 X:600
Y:499 Y:499
Width:140 Width:140
Height:35 Height:35
Text:Back Text:Join