adjust the build palette origins to icon width

This commit is contained in:
Paul Chote
2013-08-17 21:19:04 +12:00
committed by Matthias Mailänder
parent bad57b6ab7
commit 32c3563a04
2 changed files with 13 additions and 4 deletions

View File

@@ -38,8 +38,8 @@ namespace OpenRA.Mods.RA.Widgets
bool paletteOpen = false;
float2 paletteOpenOrigin = new float2(Game.viewport.Width - 215, 280);
float2 paletteClosedOrigin = new float2(Game.viewport.Width - 16, 280);
float2 paletteOpenOrigin;
float2 paletteClosedOrigin;
float2 paletteOrigin;
int paletteAnimationLength = 7;
@@ -63,11 +63,18 @@ namespace OpenRA.Mods.RA.Widgets
cantBuild = new Animation("clock");
cantBuild.PlayFetchIndex("idle", () => 0);
clock = new Animation("clock");
paletteOrigin = paletteClosedOrigin;
VisibleQueues = new List<ProductionQueue>();
CurrentQueue = null;
}
public override void Initialize(WidgetArgs args)
{
paletteOpenOrigin = new float2(Game.viewport.Width - Columns*IconWidth - 23, 280);
paletteClosedOrigin = new float2(Game.viewport.Width - 16, 280);
paletteOrigin = paletteClosedOrigin;
base.Initialize(args);
}
public override Rectangle EventBounds
{
get { return new Rectangle((int)(paletteOrigin.X) - 24, (int)(paletteOrigin.Y), 215, Math.Max(IconHeight * numActualRows, 40 * tabs.Count + 9)); }

View File

@@ -153,13 +153,15 @@ Container@PLAYER_WIDGETS:
BuildPalette@INGAME_BUILD_PALETTE:
X:WINDOW_RIGHT - 250
Y:280
Width:238 # TODO: why is this ignored?
Width:238
Height:500
ReadyText: READY
HoldText: ON HOLD
RequiresText: Requires
IconWidth: 60
IconHeight: 48
Columns: 3
Rows: 4
Background@DIPLOMACY_BG:
Logic:DiplomacyLogic
X:(WINDOW_RIGHT - WIDTH)/2