diff --git a/Makefile b/Makefile index d2d486dda2..fd9facd1ac 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PHONY = core tools package all mods clean distclean .SUFFIXES: core: game renderers mod_ra mod_cnc utility -tools: editor ralint seqed tsbuild +tools: editor ralint tsbuild package: core editor mods: mod_ra mod_cnc all: core tools @@ -100,18 +100,6 @@ mod_cnc: $(mod_cnc_TARGET) # # Tools # -# Sequence editor (defunct) -seqed_SRCS := $(shell find SequenceEditor/ -iname '*.cs') -seqed_TARGET = SequenceEditor.exe -seqed_KIND = winexe -seqed_DEPS = $(fileformats_TARGET) -seqed_LIBS = $(COMMON_LIBS) System.Windows.Forms.dll $(seqed_DEPS) -seqed_EXTRA = -resource:SequenceEditor.Form1.resources -PROGRAMS += seqed -SequenceEditor.Form1.resources: - resgen2 SequenceEditor/Form1.resx SequenceEditor.Form1.resources 1> /dev/null -seqed: SequenceEditor.Form1.resources $(seqed_TARGET) - # Map Editor editor_SRCS := $(shell find OpenRA.Editor/ -iname '*.cs') editor_TARGET = OpenRA.Editor.exe diff --git a/OpenRA.sln b/OpenRA.sln index 1c6684f816..35ee4f455b 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -5,8 +5,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.FileFormats", "OpenR EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Game", "OpenRA.Game\OpenRA.Game.csproj", "{0DFB103F-2962-400F-8C6D-E2C28CCBA633}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SequenceEditor", "SequenceEditor\SequenceEditor.csproj", "{230F65CE-A6DE-4235-8B38-13A3D606C7F7}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.RA", "OpenRA.Mods.RA\OpenRA.Mods.RA.csproj", "{4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}" ProjectSection(ProjectDependencies) = postProject {F9FA4D9F-2302-470A-8A07-6E37F488C124} = {F9FA4D9F-2302-470A-8A07-6E37F488C124} diff --git a/SequenceEditor/Form1.Designer.cs b/SequenceEditor/Form1.Designer.cs deleted file mode 100644 index 6be8662da0..0000000000 --- a/SequenceEditor/Form1.Designer.cs +++ /dev/null @@ -1,154 +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 SequenceEditor -{ - 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.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.panel1 = new System.Windows.Forms.Panel(); - this.surface1 = new SequenceEditor.Surface(); - this.toolStripContainer1.ContentPanel.SuspendLayout(); - this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); - this.toolStripContainer1.SuspendLayout(); - this.toolStrip1.SuspendLayout(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // toolStripContainer1 - // - // - // toolStripContainer1.ContentPanel - // - this.toolStripContainer1.ContentPanel.Controls.Add(this.panel1); - this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(708, 518); - 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(708, 543); - this.toolStripContainer1.TabIndex = 0; - this.toolStripContainer1.Text = "toolStripContainer1"; - // - // toolStripContainer1.TopToolStripPanel - // - this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1); - // - // toolStrip1 - // - this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None; - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripButton1, - this.toolStripButton2}); - this.toolStrip1.Location = new System.Drawing.Point(3, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(160, 25); - this.toolStrip1.TabIndex = 0; - // - // toolStripButton1 - // - 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(113, 22); - this.toolStripButton1.Text = "Add Another SHP..."; - this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); - // - // toolStripButton2 - // - this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - 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(35, 22); - this.toolStripButton2.Text = "Save"; - this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click); - // - // 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(708, 518); - this.panel1.TabIndex = 0; - // - // surface1 - // - this.surface1.Dock = System.Windows.Forms.DockStyle.Top; - this.surface1.Location = new System.Drawing.Point(0, 0); - this.surface1.Name = "surface1"; - this.surface1.Size = new System.Drawing.Size(708, 518); - this.surface1.TabIndex = 0; - this.surface1.Text = "surface1"; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(708, 543); - this.Controls.Add(this.toolStripContainer1); - this.Name = "Form1"; - this.Text = "OpenRA Sequence Viewer"; - this.toolStripContainer1.ContentPanel.ResumeLayout(false); - this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false); - this.toolStripContainer1.TopToolStripPanel.PerformLayout(); - this.toolStripContainer1.ResumeLayout(false); - this.toolStripContainer1.PerformLayout(); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ToolStripContainer toolStripContainer1; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.ToolStripButton toolStripButton1; - private System.Windows.Forms.ToolStripButton toolStripButton2; - private System.Windows.Forms.Panel panel1; - private Surface surface1; - - } -} - diff --git a/SequenceEditor/Form1.cs b/SequenceEditor/Form1.cs deleted file mode 100644 index 2f3794337c..0000000000 --- a/SequenceEditor/Form1.cs +++ /dev/null @@ -1,36 +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.Windows.Forms; - -namespace SequenceEditor -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - Text += " - " + Program.UnitName; - } - - void toolStripButton1_Click(object sender, EventArgs e) - { - var shp = GetTextForm.GetString( "Add SHP...", "" ); - if (shp == null) return; - Program.LoadAndResolve(shp); - } - - void toolStripButton2_Click(object sender, EventArgs e) - { - Program.Save(); - } - } -} diff --git a/SequenceEditor/Form1.resx b/SequenceEditor/Form1.resx deleted file mode 100644 index 63ba374c02..0000000000 --- a/SequenceEditor/Form1.resx +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI - ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9 - HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN - rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K - TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx - oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8 - 7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI - xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX - LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd - KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIISURBVDhPpZP7S1NxGMbPPxKaXVUkMEq8IpKUCoY/hGgI - ymqkDYYXcCjDZOANURSjCNGFQUTsl4GXVMxKk62YU4fXQpaIlygHQxBRH8/zwvyaIAYe+HLgnPN8nue9 - HA3nvDTq63oW/jm13XOwvPTB3DYFY5MH+bXfcN8ygfTSMSSXfESicQDxBqdYHwH29g9w2tnZ3UcguIvN - rR3417exuBJE5N1n/wfwLgXEOc38Bc6xNRHb+/y4nm49G0Bnit2zf9H6bkliE/jKuYxrd6oVgDWfjB+K - TWeKMyrGEVfowITvD9re/9ABVQrAhh0HHK+ZselMMaN/mvwtDb+aVqkA7HYIwIj3ysfluPTorJnP6Ezx - oHsD1s5ZXEktUwCOioB5f1CEPR9+wTG6iuiserTo8dkwng7HT/R+XUPF8xlcTjErAOdMcW6NW8STiwG8 - 7vej8oUPN/PsEv3t8Ao0TZP3T1u8uJRkUgAuSYHtO97oLxmXd5t9Ho8aPTK+GzntqNfrLm2fFoihwYOI - xGIF4KjoGBLzY1OrF9k6OOFxnwDC4wxIMX1G0pMhgVyMNyoA13PAtS7OrJk1PrC69LUdQWxuF6IybHrX - LRI7JrtZdoDAo1XmbjMyD+tjSXxGcXRmnYg5ttD9QuxDhN0uUgDOmbvNTpPOJaGAo2K36cyaGZvOFIfd - KlSA8/zRh9ABIDUG+1JpAAAAAElFTkSuQmCC - - - \ No newline at end of file diff --git a/SequenceEditor/GetTextForm.Designer.cs b/SequenceEditor/GetTextForm.Designer.cs deleted file mode 100644 index 1ccb89b569..0000000000 --- a/SequenceEditor/GetTextForm.Designer.cs +++ /dev/null @@ -1,104 +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 SequenceEditor -{ - partial class GetTextForm - { - /// - /// 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() - { - this.textBox1 = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // textBox1 - // - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.Location = new System.Drawing.Point(13, 13); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(337, 20); - this.textBox1.TabIndex = 0; - // - // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; - this.button1.Location = new System.Drawing.Point(194, 50); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 1; - this.button1.Text = "OK"; - this.button1.UseVisualStyleBackColor = true; - // - // button2 - // - this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.button2.Location = new System.Drawing.Point(275, 50); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 2; - this.button2.Text = "Cancel"; - this.button2.UseVisualStyleBackColor = true; - // - // GetTextForm - // - this.AcceptButton = this.button1; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.button2; - this.ClientSize = new System.Drawing.Size(362, 85); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Controls.Add(this.textBox1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "GetTextForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Placeholder"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; - } -} \ No newline at end of file diff --git a/SequenceEditor/GetTextForm.cs b/SequenceEditor/GetTextForm.cs deleted file mode 100644 index e5ad3c7dad..0000000000 --- a/SequenceEditor/GetTextForm.cs +++ /dev/null @@ -1,34 +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.Windows.Forms; - -namespace SequenceEditor -{ - public partial class GetTextForm : Form - { - public GetTextForm() - { - InitializeComponent(); - } - - public static string GetString(string title, string defaultValue) - { - using (var f = new GetTextForm()) - { - f.textBox1.Text = defaultValue; - f.Text = title; - if (DialogResult.OK != f.ShowDialog()) - return null; - return f.textBox1.Text; - } - } - } -} diff --git a/SequenceEditor/GetTextForm.resx b/SequenceEditor/GetTextForm.resx deleted file mode 100644 index ff31a6db56..0000000000 --- a/SequenceEditor/GetTextForm.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/SequenceEditor/Program.cs b/SequenceEditor/Program.cs deleted file mode 100644 index cb633a68ef..0000000000 --- a/SequenceEditor/Program.cs +++ /dev/null @@ -1,137 +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.Linq; -using System.Windows.Forms; -using System.Xml; -using OpenRA.FileFormats; - -namespace SequenceEditor -{ - static class Program - { - static string XmlFilename; - public static string UnitName; - public static XmlDocument Doc; - public static Dictionary Shps = new Dictionary(); - public static Palette Pal; - public static Dictionary Sequences = new Dictionary(); - - public static void LoadAndResolve( string shp ) - { - try - { - if (Shps.ContainsKey(shp)) return; - - var reader = new ShpReader(FileSystem.OpenWithExts(shp, ".tem", ".sno", ".int", ".shp")); - Shps[shp] = reader.Select(ih => - { - var bmp = new Bitmap(reader.Width, reader.Height); - for (var j = 0; j < bmp.Height; j++) - for (var i = 0; i < bmp.Width; i++) - bmp.SetPixel(i, j, Pal.GetColor(ih.Image[j * bmp.Width + i])); - return bmp; - }).ToArray(); - } - catch { } - } - - public static void Save() - { - var e = Doc.SelectSingleNode(string.Format("//unit[@name=\"{0}\"]", UnitName)) as XmlElement; - if (e == null) - { - e = Doc.CreateElement("unit"); - e.SetAttribute( "name", UnitName ); - e = Doc.SelectSingleNode("sequences").AppendChild(e) as XmlElement; - } - - while (e.HasChildNodes) e.RemoveChild(e.FirstChild); /* what a fail */ - - foreach (var s in Sequences) - { - var seqnode = Doc.CreateElement("sequence"); - seqnode.SetAttribute("name", s.Key); - seqnode.SetAttribute("start", s.Value.start.ToString()); - seqnode.SetAttribute("length", s.Value.length.ToString()); - if (s.Value.shp != UnitName) - seqnode.SetAttribute("src", s.Value.shp); - - e.AppendChild(seqnode); - } - - Doc.Save(XmlFilename); - } - - [STAThread] - static void Main( string[] args ) - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - - if (args.Length != 3) - { - MessageBox.Show( "usage: SequenceEditor mod[,mod]* sequences-file.xml palette.pal"); - return; - } - - var mods = args[0].Split(','); - var manifest = new Manifest(mods); - FileSystem.LoadFromManifest( manifest ); - - XmlFilename = args[1]; - Doc = new XmlDocument(); - Doc.Load(XmlFilename); - - var tempPal = new Palette(FileSystem.Open(args[2]), true); - Pal = tempPal; - - UnitName = GetTextForm.GetString("Unit to edit?", "e1"); - if (string.IsNullOrEmpty(UnitName)) - return; - - LoadAndResolve(UnitName); - - var xpath = string.Format("//unit[@name=\"{0}\"]/sequence", UnitName); - foreach (XmlElement e in Doc.SelectNodes(xpath)) - { - if (e.HasAttribute("src")) - LoadAndResolve(e.GetAttribute("src")); - Sequences[e.GetAttribute("name")] = new Sequence(e); - } - - Application.Run(new Form1()); - } - } - - class Sequence - { - public int start; - public int length; - public string shp; - - public Sequence(XmlElement e) - { - start = int.Parse(e.GetAttribute("start")); - shp = e.GetAttribute("src"); - if (shp == "") shp = Program.UnitName; - var a = e.GetAttribute("length"); - - length = (a == "*") - ? Program.Shps[shp].Length - start - : ((a == "") ? 1 : int.Parse(a)); - } - - public Sequence() { } - } -} diff --git a/SequenceEditor/Properties/AssemblyInfo.cs b/SequenceEditor/Properties/AssemblyInfo.cs deleted file mode 100644 index 7b68706d29..0000000000 --- a/SequenceEditor/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,46 +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.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SequenceEditor")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SequenceEditor")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7e4566b7-a3cc-4d8f-ba9c-1a071883ba2c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SequenceEditor/Properties/Resources.Designer.cs b/SequenceEditor/Properties/Resources.Designer.cs deleted file mode 100644 index 00120bab05..0000000000 --- a/SequenceEditor/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SequenceEditor.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SequenceEditor.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/SequenceEditor/Properties/Resources.resx b/SequenceEditor/Properties/Resources.resx deleted file mode 100644 index ffecec851a..0000000000 --- a/SequenceEditor/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/SequenceEditor/Properties/Settings.Designer.cs b/SequenceEditor/Properties/Settings.Designer.cs deleted file mode 100644 index 9ed2fa263b..0000000000 --- a/SequenceEditor/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SequenceEditor.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/SequenceEditor/Properties/Settings.settings b/SequenceEditor/Properties/Settings.settings deleted file mode 100644 index abf36c5d3d..0000000000 --- a/SequenceEditor/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/SequenceEditor/SequenceEditor.csproj b/SequenceEditor/SequenceEditor.csproj deleted file mode 100644 index 109699e29b..0000000000 --- a/SequenceEditor/SequenceEditor.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {230F65CE-A6DE-4235-8B38-13A3D606C7F7} - WinExe - Properties - SequenceEditor - SequenceEditor - v3.5 - 512 - - - true - ..\ - DEBUG;TRACE - full - AnyCPU - false - prompt - 4 - false - - - bin\Release\ - TRACE - true - pdbonly - AnyCPU - prompt - 4 - false - - - AnyCPU - ..\ - none - 4 - false - - - true - bin\Release\ - none - 4 - false - - - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - Form - - - Form1.cs - - - Form - - - GetTextForm.cs - - - - - Form1.cs - - - GetTextForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - Component - - - - - {BDAEAB25-991E-46A7-AF1E-4F0E03358DAA} - OpenRA.FileFormats - - - - - \ No newline at end of file diff --git a/SequenceEditor/Surface.cs b/SequenceEditor/Surface.cs deleted file mode 100644 index 80bf9af6a7..0000000000 --- a/SequenceEditor/Surface.cs +++ /dev/null @@ -1,230 +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.Linq; -using System.Windows.Forms; -using OpenRA.FileFormats; - -namespace SequenceEditor -{ - public class Surface : Control - { - public Surface() - { - SetStyle(ControlStyles.OptimizedDoubleBuffer, true); - SetStyle(ControlStyles.ResizeRedraw, true); - UpdateStyles(); - } - - Dictionary> items - = new Dictionary>(); - - Point mousePos; - Point clickPos; - bool isDragging; - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - mousePos = e.Location; - - if (e.Button == MouseButtons.Left) - isDragging = true; - - Invalidate(); - } - - Pair? FindFrameAt(Point p) - { - if (items.Count > 0) - { - foreach (var shp in items) - { - var sel = shp.Value.FirstOrDefault(a => a.Value.Contains(p)); - if (!sel.Value.IsEmpty) - return Pair.New(shp.Key, sel.Key); - } - } - - return null; - } - - string lastName = ""; - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - - if (isDragging && e.Button == MouseButtons.Left) - { - isDragging = false; - - /* create a new sequence! */ - var start = FindFrameAt(clickPos); - var end = FindFrameAt(mousePos); - - if (start != null && end != null - && start.Value.First == end.Value.First) - { - var s = new Sequence() - { - start = start.Value.Second, - length = end.Value.Second - start.Value.Second + 1, - shp = start.Value.First - }; - - var name = GetTextForm.GetString("Name of new sequence", lastName); - if (name == null) return; - - Program.Sequences.Add(name, s); - lastName = name; - } - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - - if (e.Button == MouseButtons.Left) - clickPos = e.Location; - - if (e.Button == MouseButtons.Right) - { - var frameAtPoint = FindFrameAt(e.Location); - if (frameAtPoint == null) return; - var seq = Program.Sequences - .Where(kv => kv.Value.shp == frameAtPoint.Value.First && - frameAtPoint.Value.Second.IsInRange( kv.Value.start, kv.Value.length )).ToArray(); - - foreach (var s in seq) - Program.Sequences.Remove(s.Key); - - Invalidate(); - } - } - - Sequence tempSequence; - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - var x = 0; - var y = 0; - - Point? toolPoint = null; - string toolText = ""; - - var frameAtPoint = FindFrameAt(mousePos); - if (frameAtPoint != null) - { - var rect = items[frameAtPoint.Value.First][frameAtPoint.Value.Second]; - e.Graphics.FillRectangle(Brushes.Silver, rect); - toolPoint = new Point(rect.Left, rect.Bottom); - toolText = frameAtPoint.Value.Second.ToString(); - } - - tempSequence = null; - if (isDragging) - { - /* create a new sequence! */ - var start = FindFrameAt(clickPos); - var end = FindFrameAt(mousePos); - - if (start != null && end != null - && start.Value.First == end.Value.First) - tempSequence = new Sequence() { - start = start.Value.Second, - length = end.Value.Second - start.Value.Second + 1, - shp = start.Value.First }; - } - - items.Clear(); - - foreach (var shp in Program.Shps) - { - x = 0; - e.Graphics.DrawString(shp.Key + ".shp", Font, Brushes.Black, x, y); - y += Font.Height; - var u = 0; - var i = 0; - - var dict = items[shp.Key] = new Dictionary(); - - foreach (var frame in shp.Value) - { - if (x + frame.Width >= ClientSize.Width) - { - x = 0; - y += u; - u = 0; - } - - dict[i++] = new Rectangle(x, y, frame.Width, frame.Height); - - e.Graphics.DrawImage(frame, x, y); - x += frame.Width; - u = Math.Max(u, frame.Height); - } - - y += u; - x = 0; - } - - var brushes = new[] { Brushes.Green, Brushes.Red, Brushes.Blue, Brushes.Magenta, Brushes.DarkOrange, Brushes.Navy }; - - var seqid = 0; - var seqs = Program.Sequences.Select(a => a); /* shorter than teh typename!! */ - if (tempSequence != null) - seqs = seqs.Concat(new[] { new KeyValuePair("New sequence...", tempSequence) }); - - foreach (var seq in seqs) - { - var firstFrame = seq.Value.start; - var r = items[seq.Value.shp][firstFrame]; - - for (var i = 0; i < seq.Value.length; i++) - { - var q = items[seq.Value.shp][i + firstFrame]; - e.Graphics.FillRectangle(brushes[seqid], q.Left, q.Top, q.Width, 2); - } - - var z = e.Graphics.MeasureString(seq.Key, Font); - e.Graphics.FillRectangle(brushes[seqid], r.Left, r.Top, z.Width, z.Height); - e.Graphics.DrawString(seq.Key, Font, Brushes.White, r.Left, r.Top); - - seqid = ++seqid % brushes.Length; - } - - if (toolPoint.HasValue) - { - var size = e.Graphics.MeasureString(toolText, Font); - e.Graphics.FillRectangle(Brushes.Silver, toolPoint.Value.X, toolPoint.Value.Y, size.Width, size.Height); - e.Graphics.DrawString(toolText, Font, Brushes.Black, toolPoint.Value.X, toolPoint.Value.Y); - } - - var newHeight = Math.Max( Parent.ClientSize.Height, y ); - if (Height != newHeight) - Height = newHeight; - } - } - - static class Exts - { - public static bool IsInRange(this int x, int start, int len) - { - return x >= start && x < start + len; - } - } -}