From dc4c1cce1b5b26972e52d985ea4fcb5e428a96db Mon Sep 17 00:00:00 2001 From: Bob Date: Sat, 10 Oct 2009 23:21:31 +1300 Subject: [PATCH] fake buildings now work. --- OpenRa.Game/Actor.cs | 13 +++++++++---- OpenRa.Game/GameRules/UnitInfo.cs | 2 +- OpenRa.Game/MainWindow.cs | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/OpenRa.Game/Actor.cs b/OpenRa.Game/Actor.cs index 270ac07df1..f674eef4dd 100755 --- a/OpenRa.Game/Actor.cs +++ b/OpenRa.Game/Actor.cs @@ -62,6 +62,7 @@ namespace OpenRa.Game ///// TODO: planes ///// ///// buildings ///// + //TODO: SBAG, BRIK, FENC, etc case "iron": case "pdox": case "mslo": @@ -81,13 +82,16 @@ namespace OpenRa.Game case "fix": case "spen": case "syrd": - //GAP - //SBAG, BRIK, FENC - //FACF, WEAF, SYRF, SPEF, DOMF + case "gap": case "pbox": case "hbox": case "tsla": case "ftur": + case "facf": + case "weaf": + case "syrf": + case "spef": + case "domf": traits.Add( new Traits.Building( this ) ); traits.Add( new Traits.RenderBuilding( this ) ); break; @@ -102,6 +106,7 @@ namespace OpenRa.Game traits.Add( new Traits.Turreted( this ) ); traits.Add( new Traits.RenderBuildingTurreted( this ) ); break; + default: throw new NotImplementedException( "Actor traits for " + name ); } @@ -159,7 +164,7 @@ namespace OpenRa.Game public RenderSimple( Actor self ) { - anim = new Animation( self.unitInfo.Name ); + anim = new Animation( self.unitInfo.Image ?? self.unitInfo.Name ); } public abstract IEnumerable> Render( Actor self ); diff --git a/OpenRa.Game/GameRules/UnitInfo.cs b/OpenRa.Game/GameRules/UnitInfo.cs index 39f36158e6..610fc3d407 100755 --- a/OpenRa.Game/GameRules/UnitInfo.cs +++ b/OpenRa.Game/GameRules/UnitInfo.cs @@ -96,7 +96,7 @@ namespace OpenRa.Game.GameRules field.SetValue( this, float.Parse( x.Value ) ); else if( field.FieldType == typeof( string ) ) - field.SetValue( this, x.Value ); + field.SetValue( this, x.Value.ToLowerInvariant() ); else if( field.FieldType == typeof( ArmorType ) ) field.SetValue( this, Enum.Parse(x.Value) ); diff --git a/OpenRa.Game/MainWindow.cs b/OpenRa.Game/MainWindow.cs index c2f339d2ba..6678429c11 100644 --- a/OpenRa.Game/MainWindow.cs +++ b/OpenRa.Game/MainWindow.cs @@ -28,7 +28,7 @@ namespace OpenRa.Game FileSystem.Mount(new Folder("../../../../")); FileSystem.Mount(new Package("redalert.mix")); FileSystem.Mount(new Package("conquer.mix")); - FileSystem.Mount(new Package("hires.mix")); + FileSystem.Mount(new Package("hires.mix")); FileSystem.Mount(new Package("general.mix")); FormBorderStyle = FormBorderStyle.None;