Merge commit 'alzeih/master'
This commit is contained in:
@@ -27,6 +27,7 @@ namespace OpenRa.Game
|
|||||||
readonly Animation repairButton;
|
readonly Animation repairButton;
|
||||||
readonly Animation sellButton;
|
readonly Animation sellButton;
|
||||||
readonly Animation pwrdownButton;
|
readonly Animation pwrdownButton;
|
||||||
|
readonly Animation optionsButton;
|
||||||
|
|
||||||
readonly SpriteRenderer buildPaletteRenderer;
|
readonly SpriteRenderer buildPaletteRenderer;
|
||||||
readonly Animation cantBuild;
|
readonly Animation cantBuild;
|
||||||
@@ -42,6 +43,7 @@ namespace OpenRa.Game
|
|||||||
readonly int paletteColumns;
|
readonly int paletteColumns;
|
||||||
readonly int2 paletteOrigin;
|
readonly int2 paletteOrigin;
|
||||||
bool hadRadar = false;
|
bool hadRadar = false;
|
||||||
|
bool optionsPressed = false;
|
||||||
const int MinRows = 4;
|
const int MinRows = 4;
|
||||||
|
|
||||||
public Chrome(Renderer r)
|
public Chrome(Renderer r)
|
||||||
@@ -82,6 +84,9 @@ namespace OpenRa.Game
|
|||||||
pwrdownButton = new Animation("repair");
|
pwrdownButton = new Animation("repair");
|
||||||
pwrdownButton.PlayRepeating("normal");
|
pwrdownButton.PlayRepeating("normal");
|
||||||
|
|
||||||
|
optionsButton = new Animation("tabs");
|
||||||
|
optionsButton.PlayRepeating("left-normal");
|
||||||
|
|
||||||
blank = SheetBuilder.Add(new Size(64, 48), 16);
|
blank = SheetBuilder.Add(new Size(64, 48), 16);
|
||||||
|
|
||||||
sprites = groups
|
sprites = groups
|
||||||
@@ -132,7 +137,7 @@ namespace OpenRa.Game
|
|||||||
Game.LocalPlayer.PowerDrained,
|
Game.LocalPlayer.PowerDrained,
|
||||||
Game.LocalPlayer.PowerProvided,
|
Game.LocalPlayer.PowerProvided,
|
||||||
Game.LocalPlayer.IsReady ? "Yes" : "No"
|
Game.LocalPlayer.IsReady ? "Yes" : "No"
|
||||||
), new int2(140, 5), Color.White);
|
), new int2(140, 15), Color.White);
|
||||||
|
|
||||||
PerfHistory.Render(renderer, Game.worldRenderer.lineRenderer);
|
PerfHistory.Render(renderer, Game.worldRenderer.lineRenderer);
|
||||||
|
|
||||||
@@ -343,6 +348,26 @@ namespace OpenRa.Game
|
|||||||
buildPaletteRenderer.DrawSprite(pwrdownButton.Image, pwrdownDrawPos, PaletteType.Chrome);
|
buildPaletteRenderer.DrawSprite(pwrdownButton.Image, pwrdownDrawPos, PaletteType.Chrome);
|
||||||
}
|
}
|
||||||
buildPaletteRenderer.Flush();
|
buildPaletteRenderer.Flush();
|
||||||
|
|
||||||
|
//Options
|
||||||
|
Rectangle optionsRect = new Rectangle(0 + 40,0, optionsButton.Image.bounds.Width,
|
||||||
|
optionsButton.Image.bounds.Height);
|
||||||
|
|
||||||
|
var optionsDrawPos = Game.viewport.Location + new float2(optionsRect.Location);
|
||||||
|
|
||||||
|
optionsButton.ReplaceAnim(optionsPressed ? "left-pressed" : "left-normal");
|
||||||
|
|
||||||
|
AddButton(optionsRect, isLmb => DrawOptionsMenu());
|
||||||
|
buildPaletteRenderer.DrawSprite(optionsButton.Image, optionsDrawPos, PaletteType.Chrome);
|
||||||
|
buildPaletteRenderer.Flush();
|
||||||
|
|
||||||
|
renderer.DrawText("Exit", new int2(80, -2) , Color.White);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawOptionsMenu()
|
||||||
|
{
|
||||||
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleChronosphereButton()
|
void HandleChronosphereButton()
|
||||||
|
|||||||
@@ -404,10 +404,10 @@
|
|||||||
<sequence name="ability-minimap" start="214" length="8" />
|
<sequence name="ability-minimap" start="214" length="8" />
|
||||||
</cursor>
|
</cursor>
|
||||||
<cursor src="speed">
|
<cursor src="speed">
|
||||||
<sequence name="powerdown" start="3" length="12" />
|
<sequence name="powerdown" start="3" length="12" />
|
||||||
</cursor>
|
</cursor>
|
||||||
<unit name="powerdown">
|
<unit name="powerdown">
|
||||||
<sequence name="disabled" start="3" length="1" src="speed" />
|
<sequence name="disabled" start="3" length="1" src="speed" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="120mm">
|
<unit name="120mm">
|
||||||
<sequence name="idle" start="0" length="1" />
|
<sequence name="idle" start="0" length="1" />
|
||||||
@@ -1024,4 +1024,8 @@
|
|||||||
<sequence name="pressed" start="1" length="1" />
|
<sequence name="pressed" start="1" length="1" />
|
||||||
<sequence name="disabled" start="2" length="1" />
|
<sequence name="disabled" start="2" length="1" />
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit name="tabs">
|
||||||
|
<sequence name="left-normal" start="0" length="1" />
|
||||||
|
<sequence name="left-pressed" start="1" length="1" />
|
||||||
|
</unit>
|
||||||
</sequences>
|
</sequences>
|
||||||
Reference in New Issue
Block a user