diff --git a/.gitignore b/.gitignore index a637e184dd..eddde75363 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,5 @@ OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.mode1v3 # other crap Logs/ Replays/ -settings.yaml -\#* -.*.sw? +\#* +.*.sw? diff --git a/AUTHORS b/AUTHORS index 2b8f0e1bc5..1cc92b954c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,6 +12,7 @@ The OpenRA developers are: Also thanks to: * Akseli Virtanen (RAGEQUIT) * Andrew Riedi + * Barnaby Smith (mvi) * Bellator * Christer Ulfsparre (Holloweye) * Erasmus Schroder (rasco) @@ -22,6 +23,7 @@ Also thanks to: * Lawrence Wang * Mark Olson (markolson) * Matthew Gatland (mgatland) + * Matthias Mailänder (Mailaender) * Max Ugrumov (katzsmile) * Max621 * Nukem diff --git a/Makefile b/Makefile index 66109770b7..be88893947 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,10 @@ COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll third PHONY = core tools package all mods clean distclean .SUFFIXES: -core: game renderers mod_ra mod_cnc utility +core: game renderers mods utility tsbuild tools: editor ralint tsbuild package: core editor -mods: mod_ra mod_cnc +mods: mod_ra mod_cnc mod_d2k all: core tools clean: @-rm -f *.exe *.dll *.mdb mods/**/*.dll mods/**/*.mdb *.resources @@ -97,6 +97,16 @@ mod_cnc_EXTRA_CMDS = mono --debug RALint.exe cnc PROGRAMS += mod_cnc mod_cnc: $(mod_cnc_TARGET) +# Dune 2000 +mod_d2k_SRCS := $(shell find OpenRA.Mods.D2k/ -iname '*.cs') +mod_d2k_TARGET = mods/d2k/OpenRA.Mods.D2k.dll +mod_d2k_KIND = library +mod_d2k_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) $(utility_TARGET) +mod_d2k_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET) $(utility_TARGET) +mod_d2k_EXTRA_CMDS = mono --debug RALint.exe d2k +PROGRAMS += mod_d2k +mod_d2k: $(mod_d2k_TARGET) + # # Tools # @@ -127,15 +137,19 @@ ralint: $(ralint_TARGET) # Builds and exports tilesets from a bitmap tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs') -tsbuild_TARGET = TilesetBuilder.exe +tsbuild_TARGET = OpenRA.TilesetBuilder.exe tsbuild_KIND = winexe tsbuild_DEPS = $(fileformats_TARGET) $(game_TARGET) tsbuild_LIBS = $(COMMON_LIBS) $(tsbuild_DEPS) System.Windows.Forms.dll -tsbuild_EXTRA = -resource:OpenRA.TilesetBuilder.Form1.resources +tsbuild_EXTRA = -resource:OpenRA.TilesetBuilder.frmBuilder.resources -resource:OpenRA.TilesetBuilder.frmNew.resources -resource:OpenRA.TilesetBuilder.Surface.resources PROGRAMS += tsbuild -OpenRA.TilesetBuilder.Form1.resources: - resgen2 OpenRA.TilesetBuilder/Form1.resx OpenRA.TilesetBuilder.Form1.resources 1> /dev/null -tsbuild: OpenRA.TilesetBuilder.Form1.resources $(tsbuild_TARGET) +OpenRA.TilesetBuilder.frmBuilder.resources: + resgen2 OpenRA.TilesetBuilder/frmBuilder.resx OpenRA.TilesetBuilder.frmBuilder.resources 1> /dev/null +OpenRA.TilesetBuilder.frmNew.resources: + resgen2 OpenRA.TilesetBuilder/frmNew.resx OpenRA.TilesetBuilder.frmNew.resources 1> /dev/null +OpenRA.TilesetBuilder.Surface.resources: + resgen2 OpenRA.TilesetBuilder/Surface.resx OpenRA.TilesetBuilder.Surface.resources 1> /dev/null +tsbuild: OpenRA.TilesetBuilder.frmBuilder.resources OpenRA.TilesetBuilder.frmNew.resources OpenRA.TilesetBuilder.Surface.resources $(tsbuild_TARGET) # # Launchers / Utilities @@ -188,7 +202,7 @@ BIN_INSTALL_DIR = $(DESTDIR)$(bindir) INSTALL_DIR = $(DESTDIR)$(datadir)/openra INSTALL = install INSTALL_PROGRAM = $(INSTALL) -CORE = fileformats rcg rgl rsdl rnull game editor utility +CORE = fileformats rcg rgl rsdl rnull game editor utility tsbuild install: all @-echo "Installing OpenRA to $(INSTALL_DIR)" @@ -196,6 +210,10 @@ install: all @$(INSTALL_PROGRAM) $(foreach prog,$(CORE),$($(prog)_TARGET)) $(INSTALL_DIR) @$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/cnc @$(INSTALL_PROGRAM) $(mod_cnc_TARGET) $(INSTALL_DIR)/mods/cnc + @$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/ra + @$(INSTALL_PROGRAM) $(mod_ra_TARGET) $(INSTALL_DIR)/mods/ra + @$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/d2k + @$(INSTALL_PROGRAM) $(mod_d2k_TARGET) $(INSTALL_DIR)/mods/d2k @-cp $(foreach f,$(shell ls mods/cnc --hide=*.dll),mods/cnc/$(f)) $(INSTALL_DIR)/mods/cnc @cp -r mods/cnc/maps $(INSTALL_DIR)/mods/cnc @@ -205,8 +223,6 @@ install: all @cp -r mods/cnc/sequences $(INSTALL_DIR)/mods/cnc @cp -r mods/cnc/tilesets $(INSTALL_DIR)/mods/cnc @cp -r mods/cnc/uibits $(INSTALL_DIR)/mods/cnc - @$(INSTALL_PROGRAM) -d $(INSTALL_DIR)/mods/ra - @$(INSTALL_PROGRAM) $(mod_ra_TARGET) $(INSTALL_DIR)/mods/ra @-cp $(foreach f,$(shell ls mods/ra --hide=*.dll),mods/ra/$(f)) $(INSTALL_DIR)/mods/ra @cp -r mods/ra/maps $(INSTALL_DIR)/mods/ra @@ -215,6 +231,14 @@ install: all @cp -r mods/ra/rules $(INSTALL_DIR)/mods/ra @cp -r mods/ra/tilesets $(INSTALL_DIR)/mods/ra @cp -r mods/ra/uibits $(INSTALL_DIR)/mods/ra + + @-cp $(foreach f,$(shell ls mods/d2k --hide=*.dll),mods/d2k/$(f)) $(INSTALL_DIR)/mods/d2k + @cp -r mods/d2k/maps $(INSTALL_DIR)/mods/d2k + @cp -r mods/d2k/bits $(INSTALL_DIR)/mods/d2k + @cp -r mods/d2k/chrome $(INSTALL_DIR)/mods/d2k + @cp -r mods/d2k/rules $(INSTALL_DIR)/mods/d2k + @cp -r mods/d2k/tilesets $(INSTALL_DIR)/mods/d2k + @cp -r mods/d2k/uibits $(INSTALL_DIR)/mods/d2k @cp -r glsl $(INSTALL_DIR) @cp -r cg $(INSTALL_DIR) @@ -237,3 +261,4 @@ install: all uninstall: @-rm -r $(INSTALL_DIR) @-rm $(DESTDIR)$(bindir)/openra + @-rm $(DESTDIR)$(bindir)/openra-editor diff --git a/OpenRA.Mods.D2k/D2kLoadScreen.cs b/OpenRA.Mods.D2k/D2kLoadScreen.cs new file mode 100644 index 0000000000..9bd9c709da --- /dev/null +++ b/OpenRA.Mods.D2k/D2kLoadScreen.cs @@ -0,0 +1,92 @@ +#region Copyright & License Information +/* + * Copyright 2012 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System.Collections.Generic; +using System.IO; +using System.Drawing; +using OpenRA.FileFormats; +using OpenRA.Graphics; +using OpenRA.Network; +using OpenRA.Support; +using OpenRA.Widgets; + +namespace OpenRA.Mods.D2k +{ + public class D2kLoadScreen : ILoadScreen + { + Dictionary Info; + static string[] Comments = new[] {"Filling Crates...", "Breeding Sandworms..."}; + + Stopwatch lastLoadScreen = new Stopwatch(); + Rectangle StripeRect; + Sprite Stripe, Logo; + float2 LogoPos; + + Renderer r; + public void Init(Dictionary info) + { + Info = info; + // Avoid standard loading mechanisms so we + // can display loadscreen as early as possible + r = Game.Renderer; + if (r == null) return; + var s = new Sheet("mods/d2k/uibits/loadscreen.png"); + Logo = new Sprite(s, new Rectangle(0,0,256,256), TextureChannel.Alpha); + Stripe = new Sprite(s, new Rectangle(256,0,256,256), TextureChannel.Alpha); + StripeRect = new Rectangle(0, Renderer.Resolution.Height/2 - 128, Renderer.Resolution.Width, 256); + LogoPos = new float2(Renderer.Resolution.Width/2 - 128, Renderer.Resolution.Height/2 - 128); + } + + public void Display() + { + if (r == null) + return; + + // Update text at most every 0.5 seconds + if (lastLoadScreen.ElapsedTime() < 0.5) + return; + + lastLoadScreen.Reset(); + var text = Comments.Random(Game.CosmeticRandom); + var textSize = r.Fonts["Bold"].Measure(text); + + r.BeginFrame(float2.Zero, 1f); + WidgetUtils.FillRectWithSprite(StripeRect, Stripe); + r.RgbaSpriteRenderer.DrawSprite(Logo, LogoPos); + r.Fonts["Bold"].DrawText(text, new float2(Renderer.Resolution.Width - textSize.X - 20, Renderer.Resolution.Height - textSize.Y - 20), Color.White); + r.EndFrame( new NullInputHandler() ); + } + + public void StartGame() + { + TestAndContinue(); + Game.JoinExternalGame(); + } + + void TestAndContinue() + { + Ui.ResetAll(); + if (!FileSystem.Exists(Info["TestFile"])) + { + var args = new WidgetArgs() + { + { "installData", Info } + }; + Ui.OpenWindow(Info["InstallerMenuWidget"], args); + } + else + { + Game.LoadShellMap(); + Ui.ResetAll(); + Ui.OpenWindow("MAINMENU_BG"); + } + } + } +} \ No newline at end of file diff --git a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj new file mode 100644 index 0000000000..410ccb7fa8 --- /dev/null +++ b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj @@ -0,0 +1,90 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {C0B0465C-6BE2-409C-8770-3A9BF64C4344} + Library + Properties + OpenRA.Mods.D2k + OpenRA.Mods.D2k + v3.5 + 512 + + + true + full + false + DEBUG;TRACE + prompt + 4 + bin\Debug + + + + + + + DEBUG; + prompt + 4 + false + + + none + true + bin\Release + prompt + 4 + false + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + mkdir "$(SolutionDir)mods/d2k/" +copy "$(TargetPath)" "$(SolutionDir)mods/d2k/" +cd "$(SolutionDir)" + + + + {F33337BE-CB69-4B24-850F-07D23E408DDF} + OpenRA.Utility + + + {0DFB103F-2962-400F-8C6D-E2C28CCBA633} + OpenRA.Game + + + {BDAEAB25-991E-46A7-AF1E-4F0E03358DAA} + OpenRA.FileFormats + + + {1A8E50CC-EE32-4E57-8842-0C39C8EA7541} + OpenRA.TilesetBuilder + + + \ No newline at end of file diff --git a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.sln b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.sln new file mode 100644 index 0000000000..4d2936cdc9 --- /dev/null +++ b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.D2k", "OpenRA.Mods.D2k.csproj", "{C0B0465C-6BE2-409C-8770-3A9BF64C4344}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = OpenRA.Mods.D2k.csproj + EndGlobalSection +EndGlobal diff --git a/OpenRA.Mods.D2k/Properties/AssemblyInfo.cs b/OpenRA.Mods.D2k/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..d76af3c9e2 --- /dev/null +++ b/OpenRA.Mods.D2k/Properties/AssemblyInfo.cs @@ -0,0 +1,39 @@ +#region Copyright & License Information +/* + * Copyright 2012 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("OpenRA.Mods.D2k")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenRA.Mods.D2k")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/OpenRA.Mods.D2k/Render/RenderBuildingSeparateTurret.cs b/OpenRA.Mods.D2k/Render/RenderBuildingSeparateTurret.cs new file mode 100644 index 0000000000..9240f27bf2 --- /dev/null +++ b/OpenRA.Mods.D2k/Render/RenderBuildingSeparateTurret.cs @@ -0,0 +1,48 @@ +#region Copyright & License Information +/* + * Copyright 2007-2012 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +/*using System; +using OpenRA.Mods.RA.Buildings; +using OpenRA.Graphics; +using OpenRA.Traits; + +namespace OpenRA.Mods.RA.Render +{ + class RenderBuildingSeparateTurretInfo : RenderBuildingInfo, Requires, Requires + { + public override object Create(ActorInitializer init) { return new RenderBuildingSeparateTurret( init, this ); } + } + + class RenderBuildingSeparateTurret : RenderBuilding + { + public RenderBuildingSeparateTurret( ActorInitializer init, RenderBuildingInfo info ) + : base(init, info, MakeTurretFacingFunc(init.self)) + { + var turretAnim = new Animation(GetImage(self), () => turreted.turretFacing ); + turretAnim.Play( "turret" ); + + for( var i = 0; i < attack.Turrets.Count; i++ ) + { + var turret = attack.Turrets[i]; + anims.Add( "turret_{0}".F(i), + new AnimationWithOffset( turretAnim, + () => Combat.GetTurretPosition( self, facing, turret ), + null)); + } + } + + static Func MakeTurretFacingFunc(Actor self) + { + var turreted = self.Trait(); + return () => turreted.turretFacing; + } + + } +} */ diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs new file mode 100644 index 0000000000..9a7ba02153 --- /dev/null +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs @@ -0,0 +1,487 @@ +#region Copyright & License Information +/* + * Copyright 2007-2012 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using System.IO; +using System.Linq; +using System.Threading; +using System.Diagnostics; +using OpenRA.FileFormats; +using OpenRA.FileFormats.Graphics; +using OpenRA.Widgets; +using OpenRA.Utility; + +namespace OpenRA.Mods.D2k.Widgets.Logic +{ + public class D2kExtractGameFilesLogic + { + Widget panel; + ProgressBarWidget progressBar; + LabelWidget statusLabel; + ButtonWidget retryButton, backButton; + Widget extractingContainer, copyFilesContainer; + + [ObjectCreator.UseCtor] + public D2kExtractGameFilesLogic(Widget widget) + { + panel = widget.Get("EXTRACT_GAMEFILES_PANEL"); + progressBar = panel.Get("PROGRESS_BAR"); + statusLabel = panel.Get("STATUS_LABEL"); + + backButton = panel.Get("BACK_BUTTON"); + backButton.OnClick = Ui.CloseWindow; + + retryButton = panel.Get("RETRY_BUTTON"); + retryButton.OnClick = Extract; + + extractingContainer = panel.Get("EXTRACTING"); + copyFilesContainer = panel.Get("COPY_FILES"); + Extract(); + } + + void Extract() + { + backButton.IsDisabled = () => true; + retryButton.IsDisabled = () => true; + copyFilesContainer.IsVisible = () => false; + extractingContainer.IsVisible = () => true; + + var PathToDataR8 = Path.Combine(Platform.SupportDir, "Content/d2k/DATA.R8"); + var PathToPalette = "mods/d2k/bits/d2k.pal"; + var PathToImages = Path.Combine(Platform.SupportDir, "Content/d2k/SHPs"); + + var ExtractGameFiles = new string[][] + { + new string[] {"--r8", PathToDataR8, PathToPalette, "0", "2", Path.Combine(PathToImages, "overlay")}, + //new string[] {"--r8", PathToDataR8, PathToPalette, "40", "101", Path.Combine(PathToImages, "shadow")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "102", "105", Path.Combine(PathToImages, "crates")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "107", "109", Path.Combine(PathToImages, "spicebloom")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "114", "129", Path.Combine(PathToImages, "rockcrater1")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "130", "145", Path.Combine(PathToImages, "rockcrater2")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "146", "161", Path.Combine(PathToImages, "sandcrater1")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "162", "177", Path.Combine(PathToImages, "sandcrater2")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "206", "381", Path.Combine(PathToImages, "rifle"), "--infantry"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "382", "457", Path.Combine(PathToImages, "rifledeath"), "--infantrydeath"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "458", "693", Path.Combine(PathToImages, "rocket"), "--infantry"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "694", "929", Path.Combine(PathToImages, "fremen"), "--infantry"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "930", "1165", Path.Combine(PathToImages, "sardaukar"), "--infantry"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1166", "1221", Path.Combine(PathToImages, "engineer"), "--infantry"}, // death animation 1342..1401 + new string[] {"--r8", PathToDataR8, PathToPalette, "1402", "1502", Path.Combine(PathToImages, "thumper"), "--infantry"}, // death animations 1543..1602 + new string[] {"--r8", PathToDataR8, PathToPalette, "1603", "1634", Path.Combine(PathToImages, "missile"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1635", "1666", Path.Combine(PathToImages, "trike"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1667", "1698", Path.Combine(PathToImages, "quad"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1699", "1730", Path.Combine(PathToImages, "harvester"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1731", "1762", Path.Combine(PathToImages, "combata"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1763", "1794", Path.Combine(PathToImages, "siege"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1795", "1826", Path.Combine(PathToImages, "dmcv"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1827", "1858", Path.Combine(PathToImages, "sonic"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1859", "1890", Path.Combine(PathToImages, "combataturret"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1891", "1922", Path.Combine(PathToImages, "siegeturret"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1923", "1954", Path.Combine(PathToImages, "carryall"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "1955", "2050", Path.Combine(PathToImages, "orni"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2051", "2082", Path.Combine(PathToImages, "combath"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2083", "2114", Path.Combine(PathToImages, "devast"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2115", "2146", Path.Combine(PathToImages, "combathturret"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2147", "2148", Path.Combine(PathToImages, "deathhandmissile")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2245", "2284", Path.Combine(PathToImages, "saboteur"), "--infantry"}, //#death animations 2325..2388 + //rifleinfantry repetitions? + new string[] {"--r8", PathToDataR8, PathToPalette, "2389", "2420", Path.Combine(PathToImages, "deviator"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2421", "2452", Path.Combine(PathToImages, "raider"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2453", "2484", Path.Combine(PathToImages, "combato"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2485", "2516", Path.Combine(PathToImages, "combatoturret"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2517", "2517", Path.Combine(PathToImages, "frigate"), "--vehicle"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2518", "2520", Path.Combine(PathToImages, "heavya"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2521", "2522", Path.Combine(PathToImages, "radara"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2523", "2524", Path.Combine(PathToImages, "pwra"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2525", "2526", Path.Combine(PathToImages, "barra"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2527", "2558", Path.Combine(PathToImages, "wall"), "--wall"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2559", "2560", Path.Combine(PathToImages, "conyarda"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2561", "2563", Path.Combine(PathToImages, "refa"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2564", "2565", Path.Combine(PathToImages, "hightecha"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2566", "2570", Path.Combine(PathToImages, "siloa"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2571", "2572", Path.Combine(PathToImages, "repaira"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2573", "2588", Path.Combine(PathToImages, "guntower"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2589", "2620", Path.Combine(PathToImages, "gunturret"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2621", "2636", Path.Combine(PathToImages, "rockettower"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2637", "2668", Path.Combine(PathToImages, "rocketturreta"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2669", "2670", Path.Combine(PathToImages, "researcha"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2671", "2672", Path.Combine(PathToImages, "starporta"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2673", "2675", Path.Combine(PathToImages, "lighta"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2676", "2677", Path.Combine(PathToImages, "palacea"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2678", "2680", Path.Combine(PathToImages, "heavyh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2681", "2682", Path.Combine(PathToImages, "radarh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2683", "2684", Path.Combine(PathToImages, "pwrh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2685", "2686", Path.Combine(PathToImages, "barrh"), "--building"}, + // identical wall + new string[] {"--r8", PathToDataR8, PathToPalette, "2719", "2720", Path.Combine(PathToImages, "conyardh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2721", "2723", Path.Combine(PathToImages, "refh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2724", "2725", Path.Combine(PathToImages, "hightechh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2726", "2730", Path.Combine(PathToImages, "siloh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2731", "2732", Path.Combine(PathToImages, "repairh"), "--building"}, + // identical guntower + new string[] {"--r8", PathToDataR8, PathToPalette, "2749", "2780", Path.Combine(PathToImages, "gunturreth"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2797", "2828", Path.Combine(PathToImages, "rocketturreth"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2829", "2830", Path.Combine(PathToImages, "researchh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2831", "2832", Path.Combine(PathToImages, "starporth"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2833", "2835", Path.Combine(PathToImages, "lighth"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2836", "2837", Path.Combine(PathToImages, "palaceh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2838", "2840", Path.Combine(PathToImages, "heavyo"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2841", "2842", Path.Combine(PathToImages, "radaro"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2843", "2844", Path.Combine(PathToImages, "pwro"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2845", "2846", Path.Combine(PathToImages, "barro"), "--building"}, + // identical wall + new string[] {"--r8", PathToDataR8, PathToPalette, "2879", "2880", Path.Combine(PathToImages, "conyardo"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2881", "2883", Path.Combine(PathToImages, "refo"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2884", "2885", Path.Combine(PathToImages, "hightecho"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2886", "2890", Path.Combine(PathToImages, "siloo"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2891", "2892", Path.Combine(PathToImages, "repairo"), "--building"}, + // identical guntower + new string[] {"--r8", PathToDataR8, PathToPalette, "2909", "2940", Path.Combine(PathToImages, "gunturreto"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2957", "2988", Path.Combine(PathToImages, "rocketturreto"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2989", "2990", Path.Combine(PathToImages, "researcho"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2991", "2992", Path.Combine(PathToImages, "starporto"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2993", "2995", Path.Combine(PathToImages, "lighto"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "2996", "2997", Path.Combine(PathToImages, "palaceo"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "3549", "3564", Path.Combine(PathToImages, "sandwormmouth")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "3565", "3585", Path.Combine(PathToImages, "sandwormdust")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "3586", "3600", Path.Combine(PathToImages, "wormsigns1")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "3601", "3610", Path.Combine(PathToImages, "wormsigns2")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "3611", "3615", Path.Combine(PathToImages, "wormsigns3")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "3616", "3620", Path.Combine(PathToImages, "wormsigns4")}, + //new string[] {"--r8", PathToDataR8, PathToPalette, "3679", "3686", "sell"}, + //explosions and muzzle flash + new string[] {"--r8", PathToDataR8, PathToPalette, "4011", "4011", Path.Combine(PathToImages, "rifleicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4012", "4012", Path.Combine(PathToImages, "bazookaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4013", "4013", Path.Combine(PathToImages, "engineericon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4014", "4014", Path.Combine(PathToImages, "thumpericon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4015", "4015", Path.Combine(PathToImages, "sadaukaricon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4016", "4016", Path.Combine(PathToImages, "trikeicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4017", "4017", Path.Combine(PathToImages, "raidericon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4018", "4018", Path.Combine(PathToImages, "quadicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4019", "4019", Path.Combine(PathToImages, "harvestericon")}, // == 4044 + new string[] {"--r8", PathToDataR8, PathToPalette, "4020", "4020", Path.Combine(PathToImages, "combataicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4021", "4021", Path.Combine(PathToImages, "combathicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4022", "4022", Path.Combine(PathToImages, "combatoicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4023", "4023", Path.Combine(PathToImages, "mcvicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4024", "4024", Path.Combine(PathToImages, "missileicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4025", "4025", Path.Combine(PathToImages, "deviatoricon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4026", "4026", Path.Combine(PathToImages, "siegeicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4027", "4027", Path.Combine(PathToImages, "sonicicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4028", "4028", Path.Combine(PathToImages, "devasticon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4029", "4029", Path.Combine(PathToImages, "carryallicon")}, // == 4030 + new string[] {"--r8", PathToDataR8, PathToPalette, "4031", "4031", Path.Combine(PathToImages, "orniicon")}, // == 4062 + new string[] {"--r8", PathToDataR8, PathToPalette, "4032", "4032", Path.Combine(PathToImages, "fremenicon")}, // == 4033 + new string[] {"--r8", PathToDataR8, PathToPalette, "4034", "4034", Path.Combine(PathToImages, "saboteuricon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4035", "4035", Path.Combine(PathToImages, "deathhandicon")}, + // "4036..4045 = repetitions + new string[] {"--r8", PathToDataR8, PathToPalette, "4046", "4046", Path.Combine(PathToImages, "conyardaicon")}, // == 4049 + new string[] {"--r8", PathToDataR8, PathToPalette, "4047", "4047", Path.Combine(PathToImages, "conyardhicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4048", "4048", Path.Combine(PathToImages, "conyardoicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4050", "4050", Path.Combine(PathToImages, "4plateicon")}, // == 4051..4052 + new string[] {"--r8", PathToDataR8, PathToPalette, "4053", "4053", Path.Combine(PathToImages, "6plateicon")}, // == 4054..4055 + new string[] {"--r8", PathToDataR8, PathToPalette, "4056", "4056", Path.Combine(PathToImages, "pwraicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4057", "4057", Path.Combine(PathToImages, "pwrhicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4058", "4058", Path.Combine(PathToImages, "pwroicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4059", "4059", Path.Combine(PathToImages, "barraicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4060", "4060", Path.Combine(PathToImages, "barrhicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4061", "4061", Path.Combine(PathToImages, "barroicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4063", "4063", Path.Combine(PathToImages, "wallicon")}, // == 4061..4062 + new string[] {"--r8", PathToDataR8, PathToPalette, "4066", "4066", Path.Combine(PathToImages, "refaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4067", "4067", Path.Combine(PathToImages, "refhicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4068", "4068", Path.Combine(PathToImages, "refoicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4069", "4069", Path.Combine(PathToImages, "turreticon")}, // == 4070..4071 + new string[] {"--r8", PathToDataR8, PathToPalette, "4072", "4072", Path.Combine(PathToImages, "radaraicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4072", "4072", Path.Combine(PathToImages, "radaraicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4073", "4073", Path.Combine(PathToImages, "radarhicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4074", "4074", Path.Combine(PathToImages, "radaroicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4075", "4075", Path.Combine(PathToImages, "rturreticon")}, // == 4076..4077 + new string[] {"--r8", PathToDataR8, PathToPalette, "4078", "4078", Path.Combine(PathToImages, "hightechaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4079", "4079", Path.Combine(PathToImages, "hightechhicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4080", "4080", Path.Combine(PathToImages, "hightechoicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4081", "4081", Path.Combine(PathToImages, "lightaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4082", "4082", Path.Combine(PathToImages, "lighthicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4083", "4083", Path.Combine(PathToImages, "lightoicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4084", "4084", Path.Combine(PathToImages, "siloaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4085", "4085", Path.Combine(PathToImages, "silohicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4086", "4086", Path.Combine(PathToImages, "silooicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4087", "4087", Path.Combine(PathToImages, "heavyaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4088", "4088", Path.Combine(PathToImages, "heavyhicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4089", "4089", Path.Combine(PathToImages, "heavyoicon")}, + // 4090 == orniicon + // 4091 == heavyhicon + new string[] {"--r8", PathToDataR8, PathToPalette, "4092", "4092", Path.Combine(PathToImages, "starportaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4093", "4093", Path.Combine(PathToImages, "starporthicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4094", "4094", Path.Combine(PathToImages, "starportoicon")}, + // 4095 = orniicon + new string[] {"--r8", PathToDataR8, PathToPalette, "4096", "4096", Path.Combine(PathToImages, "repairaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4097", "4097", Path.Combine(PathToImages, "repairhicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4098", "4098", Path.Combine(PathToImages, "repairoicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4099", "4099", Path.Combine(PathToImages, "researchaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4100", "4100", Path.Combine(PathToImages, "researchhicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4101", "4101", Path.Combine(PathToImages, "researchoicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4102", "4102", Path.Combine(PathToImages, "palaceaicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4103", "4103", Path.Combine(PathToImages, "palacehicon")}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4104", "4104", Path.Combine(PathToImages, "palaceoicon")}, + // 4105 = orniicon + // 4106..4107 = radaraicon + // 4108 = conyardaicon + new string[] {"--r8", PathToDataR8, PathToPalette, "4109", "4150", Path.Combine(PathToImages, "conmake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4151", "4174", Path.Combine(PathToImages, "wtrpmake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4175", "4194", Path.Combine(PathToImages, "barramake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4231", "4253", Path.Combine(PathToImages, "refmake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4254", "4273", Path.Combine(PathToImages, "radarmake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4274", "4294", Path.Combine(PathToImages, "highmake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4295", "4312", Path.Combine(PathToImages, "lightmake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4313", "4327", Path.Combine(PathToImages, "silomake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4328", "4346", Path.Combine(PathToImages, "heavymake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4347", "4369", Path.Combine(PathToImages, "starportmake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4370", "4390", Path.Combine(PathToImages, "repairmake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4391", "4412", Path.Combine(PathToImages, "researchmake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4413", "4435", Path.Combine(PathToImages, "palacemake"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4436", "4449", Path.Combine(PathToImages, "cranea"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4450", "4463", Path.Combine(PathToImages, "craneh"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4463", "4477", Path.Combine(PathToImages, "craneo"), "--building"}, + new string[] {"--r8", PathToDataR8, PathToPalette, "4760", "4819", Path.Combine(PathToImages, "windtrap_anim"), "--building"}, //? + new string[] {"--r8", PathToDataR8, PathToPalette, "4820", "4840", Path.Combine(PathToImages, "missile_launch"), "--building"}, + new string[] {"--r8", Path.Combine(Platform.SupportDir, "Content/d2k/MOUSE.R8"), PathToPalette, "0", "264", Path.Combine(PathToImages, "mouse"), "--transparent"}, + new string[] {"--r8", Path.Combine(Platform.SupportDir, "Content/d2k/BLOXBASE.R8"), PathToPalette, "0", "799", Path.Combine(PathToImages, "BASE"), "--tileset"}, + new string[] {"--r8", Path.Combine(Platform.SupportDir, "Content/d2k/BLOXBASE.R8"), PathToPalette, "748", "749", Path.Combine(PathToImages, "spice0")}, + }; + + var SHPsToCreate = new string[][] + { + new string[] {"--shp", Path.Combine(PathToImages, "overlay.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "crates.png"), "32"}, + //new string[] {"--shp", Path.Combine(PathToImages, "shadow.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "spicebloom.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "rockcrater1.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "rockcrater2.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "sandcrater1.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "sandcrater2.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "rifle.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "rifledeath.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "rocket.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "fremen.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "sardaukar.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "engineer.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "thumper.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "missile.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "trike.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "quad.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "harvester.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "combata.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "siege.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "dmcv.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "sonic.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "combataturret.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "siegeturret.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "carryall.png"), "64"}, + new string[] {"--shp", Path.Combine(PathToImages, "orni.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "combath.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "devast.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "combathturret.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "deathhandmissile.png"), "24"}, + new string[] {"--shp", Path.Combine(PathToImages, "saboteur.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "deviator.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "raider.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "combato.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "combatoturret.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "frigate.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "heavya.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "radara.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "pwra.png"), "64"}, + new string[] {"--shp", Path.Combine(PathToImages, "barra.png"), "80"}, + new string[] {"--shp", Path.Combine(PathToImages, "wall.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "conyarda.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "refa.png"), "120"}, + new string[] {"--shp", Path.Combine(PathToImages, "hightecha.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "siloa.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "repaira.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "guntower.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "gunturret.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "rockettower.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "rocketturreta.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "researcha.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "starporta.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "lighta.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "palacea.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "heavyh.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "radarh.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "pwrh.png"), "64"}, + new string[] {"--shp", Path.Combine(PathToImages, "barrh.png"), "64"}, + new string[] {"--shp", Path.Combine(PathToImages, "conyardh.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "refh.png"), "120"}, + new string[] {"--shp", Path.Combine(PathToImages, "hightechh.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "siloh.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "repairh.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "gunturreth.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "rocketturreth.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "researchh.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "starporth.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "lighth.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "palaceh.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "heavyo.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "radaro.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "pwro.png"), "64"}, + new string[] {"--shp", Path.Combine(PathToImages, "barro.png"), "64"}, + new string[] {"--shp", Path.Combine(PathToImages, "conyardo.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "refo.png"), "120"}, + new string[] {"--shp", Path.Combine(PathToImages, "hightecho.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "siloo.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "repairo.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "gunturreto.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "rocketturreto.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "researcho.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "starporto.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "lighto.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "palaceo.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "sandwormmouth.png"), "68"}, + new string[] {"--shp", Path.Combine(PathToImages, "sandwormdust.png"), "68"}, + new string[] {"--shp", Path.Combine(PathToImages, "wormsigns1.png"), "16"}, + new string[] {"--shp", Path.Combine(PathToImages, "wormsigns2.png"), "16"}, + new string[] {"--shp", Path.Combine(PathToImages, "wormsigns3.png"), "16"}, + new string[] {"--shp", Path.Combine(PathToImages, "wormsigns4.png"), "16"}, + //new string[] {"--shp", Path.Combine(PathToImages, "sell.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "rifleicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "bazookaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "engineericon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "thumpericon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "sadaukaricon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "trikeicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "raidericon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "quadicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "harvestericon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "combataicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "combathicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "combatoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "mcvicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "missileicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "deviatoricon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "siegeicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "sonicicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "devasticon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "carryallicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "orniicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "fremenicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "saboteuricon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "deathhandicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "conyardaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "conyardhicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "conyardoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "4plateicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "6plateicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "pwraicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "pwrhicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "pwroicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "barraicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "barrhicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "barroicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "wallicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "refaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "refhicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "refoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "turreticon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "radaraicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "radarhicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "radaroicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "rturreticon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "hightechaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "hightechhicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "hightechoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "lightaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "lighthicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "lightoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "siloaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "silohicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "silooicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "heavyaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "heavyhicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "heavyoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "starportaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "starporthicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "starportoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "repairaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "repairhicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "repairoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "researchaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "researchhicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "researchoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "palaceaicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "palacehicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "palaceoicon.png"), "60"}, + new string[] {"--shp", Path.Combine(PathToImages, "conmake.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "wtrpmake.png"), "64"}, + new string[] {"--shp", Path.Combine(PathToImages, "barramake.png"), "80"}, + new string[] {"--shp", Path.Combine(PathToImages, "refmake.png"), "120"}, + new string[] {"--shp", Path.Combine(PathToImages, "radarmake.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "highmake.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "lightmake.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "silomake.png"), "32"}, + new string[] {"--shp", Path.Combine(PathToImages, "heavymake.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "starportmake.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "repairmake.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "researchmake.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "palacemake.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "cranea.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "craneh.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "craneo.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "windtrap_anim.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "missile_launch.png"), "96"}, + new string[] {"--shp", Path.Combine(PathToImages, "mouse.png"), "48"}, + new string[] {"--shp", Path.Combine(PathToImages, "spice0.png"), "32"}, + }; + + var onError = (Action)(s => Game.RunAfterTick(() => + { + statusLabel.GetText = () => "Error: "+s; + backButton.IsDisabled = () => false; + retryButton.IsDisabled = () => false; + })); + + var t = new Thread( _ => + { + try + { + for (int i = 0; i < ExtractGameFiles.Length; i++) + { + progressBar.Percentage = i*100/ExtractGameFiles.Count(); + statusLabel.GetText = () => "Extracting..."; + Utility.Command.ConvertR8ToPng(ExtractGameFiles[i]); + } + + for (int i = 0; i < SHPsToCreate.Length; i++) + { + progressBar.Percentage = i*100/SHPsToCreate.Count(); + statusLabel.GetText = () => "Converting..."; + Utility.Command.ConvertPngToShp(SHPsToCreate[i]); + File.Delete(SHPsToCreate[i][1]); + } + + File.Delete(Path.Combine(PathToImages, "BASE.tsx")); + File.Copy("mods/d2k/tilesets/BASE.tsx", Path.Combine(PathToImages, "BASE.tsx")); + // this is ugly: a GUI will open and close immediately after some delay + Process.Start("OpenRA.TilesetBuilder.exe", Path.Combine(PathToImages, "BASE.png")+" 32 --export Content/d2k/Tilesets"); + + Game.RunAfterTick(() => + { + progressBar.Percentage = 100; + statusLabel.GetText = () => "Extraction and conversion complete."; + backButton.IsDisabled = () => false; + }); + } + catch + { + onError("Installation failed"); + } + }) { IsBackground = true }; + t.Start(); + } + } +} diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs new file mode 100644 index 0000000000..ee1b60f32b --- /dev/null +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs @@ -0,0 +1,127 @@ +#region Copyright & License Information +/* + * Copyright 2007-2012 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using System.IO; +using System.Linq; +using System.Threading; +using OpenRA.FileFormats; +using OpenRA.FileFormats.Graphics; +using OpenRA.Widgets; +using OpenRA.Utility; + +namespace OpenRA.Mods.D2k.Widgets.Logic +{ + public class D2kInstallFromCDLogic + { + Widget panel; + ProgressBarWidget progressBar; + LabelWidget statusLabel; + ButtonWidget retryButton, backButton; + Widget installingContainer, insertDiskContainer; + + [ObjectCreator.UseCtor] + public D2kInstallFromCDLogic(Widget widget) + { + panel = widget.Get("INSTALL_FROMCD_PANEL"); + progressBar = panel.Get("PROGRESS_BAR"); + statusLabel = panel.Get("STATUS_LABEL"); + + backButton = panel.Get("BACK_BUTTON"); + backButton.OnClick = Ui.CloseWindow; + + retryButton = panel.Get("RETRY_BUTTON"); + retryButton.OnClick = CheckForDisk; + + installingContainer = panel.Get("INSTALLING"); + insertDiskContainer = panel.Get("INSERT_DISK"); + CheckForDisk(); + } + + public static bool IsValidDisk(string diskRoot) + { + var files = new string[][] { + new [] { diskRoot, "music", "ambush.aud" }, + new [] { diskRoot, "setup", "setup.z" }, + }; + + return files.All(f => File.Exists(f.Aggregate(Path.Combine))); + } + + void CheckForDisk() + { + var path = InstallUtils.GetMountedDisk(IsValidDisk); + + if (path != null) + Install(path); + else + { + insertDiskContainer.IsVisible = () => true; + installingContainer.IsVisible = () => false; + } + } + + void Install(string source) + { + backButton.IsDisabled = () => true; + retryButton.IsDisabled = () => true; + insertDiskContainer.IsVisible = () => false; + installingContainer.IsVisible = () => true; + + var dest = new string[] { Platform.SupportDir, "Content", "d2k", "Music" }.Aggregate(Path.Combine); + var copyFiles = new string[] { "music/ambush.aud", "music/arakatak.aud", "music/atregain.aud", "music/entordos.aud", "music/fightpwr.aud", "music/fremen.aud", "music/hark_bat.aud", "music/landsand.aud", "music/options.aud", "music/plotting.aud", "music/risehark.aud", "music/robotix.aud", "music/score.aud", "music/soldappr.aud", "music/spicesct.aud", "music/undercon.aud", "music/waitgame.aud" }; + + // TODO: won't work yet: + //var extractPackage = "setup/setup.z"; + //var extractFiles = new string[] { "DATA.R8", "MOUSE.R8", "BLOXBASE.R8", "BLOXBAT.R8", "BLOXBGBS.R8", "BLOXICE.R8", "BLOXTREE.R8", "BLOXWAST.R8" }; + + var installCounter = 0; + var installTotal = copyFiles.Count(); //+ extractFiles.Count(); + + var onProgress = (Action)(s => Game.RunAfterTick(() => + { + progressBar.Percentage = installCounter*100/installTotal; + installCounter++; + + statusLabel.GetText = () => s; + })); + + var onError = (Action)(s => Game.RunAfterTick(() => + { + statusLabel.GetText = () => "Error: "+s; + backButton.IsDisabled = () => false; + retryButton.IsDisabled = () => false; + })); + + var t = new Thread( _ => + { + try + { + if (!InstallUtils.CopyFiles(source, copyFiles, dest, onProgress, onError)) + return; + + //if (!InstallUtils.ExtractFromPackage(source, extractPackage, extractFiles, dest, onProgress, onError)) + // return; + + Game.RunAfterTick(() => + { + statusLabel.GetText = () => "Music has been copied."; + backButton.IsDisabled = () => false; + }); + } + catch + { + onError("Installation failed"); + } + }) { IsBackground = true }; + t.Start(); + } + } +} diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallLogic.cs new file mode 100644 index 0000000000..f5249c58d6 --- /dev/null +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallLogic.cs @@ -0,0 +1,38 @@ +#region Copyright & License Information +/* + * Copyright 2007-2012 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using System.Collections.Generic; +using OpenRA.Widgets; + +namespace OpenRA.Mods.D2k.Widgets.Logic +{ + public class D2kInstallLogic + { + [ObjectCreator.UseCtor] + public D2kInstallLogic(Widget widget, Dictionary installData) + { + var panel = widget.Get("INSTALL_PANEL"); + var args = new WidgetArgs() + { + { "afterInstall", () => { Ui.CloseWindow(); Game.Exit(); } }, + { "installData", installData } + }; + + panel.Get("COPY_BUTTON").OnClick = () => + Ui.OpenWindow("INSTALL_FROMCD_PANEL", args); + + panel.Get("EXTRACT_BUTTON").OnClick = () => + Ui.OpenWindow("EXTRACT_GAMEFILES_PANEL", args); + + panel.Get("QUIT_BUTTON").OnClick = Game.Exit; + } + } +} diff --git a/OpenRA.Mods.RA/AI/HackyAI.cs b/OpenRA.Mods.RA/AI/HackyAI.cs index 5145b3bc21..be02529d02 100644 --- a/OpenRA.Mods.RA/AI/HackyAI.cs +++ b/OpenRA.Mods.RA/AI/HackyAI.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.AI public readonly int SquadSize = 8; public readonly int AssignRolesInterval = 20; public readonly string RallypointTestBuilding = "fact"; // temporary hack to maintain previous rallypoint behavior. - public readonly string[] UnitQueues = { "Vehicle", "Infantry", "Plane" }; + public readonly string[] UnitQueues = {"Vehicle", "Infantry", "Plane"}; public readonly bool ShouldRepairBuildings = true; string IBotInfo.Name { get { return this.Name; } } @@ -182,7 +182,7 @@ namespace OpenRA.Mods.RA.AI ticks++; - if (ticks == 10) + if (ticks == 1) DeployMcv(self); if (ticks % feedbackTime == 0) @@ -261,14 +261,14 @@ namespace OpenRA.Mods.RA.AI assignRolesTicks = Info.AssignRolesInterval; var newUnits = self.World.ActorsWithTrait() - .Where(a => a.Actor.Owner == p && a.Actor.Info != Rules.Info["mcv"] + .Where(a => a.Actor.Owner == p && !a.Actor.HasTrait() && !activeUnits.Contains(a.Actor)) .Select(a => a.Actor).ToArray(); foreach (var a in newUnits) { BotDebug("AI: Found a newly built unit"); - if (a.Info == Rules.Info["harv"]) + if (a.HasTrait()) world.IssueOrder( new Order( "Harvest", a, false ) ); else unitsHangingAroundTheBase.Add(a); @@ -419,7 +419,7 @@ namespace OpenRA.Mods.RA.AI { /* find our mcv and deploy it */ var mcv = self.World.Actors - .FirstOrDefault(a => a.Owner == p && a.Info == Rules.Info["mcv"]); + .FirstOrDefault(a => a.Owner == p && a.HasTrait()); if (mcv != null) { @@ -427,7 +427,7 @@ namespace OpenRA.Mods.RA.AI world.IssueOrder(new Order("DeployTransform", mcv, false)); } else - BotDebug("AI: Can't find the MCV."); + BotDebug("AI: Can't find BaseBuildUnit."); } internal IEnumerable FindQueues(string category) diff --git a/OpenRA.TilesetBuilder/Form1.Designer.cs b/OpenRA.TilesetBuilder/Form1.Designer.cs deleted file mode 100644 index 6c5336a3fc..0000000000 --- a/OpenRA.TilesetBuilder/Form1.Designer.cs +++ /dev/null @@ -1,326 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -namespace OpenRA.TilesetBuilder -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); - this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); - this.panel1 = new System.Windows.Forms.Panel(); - this.surface1 = new OpenRA.TilesetBuilder.Surface(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton14 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButton4 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton12 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton11 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton10 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton9 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton8 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton7 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton6 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton5 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton13 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripContainer1.ContentPanel.SuspendLayout(); - this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); - this.toolStripContainer1.SuspendLayout(); - this.panel1.SuspendLayout(); - this.toolStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // toolStripContainer1 - // - // - // toolStripContainer1.ContentPanel - // - this.toolStripContainer1.ContentPanel.Controls.Add(this.panel1); - this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(745, 571); - this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.toolStripContainer1.Location = new System.Drawing.Point(0, 0); - this.toolStripContainer1.Name = "toolStripContainer1"; - this.toolStripContainer1.Size = new System.Drawing.Size(745, 596); - this.toolStripContainer1.TabIndex = 0; - this.toolStripContainer1.Text = "toolStripContainer1"; - // - // toolStripContainer1.TopToolStripPanel - // - this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1); - // - // panel1 - // - this.panel1.AutoScroll = true; - this.panel1.Controls.Add(this.surface1); - this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(745, 571); - this.panel1.TabIndex = 0; - // - // surface1 - // - this.surface1.BackColor = System.Drawing.Color.Black; - this.surface1.Location = new System.Drawing.Point(0, 0); - this.surface1.Name = "surface1"; - this.surface1.Size = new System.Drawing.Size(598, 372); - this.surface1.TabIndex = 2; - this.surface1.Text = "surface1"; - // - // toolStrip1 - // - this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None; - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton2, - this.toolStripButton14, - this.toolStripButton3, - this.toolStripSeparator1, - this.toolStripButton4, - this.toolStripButton12, - this.toolStripButton11, - this.toolStripButton10, - this.toolStripButton9, - this.toolStripButton8, - this.toolStripButton7, - this.toolStripButton6, - this.toolStripButton5, - this.toolStripButton13, - this.toolStripButton1}); - this.toolStrip1.Location = new System.Drawing.Point(3, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(602, 25); - this.toolStrip1.TabIndex = 0; - // - // toolStripButton2 - // - this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image"))); - this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton2.Name = "toolStripButton2"; - this.toolStripButton2.Size = new System.Drawing.Size(51, 22); - this.toolStripButton2.Text = "Save"; - this.toolStripButton2.Click += new System.EventHandler(this.SaveClicked); - // - // toolStripButton14 - // - this.toolStripButton14.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton14.Image"))); - this.toolStripButton14.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton14.Name = "toolStripButton14"; - this.toolStripButton14.Size = new System.Drawing.Size(60, 22); - this.toolStripButton14.Text = "Export"; - this.toolStripButton14.Click += new System.EventHandler(this.ExportClicked); - // - // toolStripButton3 - // - this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image"))); - this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton3.Name = "toolStripButton3"; - this.toolStripButton3.Size = new System.Drawing.Size(104, 22); - this.toolStripButton3.Text = "Show Overlays"; - this.toolStripButton3.Click += new System.EventHandler(this.ShowOverlaysClicked); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); - // - // toolStripButton4 - // - this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton4.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image"))); - this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton4.Name = "toolStripButton4"; - this.toolStripButton4.Size = new System.Drawing.Size(25, 22); - this.toolStripButton4.Tag = "0"; - this.toolStripButton4.Text = "tt0"; - this.toolStripButton4.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton12 - // - this.toolStripButton12.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton12.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton12.Image"))); - this.toolStripButton12.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton12.Name = "toolStripButton12"; - this.toolStripButton12.Size = new System.Drawing.Size(25, 22); - this.toolStripButton12.Tag = "1"; - this.toolStripButton12.Text = "tt1"; - this.toolStripButton12.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton11 - // - this.toolStripButton11.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton11.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton11.Image"))); - this.toolStripButton11.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton11.Name = "toolStripButton11"; - this.toolStripButton11.Size = new System.Drawing.Size(25, 22); - this.toolStripButton11.Tag = "2"; - this.toolStripButton11.Text = "tt2"; - this.toolStripButton11.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton10 - // - this.toolStripButton10.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton10.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton10.Image"))); - this.toolStripButton10.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton10.Name = "toolStripButton10"; - this.toolStripButton10.Size = new System.Drawing.Size(25, 22); - this.toolStripButton10.Tag = "3"; - this.toolStripButton10.Text = "tt3"; - this.toolStripButton10.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton9 - // - this.toolStripButton9.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton9.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton9.Image"))); - this.toolStripButton9.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton9.Name = "toolStripButton9"; - this.toolStripButton9.Size = new System.Drawing.Size(25, 22); - this.toolStripButton9.Tag = "4"; - this.toolStripButton9.Text = "tt4"; - this.toolStripButton9.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton8 - // - this.toolStripButton8.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton8.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton8.Image"))); - this.toolStripButton8.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton8.Name = "toolStripButton8"; - this.toolStripButton8.Size = new System.Drawing.Size(25, 22); - this.toolStripButton8.Tag = "5"; - this.toolStripButton8.Text = "tt5"; - this.toolStripButton8.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton7 - // - this.toolStripButton7.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton7.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton7.Image"))); - this.toolStripButton7.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton7.Name = "toolStripButton7"; - this.toolStripButton7.Size = new System.Drawing.Size(25, 22); - this.toolStripButton7.Tag = "6"; - this.toolStripButton7.Text = "tt6"; - this.toolStripButton7.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton6 - // - this.toolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton6.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton6.Image"))); - this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton6.Name = "toolStripButton6"; - this.toolStripButton6.Size = new System.Drawing.Size(25, 22); - this.toolStripButton6.Tag = "7"; - this.toolStripButton6.Text = "tt7"; - this.toolStripButton6.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton5 - // - this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton5.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton5.Image"))); - this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton5.Name = "toolStripButton5"; - this.toolStripButton5.Size = new System.Drawing.Size(25, 22); - this.toolStripButton5.Tag = "8"; - this.toolStripButton5.Text = "tt8"; - this.toolStripButton5.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // toolStripButton13 - // - this.toolStripButton13.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton13.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton13.Image"))); - this.toolStripButton13.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton13.Name = "toolStripButton13"; - this.toolStripButton13.Size = new System.Drawing.Size(25, 22); - this.toolStripButton13.Tag = "9"; - this.toolStripButton13.Text = "tt9"; - // - // toolStripButton1 - // - this.toolStripButton1.Checked = true; - this.toolStripButton1.CheckState = System.Windows.Forms.CheckState.Checked; - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(88, 22); - this.toolStripButton1.Text = "Template Tool"; - this.toolStripButton1.Click += new System.EventHandler(this.TerrainTypeSelectorClicked); - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(745, 596); - this.Controls.Add(this.toolStripContainer1); - this.Name = "Form1"; - this.Text = "Tileset Builder"; - this.toolStripContainer1.ContentPanel.ResumeLayout(false); - this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false); - this.toolStripContainer1.TopToolStripPanel.PerformLayout(); - this.toolStripContainer1.ResumeLayout(false); - this.toolStripContainer1.PerformLayout(); - this.panel1.ResumeLayout(false); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ToolStripContainer toolStripContainer1; - private System.Windows.Forms.Panel panel1; - private Surface surface1; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.ToolStripButton toolStripButton1; - private System.Windows.Forms.ToolStripButton toolStripButton2; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripButton toolStripButton3; - private System.Windows.Forms.ToolStripButton toolStripButton4; - private System.Windows.Forms.ToolStripButton toolStripButton12; - private System.Windows.Forms.ToolStripButton toolStripButton11; - private System.Windows.Forms.ToolStripButton toolStripButton10; - private System.Windows.Forms.ToolStripButton toolStripButton9; - private System.Windows.Forms.ToolStripButton toolStripButton8; - private System.Windows.Forms.ToolStripButton toolStripButton7; - private System.Windows.Forms.ToolStripButton toolStripButton6; - private System.Windows.Forms.ToolStripButton toolStripButton5; - private System.Windows.Forms.ToolStripButton toolStripButton13; - private System.Windows.Forms.ToolStripButton toolStripButton14; - - } -} - diff --git a/OpenRA.TilesetBuilder/Form1.cs b/OpenRA.TilesetBuilder/Form1.cs deleted file mode 100644 index 1c1c084360..0000000000 --- a/OpenRA.TilesetBuilder/Form1.cs +++ /dev/null @@ -1,278 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; -using System.Linq; -using System.Windows.Forms; -using System.Xml; -using OpenRA.FileFormats; - -namespace OpenRA.TilesetBuilder -{ - public partial class Form1 : Form - { - string srcfile; - int size; - - public Form1( string src, int size ) - { - srcfile = src; - this.size = size; - InitializeComponent(); - surface1.TileSize = size; - surface1.Image = (Bitmap)Image.FromFile(src); - surface1.Image.SetResolution(96, 96); // people keep being noobs about DPI, and GDI+ cares. - surface1.TerrainTypes = new int[surface1.Image.Width / size, surface1.Image.Height / size]; /* all passable by default */ - surface1.Templates = new List