From dcf13e52c279084958d052bd9b7100fdef00f47c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 10 Jul 2010 21:38:47 +1200 Subject: [PATCH] Vertically align labels --- OpenRA.Game/Network/UnitOrders.cs | 2 +- OpenRA.Game/Widgets/LabelWidget.cs | 4 ++-- mods/cnc/menus.yaml | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/OpenRA.Game/Network/UnitOrders.cs b/OpenRA.Game/Network/UnitOrders.cs index 41ae9879f5..0d33bff1d3 100755 --- a/OpenRA.Game/Network/UnitOrders.cs +++ b/OpenRA.Game/Network/UnitOrders.cs @@ -45,7 +45,7 @@ namespace OpenRA.Network var player = Game.world.players.Values.FirstOrDefault(p => p.Index == client.Index); var isAlly = (world.GameHasStarted) ? player != null && Game.world.LocalPlayer != null && player.Stances[Game.world.LocalPlayer] == Stance.Ally : - client.Team == Game.LocalClient.Team && client.Team != 0; + client == Game.LocalClient || (client.Team == Game.LocalClient.Team && client.Team != 0); if (isAlly) Chrome.chatWidget.AddLine(Game.world.PlayerColors()[client.PaletteIndex].Color, client.Name + " (Team)", order.TargetString); diff --git a/OpenRA.Game/Widgets/LabelWidget.cs b/OpenRA.Game/Widgets/LabelWidget.cs index c32d8acb0e..7fb567205e 100644 --- a/OpenRA.Game/Widgets/LabelWidget.cs +++ b/OpenRA.Game/Widgets/LabelWidget.cs @@ -60,8 +60,8 @@ namespace OpenRA.Widgets return; int2 textSize = font.Measure(text); - int2 position = DrawPosition(); - + int2 position = DrawPosition() + new int2(0, (Bounds.Height - textSize.Y)/2); + if (Align == TextAlign.Center) position += new int2((Bounds.Width - textSize.X)/2, 0); diff --git a/mods/cnc/menus.yaml b/mods/cnc/menus.yaml index 108fee95f1..0a61a2e501 100644 --- a/mods/cnc/menus.yaml +++ b/mods/cnc/menus.yaml @@ -338,7 +338,7 @@ Container: Width:95 Height:25 X:0 - Y:5 + Y:0 Button@COLOR: Id:COLOR Width:65 @@ -371,7 +371,7 @@ Container: Width:60 Height:25 X:40 - Y:5 + Y:0 Button@TEAM: Id:TEAM Text:Team @@ -381,7 +381,7 @@ Container: Y:0 Checkbox@STATUS: Id:STATUS - X:385 + X:405 Y:1 Width:20 Height:20 @@ -399,7 +399,7 @@ Container: Width:95 Height:25 X:0 - Y:5 + Y:0 ColorBlock@COLOR: Id:COLOR X:105 @@ -425,7 +425,7 @@ Container: Width:60 Height:25 X:40 - Y:5 + Y:0 Label@TEAM: Id:TEAM Text:Team @@ -436,13 +436,13 @@ Container: Align:Center Checkbox@STATUS: Id:STATUS - X:385 + X:405 Y:1 Width:20 Height:20 Container@LABEL_CONTAINER: X:30 - Y:50 + Y:45 Children: Label@LABEL_LOBBY_NAME: Id:LABEL_LOBBY_NAME @@ -479,8 +479,8 @@ Container: Id:LABEL_LOBBY_STATUS X:380 Y:0 - Width:20 - Height:20 + Width:70 + Height:25 Text:Ready Align:Center Button@CHANGEMAP_BUTTON: @@ -505,7 +505,7 @@ Container: Width:70 Height:25 X:0 - Y:PARENT_BOTTOM - 75 + Y:PARENT_BOTTOM - 76 Text:Chat: Align:Right TextField@CHAT_TEXTFIELD: