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,28 +103,28 @@ 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:
MapPreview@MAP_PREVIEW:
Id:MAP_PREVIEW
X:1
Y:1
Width:128
Height:128
Container@SERVER_INFO: Container@SERVER_INFO:
Id:SERVER_INFO Id:SERVER_INFO
Width:PARENT_RIGHT Width:PARENT_RIGHT
Height:PARENT_BOTTOM Height:PARENT_BOTTOM
Visible:false Visible:false
Children: Children:
MapPreview@MAP_PREVIEW:
Id:MAP_PREVIEW
X:10
Y:10
Width:128
Height:128
Container@STATS_BIN: Container@STATS_BIN:
X:200 X:150
Y:30 Y:375
Width:150 Width:150
Children: Children:
Label@SERVER_IP_LABEL: Label@SERVER_IP_LABEL:
@@ -192,13 +192,13 @@ Container@SERVERBROWSER_PANEL:
VAlign:Top VAlign:Top
Width:70 Width:70
Height:20 Height:20
CncMenuButton@JOIN_BUTTON: CncMenuButton@BACK_BUTTON:
Id:JOIN_BUTTON Id:BACK_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