From c67f686ad7becc3dea171e5de27032372c7e8544 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 9 Jan 2010 08:52:15 +1300 Subject: [PATCH] routed invuln & chrono powers --- OpenRa.Game/Chrome.cs | 55 ++------ OpenRa.Game/Game Code.cd | 169 ----------------------- OpenRa.Game/Graphics/Graphics.cd | 131 ------------------ OpenRa.Game/OpenRa.Game.csproj | 6 +- OpenRa.Game/SupportPowers/Chronoshift.cs | 15 ++ OpenRa.Game/SupportPowers/IronCurtain.cs | 15 ++ SequenceEditor/Program.cs | 7 +- units.ini | 4 +- 8 files changed, 51 insertions(+), 351 deletions(-) delete mode 100644 OpenRa.Game/Game Code.cd delete mode 100644 OpenRa.Game/Graphics/Graphics.cd create mode 100644 OpenRa.Game/SupportPowers/Chronoshift.cs create mode 100644 OpenRa.Game/SupportPowers/IronCurtain.cs diff --git a/OpenRa.Game/Chrome.cs b/OpenRa.Game/Chrome.cs index 3a3afc674b..e350f282f6 100644 --- a/OpenRa.Game/Chrome.cs +++ b/OpenRa.Game/Chrome.cs @@ -78,7 +78,9 @@ namespace OpenRa.Game specialBinSprites = new [] { - new Sprite(chromeTexture, new Rectangle(0, 0, 32, 192), TextureChannel.Alpha), + new Sprite(chromeTexture, new Rectangle(0, 0, 32, 51), TextureChannel.Alpha), + new Sprite(chromeTexture, new Rectangle(0, 51, 32, 51 /*144*/), TextureChannel.Alpha), + new Sprite(chromeTexture, new Rectangle(0, 192-39, 32, 39 ), TextureChannel.Alpha), }; moneyBinSprite = new Sprite(chromeTexture, new Rectangle(512 - 320, 0, 320, 32), TextureChannel.Alpha); tooltipSprite = new Sprite(chromeTexture, new Rectangle(0, 288, 272, 136), TextureChannel.Alpha); @@ -324,32 +326,6 @@ namespace OpenRa.Game void DrawButtons() { - // Chronoshift - Rectangle chronoshiftRect = new Rectangle(6, 14, repairButton.Image.bounds.Width, repairButton.Image.bounds.Height); - var chronoshiftDrawPos = Game.viewport.Location + new float2(chronoshiftRect.Location); - - var hasChronosphere = Game.world.Actors.Any(a => a.Owner == Game.LocalPlayer && a.traits.Contains()); - - if (!hasChronosphere) - repairButton.ReplaceAnim("disabled"); - else - AddButton(chronoshiftRect, isLmb => HandleChronosphereButton()); - - shpRenderer.DrawSprite(repairButton.Image, chronoshiftDrawPos, PaletteType.Chrome); - - // Iron Curtain - Rectangle curtainRect = new Rectangle(6, 14+50, repairButton.Image.bounds.Width, repairButton.Image.bounds.Height); - var curtainDrawPos = Game.viewport.Location + new float2(curtainRect.Location); - - var hasCurtain = Game.world.Actors.Any(a => a.Owner == Game.LocalPlayer && a.traits.Contains()); - - if (!hasCurtain) - repairButton.ReplaceAnim("disabled"); - else - AddButton(curtainRect, isLmb => HandleIronCurtainButton()); - - shpRenderer.DrawSprite(repairButton.Image, curtainDrawPos, PaletteType.Chrome); - // Repair Rectangle repairRect = new Rectangle(Game.viewport.Width - 120, 5, repairButton.Image.bounds.Width, repairButton.Image.bounds.Height); var repairDrawPos = Game.viewport.Location + new float2(repairRect.Location); @@ -438,19 +414,7 @@ namespace OpenRa.Game shpRenderer.Flush(); } } - - void HandleChronosphereButton() - { - if (Game.controller.ToggleInputMode()) - Sound.Play("slcttgt1.aud"); - } - - void HandleIronCurtainButton() - { - if (Game.controller.ToggleInputMode()) - Sound.Play("slcttgt1.aud"); - } - + void DrawChat() { var chatpos = new int2(400, Game.viewport.Height - 20); @@ -711,8 +675,18 @@ namespace OpenRa.Game void DrawSupportPowers() { + var numPowers = Game.LocalPlayer.SupportPowers.Values + .Where(a => a.IsAvailable).Count(); + + if (numPowers == 0) return; + rgbaRenderer.DrawSprite(specialBinSprites[0], new float2(0,14), PaletteType.Chrome); + for (var i = 1; i < numPowers; i++) + rgbaRenderer.DrawSprite(specialBinSprites[1], new float2(0, 14 + i * 51), PaletteType.Chrome); + rgbaRenderer.DrawSprite(specialBinSprites[2], new float2(0, 14 + numPowers * 51), PaletteType.Chrome); + rgbaRenderer.Flush(); + var y = 24; string tooltipItem = null; @@ -744,7 +718,6 @@ namespace OpenRa.Game AddButton(rect, HandleSupportPower( sp.Value )); } - if (rect.Contains(lastMousePos.ToPoint())) { tooltipItem = sp.Key; diff --git a/OpenRa.Game/Game Code.cd b/OpenRa.Game/Game Code.cd deleted file mode 100644 index 9121b137c1..0000000000 --- a/OpenRa.Game/Game Code.cd +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - AAaAkDQAABJAAQEEBEECEgAQQUBAAAAAIYAKBCAAwiA= - Game.cs - - - - - - - - - - - - - - AAACAACoAAAAAAAAAAQDEgQAABAAABAAAAAAKAACCAA= - Controller.cs - - - - - - - - - - - - AAIAAAAABAAACABCAAYAEEAAAABAAAAAAAAgAEEIwBE= - Graphics\Viewport.cs - - - - - - - - AAIAACABAAABgAAAAYQABAAEAAAAAAAAAAAAAAAAQBA= - World.cs - - - - - - - - - - - AgEACACAAAAAAAAAAQIAEIAkAQQAAAAAABAgAEAAQgA= - Actor.cs - - - - - - - - - ACIAAAKAAJAgwiAAgAAAgFQAJAhQAHAAGCACAADIRAA= - GameRules\UnitInfo.cs - - - - - - - - QEEEAAQAAAIAQQAACAMAACCAAAAAAA0gCAEAAQABQAA= - Player.cs - - - - - - AAAAAAAAAAQAAAAAAAAAAAABAQAAAAAAAAAAAAAAAAg= - GameRules\UnitInfo.cs - - - - - - AAJQAAAIAAAAgAAACAAAABIAAAICAAABAAAAQAAAAgA= - GameRules\UnitInfo.cs - - - - - - AAAAAAAAAAAAEEAAAAABIAAAAAAAAAAAAAAAACAAAQA= - GameRules\UnitInfo.cs - - - - - - AAAAAAAAAAAAAEAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= - GameRules\UnitInfo.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - GameRules\ActorInfo.cs - - - - - - - - AAAAAAAAAAAAAAAgAACAAAICAAgAEoAAMAAAAAAAAgA= - PathFinder.cs - - - - - - AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAQAA= - IOrderGenerator.cs - - - - \ No newline at end of file diff --git a/OpenRa.Game/Graphics/Graphics.cd b/OpenRa.Game/Graphics/Graphics.cd deleted file mode 100644 index 54372aa050..0000000000 --- a/OpenRa.Game/Graphics/Graphics.cd +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - AAQCgACAAAAAAAAAAAAAAAAAAAAEABAEgAAAAQQIQAA= - Graphics\Animation.cs - - - - - - - - - AAAAAQAABAAAgAAAAIYAAEAAAABCAAAAAABgAAAAgAE= - Graphics\Viewport.cs - - - - - - - - - AAQAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAQAAAAA= - Graphics\HardwarePalette.cs - - - - - - AIQAAAAAAAAAggAABAIAIAQCAAAAAGAAAAAAAAAQAAA= - Graphics\Region.cs - - - - - - QACAEAAGAAAAAgMAAAAAAAAAAAAAAAAAAAAAAEAAAAA= - Graphics\Renderer.cs - - - - - - AAAAAAAAAACAgAAACAgAAAAIAAAAAgAAAAIAAAAggAA= - Graphics\Sheet.cs - - - - - - - - - AQIACAAAAAAAIQAAAAAAAAAAgAAAAIAAAEAAAAACgAA= - Graphics\SheetBuilder.cs - - - - - - - - - AAAAAAAAAQAAIAAAAIAAAAAAAAAAAAABAAACAAAEAgA= - Graphics\Sprite.cs - - - - - - - - - AAAQQAAAAECAAAAAAAAAAAAAABAQABAAAAAAAACIwAQ= - Graphics\SpriteRenderer.cs - - - - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAACAAAA= - Graphics\SpriteSheetBuilder.cs - - - - - - - - - AACQEAAAAAAAAgAAAAAACAAAABgAAAAAAAAAAAAAgAA= - Graphics\TerrainRenderer.cs - - - - - - - - - - AAAAAAAAgAAAAAAAAAAAAAAAAQAAAAAAAQAAAACAAAA= - Graphics\UnitSheetBuilder.cs - - - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAgAAACAAFJgAQAAAAA= - Graphics\Vertex.cs - - - - - - AAACAAAAAAAAAgAAAAAAAAAAAAAAABAAAAAAABAAAAA= - Graphics\Sprite.cs - - - - \ No newline at end of file diff --git a/OpenRa.Game/OpenRa.Game.csproj b/OpenRa.Game/OpenRa.Game.csproj index 881e1f1d31..a14b7ec48e 100644 --- a/OpenRa.Game/OpenRa.Game.csproj +++ b/OpenRa.Game/OpenRa.Game.csproj @@ -122,7 +122,9 @@ + + @@ -308,10 +310,6 @@ false - - - -