StyleCop clean TilesetBuilder
adapt Makefile after TilesetBuilder file renamings remove dead TilesetBuilder code
This commit is contained in:
12
Makefile
12
Makefile
@@ -194,15 +194,15 @@ 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.frmBuilder.resources -resource:OpenRA.TilesetBuilder.frmNew.resources -resource:OpenRA.TilesetBuilder.Surface.resources
|
||||
tsbuild_EXTRA = -resource:OpenRA.TilesetBuilder.FormBuilder.resources -resource:OpenRA.TilesetBuilder.FormNew.resources -resource:OpenRA.TilesetBuilder.Surface.resources
|
||||
PROGRAMS += tsbuild
|
||||
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.FormBuilder.resources:
|
||||
resgen2 OpenRA.TilesetBuilder/FormBuilder.resx OpenRA.TilesetBuilder.FormBuilder.resources 1> /dev/null
|
||||
OpenRA.TilesetBuilder.FormNew.resources:
|
||||
resgen2 OpenRA.TilesetBuilder/frmNew.resx OpenRA.TilesetBuilder.FormNew.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)
|
||||
tsbuild: OpenRA.TilesetBuilder.FormBuilder.resources OpenRA.TilesetBuilder.FormNew.resources OpenRA.TilesetBuilder.Surface.resources $(tsbuild_TARGET)
|
||||
|
||||
|
||||
##### Launchers / Utilities #####
|
||||
|
||||
@@ -1,368 +1,367 @@
|
||||
namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
partial class frmBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmBuilder));
|
||||
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.imageList = new System.Windows.Forms.ImageList(this.components);
|
||||
this.tsTerrainTypes = new System.Windows.Forms.ToolStrip();
|
||||
this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripLabel4 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.txtTilesetName = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.toolStripLabel5 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.txtID = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.lblExt = new System.Windows.Forms.ToolStripLabel();
|
||||
this.txtExt = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.toolStripLabel6 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.txtPal = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||
this.toolStripButton15 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButton14 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButton16 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
|
||||
this.surface1 = new OpenRA.TilesetBuilder.Surface();
|
||||
this.toolStripContainer1.ContentPanel.SuspendLayout();
|
||||
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
|
||||
this.toolStripContainer1.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.tsTerrainTypes.SuspendLayout();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
partial class FormBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormBuilder));
|
||||
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.ImageList = new System.Windows.Forms.ImageList(this.components);
|
||||
this.terrainTypes = new System.Windows.Forms.ToolStrip();
|
||||
this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripLabel4 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.txtTilesetName = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.toolStripLabel5 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.txtID = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.lblExt = new System.Windows.Forms.ToolStripLabel();
|
||||
this.txtExt = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.toolStripLabel6 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.txtPal = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||
this.toolStripButton15 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButton14 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButton16 = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
|
||||
this.surface1 = new OpenRA.TilesetBuilder.Surface();
|
||||
this.toolStripContainer1.ContentPanel.SuspendLayout();
|
||||
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
|
||||
this.toolStripContainer1.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.terrainTypes.SuspendLayout();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// toolStripContainer1
|
||||
//
|
||||
//
|
||||
// toolStripContainer1.ContentPanel
|
||||
//
|
||||
this.toolStripContainer1.ContentPanel.Controls.Add(this.panel1);
|
||||
this.toolStripContainer1.ContentPanel.Controls.Add(this.terrainTypes);
|
||||
this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(908, 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(908, 596);
|
||||
this.toolStripContainer1.TabIndex = 0;
|
||||
this.toolStripContainer1.Text = "toolStripContainer1";
|
||||
//
|
||||
// toolStripContainer1.TopToolStripPanel
|
||||
//
|
||||
this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1);
|
||||
this.toolStripContainer1.TopToolStripPanel.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
|
||||
//
|
||||
// toolStripContainer1
|
||||
//
|
||||
//
|
||||
// toolStripContainer1.ContentPanel
|
||||
//
|
||||
this.toolStripContainer1.ContentPanel.Controls.Add(this.panel1);
|
||||
this.toolStripContainer1.ContentPanel.Controls.Add(this.tsTerrainTypes);
|
||||
this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(908, 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(908, 596);
|
||||
this.toolStripContainer1.TabIndex = 0;
|
||||
this.toolStripContainer1.Text = "toolStripContainer1";
|
||||
//
|
||||
// toolStripContainer1.TopToolStripPanel
|
||||
//
|
||||
this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1);
|
||||
this.toolStripContainer1.TopToolStripPanel.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
|
||||
this.toolStripContainer1.TopToolStripPanel.Click += new System.EventHandler(this.toolStripContainer1_TopToolStripPanel_Click);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.AutoScroll = true;
|
||||
this.panel1.BackColor = System.Drawing.Color.Black;
|
||||
// panel1
|
||||
//
|
||||
this.panel1.AutoScroll = true;
|
||||
this.panel1.BackColor = System.Drawing.Color.Black;
|
||||
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(788, 571);
|
||||
this.panel1.TabIndex = 3;
|
||||
//
|
||||
// imageList
|
||||
//
|
||||
this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
|
||||
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
|
||||
this.imageList.Images.SetKeyName(0, "clear.png");
|
||||
this.imageList.Images.SetKeyName(1, "water.png");
|
||||
this.imageList.Images.SetKeyName(2, "road.png");
|
||||
this.imageList.Images.SetKeyName(3, "rock.png");
|
||||
this.imageList.Images.SetKeyName(4, "river.png");
|
||||
this.imageList.Images.SetKeyName(5, "rough.png");
|
||||
this.imageList.Images.SetKeyName(6, "wall.png");
|
||||
this.imageList.Images.SetKeyName(7, "beach.png");
|
||||
this.imageList.Images.SetKeyName(8, "tree.png");
|
||||
this.imageList.Images.SetKeyName(9, "tiberium.png");
|
||||
//
|
||||
// tsTerrainTypes
|
||||
//
|
||||
this.tsTerrainTypes.AutoSize = false;
|
||||
this.tsTerrainTypes.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.tsTerrainTypes.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripLabel3,
|
||||
this.toolStripSeparator3,
|
||||
this.toolStripLabel4,
|
||||
this.txtTilesetName,
|
||||
this.toolStripLabel5,
|
||||
this.txtID,
|
||||
this.lblExt,
|
||||
this.txtExt,
|
||||
this.toolStripLabel6,
|
||||
this.txtPal,
|
||||
this.toolStripSeparator5,
|
||||
this.toolStripLabel2,
|
||||
this.toolStripSeparator4,
|
||||
this.toolStripButton1});
|
||||
this.tsTerrainTypes.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.VerticalStackWithOverflow;
|
||||
this.tsTerrainTypes.Location = new System.Drawing.Point(788, 0);
|
||||
this.tsTerrainTypes.Name = "tsTerrainTypes";
|
||||
this.tsTerrainTypes.Size = new System.Drawing.Size(120, 571);
|
||||
this.tsTerrainTypes.TabIndex = 1;
|
||||
this.tsTerrainTypes.Text = "toolStrip3";
|
||||
//
|
||||
// toolStripLabel3
|
||||
//
|
||||
this.toolStripLabel3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
|
||||
this.toolStripLabel3.Name = "toolStripLabel3";
|
||||
this.toolStripLabel3.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel3.Text = "Tileset setup";
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(118, 6);
|
||||
//
|
||||
// toolStripLabel4
|
||||
//
|
||||
this.toolStripLabel4.Name = "toolStripLabel4";
|
||||
this.toolStripLabel4.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel4.Text = "Tileset name:";
|
||||
//
|
||||
// txtTilesetName
|
||||
//
|
||||
this.txtTilesetName.MaxLength = 32;
|
||||
this.txtTilesetName.Name = "txtTilesetName";
|
||||
this.txtTilesetName.Size = new System.Drawing.Size(116, 21);
|
||||
this.txtTilesetName.Text = "Temperat";
|
||||
this.txtTilesetName.TextChanged += new System.EventHandler(this.txtTilesetName_TextChanged);
|
||||
//
|
||||
// toolStripLabel5
|
||||
//
|
||||
this.toolStripLabel5.Name = "toolStripLabel5";
|
||||
this.toolStripLabel5.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel5.Text = "Tileset ID:";
|
||||
//
|
||||
// txtID
|
||||
//
|
||||
this.txtID.Name = "txtID";
|
||||
this.txtID.ReadOnly = true;
|
||||
this.txtID.Size = new System.Drawing.Size(116, 21);
|
||||
this.txtID.Text = "TEMPERAT";
|
||||
//
|
||||
// lblExt
|
||||
//
|
||||
this.lblExt.Name = "lblExt";
|
||||
this.lblExt.Size = new System.Drawing.Size(118, 13);
|
||||
this.lblExt.Text = "Extensions:";
|
||||
//
|
||||
// txtExt
|
||||
//
|
||||
this.txtExt.Name = "txtExt";
|
||||
this.txtExt.ReadOnly = true;
|
||||
this.txtExt.Size = new System.Drawing.Size(116, 21);
|
||||
this.txtExt.Text = ".tem,.shp";
|
||||
//
|
||||
// toolStripLabel6
|
||||
//
|
||||
this.toolStripLabel6.Name = "toolStripLabel6";
|
||||
this.toolStripLabel6.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel6.Text = "Palette:";
|
||||
//
|
||||
// txtPal
|
||||
//
|
||||
this.txtPal.Name = "txtPal";
|
||||
this.txtPal.ReadOnly = true;
|
||||
this.txtPal.Size = new System.Drawing.Size(116, 21);
|
||||
this.txtPal.Text = "temperat.pal";
|
||||
//
|
||||
// toolStripSeparator5
|
||||
//
|
||||
this.toolStripSeparator5.Name = "toolStripSeparator5";
|
||||
this.toolStripSeparator5.Size = new System.Drawing.Size(118, 6);
|
||||
//
|
||||
// toolStripLabel2
|
||||
//
|
||||
this.toolStripLabel2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
|
||||
this.toolStripLabel2.Name = "toolStripLabel2";
|
||||
this.toolStripLabel2.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel2.Text = "Terrain type";
|
||||
//
|
||||
// toolStripSeparator4
|
||||
//
|
||||
this.toolStripSeparator4.Name = "toolStripSeparator4";
|
||||
this.toolStripSeparator4.Size = new System.Drawing.Size(118, 6);
|
||||
//
|
||||
// toolStripButton1
|
||||
//
|
||||
this.toolStripButton1.Checked = true;
|
||||
this.toolStripButton1.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
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(118, 20);
|
||||
this.toolStripButton1.Text = "Template Tool";
|
||||
this.toolStripButton1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.toolStripButton1.Click += new System.EventHandler(this.TerrainTypeSelectorClicked);
|
||||
//
|
||||
// toolStrip1
|
||||
//
|
||||
this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
|
||||
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripButton15,
|
||||
this.toolStripButton2,
|
||||
this.toolStripButton14,
|
||||
this.toolStripButton16,
|
||||
this.toolStripSeparator1,
|
||||
this.toolStripButton3});
|
||||
this.toolStrip1.Location = new System.Drawing.Point(3, 0);
|
||||
this.toolStrip1.Name = "toolStrip1";
|
||||
this.toolStrip1.Size = new System.Drawing.Size(275, 25);
|
||||
this.toolStrip1.TabIndex = 0;
|
||||
//
|
||||
// toolStripButton15
|
||||
//
|
||||
this.toolStripButton15.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton15.Image")));
|
||||
this.toolStripButton15.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton15.Name = "toolStripButton15";
|
||||
this.toolStripButton15.Size = new System.Drawing.Size(48, 22);
|
||||
this.toolStripButton15.Text = "New";
|
||||
this.toolStripButton15.ToolTipText = "Create new tileset";
|
||||
this.toolStripButton15.Click += new System.EventHandler(this.toolStripButton15_Click);
|
||||
//
|
||||
// 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.ToolTipText = "Save Template definitions to file (*.tsx)";
|
||||
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(59, 22);
|
||||
this.toolStripButton14.Text = "Export";
|
||||
this.toolStripButton14.ToolTipText = "Export defined Templates to files";
|
||||
this.toolStripButton14.Click += new System.EventHandler(this.ExportClicked);
|
||||
//
|
||||
// toolStripButton16
|
||||
//
|
||||
this.toolStripButton16.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton14.Image")));
|
||||
this.toolStripButton16.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton16.Name = "toolStripButton16";
|
||||
this.toolStripButton16.Size = new System.Drawing.Size(65, 22);
|
||||
this.toolStripButton16.Text = "Dump";
|
||||
this.toolStripButton16.ToolTipText = "Dump Template ID to tile number mapping to console";
|
||||
this.toolStripButton16.Click += new System.EventHandler(this.Export2Clicked);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// 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(70, 22);
|
||||
this.toolStripButton3.Text = "Overlays";
|
||||
this.toolStripButton3.ToolTipText = "Show/hide terrain type overlays";
|
||||
this.toolStripButton3.CheckOnClick = true;
|
||||
this.toolStripButton3.Click += new System.EventHandler(this.ShowOverlaysClicked);
|
||||
//
|
||||
// surface1
|
||||
//
|
||||
this.surface1.BackColor = System.Drawing.Color.Black;
|
||||
this.surface1.ImagesList = this.imageList;
|
||||
this.surface1.Location = new System.Drawing.Point(0, 0);
|
||||
this.surface1.Name = "surface1";
|
||||
this.surface1.ShowTerrainTypes = this.toolStripButton3.Checked;
|
||||
this.surface1.Size = new System.Drawing.Size(653, 454);
|
||||
this.surface1.TabIndex = 2;
|
||||
this.surface1.Text = "surface1";
|
||||
//
|
||||
// frmBuilder
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(908, 596);
|
||||
this.Controls.Add(this.toolStripContainer1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "frmBuilder";
|
||||
this.Text = "Tileset Builder 2";
|
||||
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.tsTerrainTypes.ResumeLayout(false);
|
||||
this.tsTerrainTypes.PerformLayout();
|
||||
this.toolStrip1.ResumeLayout(false);
|
||||
this.toolStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ToolStripContainer toolStripContainer1;
|
||||
private System.Windows.Forms.ToolStrip toolStrip1;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton2;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton3;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton14;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton15;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton16;
|
||||
public System.Windows.Forms.ImageList imageList;
|
||||
private System.Windows.Forms.ToolStrip tsTerrainTypes;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private Surface surface1;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel2;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton1;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel3;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel4;
|
||||
private System.Windows.Forms.ToolStripTextBox txtTilesetName;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel5;
|
||||
private System.Windows.Forms.ToolStripTextBox txtID;
|
||||
private System.Windows.Forms.ToolStripLabel lblExt;
|
||||
private System.Windows.Forms.ToolStripTextBox txtExt;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel6;
|
||||
private System.Windows.Forms.ToolStripTextBox txtPal;
|
||||
}
|
||||
}
|
||||
|
||||
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(788, 571);
|
||||
this.panel1.TabIndex = 3;
|
||||
//
|
||||
// imageList
|
||||
//
|
||||
this.ImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
|
||||
this.ImageList.TransparentColor = System.Drawing.Color.Transparent;
|
||||
this.ImageList.Images.SetKeyName(0, "clear.png");
|
||||
this.ImageList.Images.SetKeyName(1, "water.png");
|
||||
this.ImageList.Images.SetKeyName(2, "road.png");
|
||||
this.ImageList.Images.SetKeyName(3, "rock.png");
|
||||
this.ImageList.Images.SetKeyName(4, "river.png");
|
||||
this.ImageList.Images.SetKeyName(5, "rough.png");
|
||||
this.ImageList.Images.SetKeyName(6, "wall.png");
|
||||
this.ImageList.Images.SetKeyName(7, "beach.png");
|
||||
this.ImageList.Images.SetKeyName(8, "tree.png");
|
||||
this.ImageList.Images.SetKeyName(9, "tiberium.png");
|
||||
//
|
||||
// tsTerrainTypes
|
||||
//
|
||||
this.terrainTypes.AutoSize = false;
|
||||
this.terrainTypes.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.terrainTypes.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripLabel3,
|
||||
this.toolStripSeparator3,
|
||||
this.toolStripLabel4,
|
||||
this.txtTilesetName,
|
||||
this.toolStripLabel5,
|
||||
this.txtID,
|
||||
this.lblExt,
|
||||
this.txtExt,
|
||||
this.toolStripLabel6,
|
||||
this.txtPal,
|
||||
this.toolStripSeparator5,
|
||||
this.toolStripLabel2,
|
||||
this.toolStripSeparator4,
|
||||
this.toolStripButton1});
|
||||
this.terrainTypes.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.VerticalStackWithOverflow;
|
||||
this.terrainTypes.Location = new System.Drawing.Point(788, 0);
|
||||
this.terrainTypes.Name = "tsTerrainTypes";
|
||||
this.terrainTypes.Size = new System.Drawing.Size(120, 571);
|
||||
this.terrainTypes.TabIndex = 1;
|
||||
this.terrainTypes.Text = "toolStrip3";
|
||||
//
|
||||
// toolStripLabel3
|
||||
//
|
||||
this.toolStripLabel3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
|
||||
this.toolStripLabel3.Name = "toolStripLabel3";
|
||||
this.toolStripLabel3.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel3.Text = "Tileset setup";
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(118, 6);
|
||||
//
|
||||
// toolStripLabel4
|
||||
//
|
||||
this.toolStripLabel4.Name = "toolStripLabel4";
|
||||
this.toolStripLabel4.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel4.Text = "Tileset name:";
|
||||
//
|
||||
// txtTilesetName
|
||||
//
|
||||
this.txtTilesetName.MaxLength = 32;
|
||||
this.txtTilesetName.Name = "txtTilesetName";
|
||||
this.txtTilesetName.Size = new System.Drawing.Size(116, 21);
|
||||
this.txtTilesetName.Text = "Temperat";
|
||||
this.txtTilesetName.TextChanged += new System.EventHandler(this.TilesetNameChanged);
|
||||
//
|
||||
// toolStripLabel5
|
||||
//
|
||||
this.toolStripLabel5.Name = "toolStripLabel5";
|
||||
this.toolStripLabel5.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel5.Text = "Tileset ID:";
|
||||
//
|
||||
// txtID
|
||||
//
|
||||
this.txtID.Name = "txtID";
|
||||
this.txtID.ReadOnly = true;
|
||||
this.txtID.Size = new System.Drawing.Size(116, 21);
|
||||
this.txtID.Text = "TEMPERAT";
|
||||
//
|
||||
// lblExt
|
||||
//
|
||||
this.lblExt.Name = "lblExt";
|
||||
this.lblExt.Size = new System.Drawing.Size(118, 13);
|
||||
this.lblExt.Text = "Extensions:";
|
||||
//
|
||||
// txtExt
|
||||
//
|
||||
this.txtExt.Name = "txtExt";
|
||||
this.txtExt.ReadOnly = true;
|
||||
this.txtExt.Size = new System.Drawing.Size(116, 21);
|
||||
this.txtExt.Text = ".tem,.shp";
|
||||
//
|
||||
// toolStripLabel6
|
||||
//
|
||||
this.toolStripLabel6.Name = "toolStripLabel6";
|
||||
this.toolStripLabel6.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel6.Text = "Palette:";
|
||||
//
|
||||
// txtPal
|
||||
//
|
||||
this.txtPal.Name = "txtPal";
|
||||
this.txtPal.ReadOnly = true;
|
||||
this.txtPal.Size = new System.Drawing.Size(116, 21);
|
||||
this.txtPal.Text = "temperat.pal";
|
||||
//
|
||||
// toolStripSeparator5
|
||||
//
|
||||
this.toolStripSeparator5.Name = "toolStripSeparator5";
|
||||
this.toolStripSeparator5.Size = new System.Drawing.Size(118, 6);
|
||||
//
|
||||
// toolStripLabel2
|
||||
//
|
||||
this.toolStripLabel2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
|
||||
this.toolStripLabel2.Name = "toolStripLabel2";
|
||||
this.toolStripLabel2.Size = new System.Drawing.Size(118, 13);
|
||||
this.toolStripLabel2.Text = "Terrain type";
|
||||
//
|
||||
// toolStripSeparator4
|
||||
//
|
||||
this.toolStripSeparator4.Name = "toolStripSeparator4";
|
||||
this.toolStripSeparator4.Size = new System.Drawing.Size(118, 6);
|
||||
//
|
||||
// toolStripButton1
|
||||
//
|
||||
this.toolStripButton1.Checked = true;
|
||||
this.toolStripButton1.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
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(118, 20);
|
||||
this.toolStripButton1.Text = "Template Tool";
|
||||
this.toolStripButton1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.toolStripButton1.Click += new System.EventHandler(this.TerrainTypeSelectorClicked);
|
||||
//
|
||||
// toolStrip1
|
||||
//
|
||||
this.toolStrip1.Dock = System.Windows.Forms.DockStyle.None;
|
||||
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripButton15,
|
||||
this.toolStripButton2,
|
||||
this.toolStripButton14,
|
||||
this.toolStripButton16,
|
||||
this.toolStripSeparator1,
|
||||
this.toolStripButton3});
|
||||
this.toolStrip1.Location = new System.Drawing.Point(3, 0);
|
||||
this.toolStrip1.Name = "toolStrip1";
|
||||
this.toolStrip1.Size = new System.Drawing.Size(275, 25);
|
||||
this.toolStrip1.TabIndex = 0;
|
||||
//
|
||||
// toolStripButton15
|
||||
//
|
||||
this.toolStripButton15.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton15.Image")));
|
||||
this.toolStripButton15.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton15.Name = "toolStripButton15";
|
||||
this.toolStripButton15.Size = new System.Drawing.Size(48, 22);
|
||||
this.toolStripButton15.Text = "New";
|
||||
this.toolStripButton15.ToolTipText = "Create new tileset";
|
||||
this.toolStripButton15.Click += new System.EventHandler(this.NewTilesetButton);
|
||||
//
|
||||
// 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.ToolTipText = "Save Template definitions to file (*.tsx)";
|
||||
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(59, 22);
|
||||
this.toolStripButton14.Text = "Export";
|
||||
this.toolStripButton14.ToolTipText = "Export defined Templates to files";
|
||||
this.toolStripButton14.Click += new System.EventHandler(this.ExportClicked);
|
||||
//
|
||||
// toolStripButton16
|
||||
//
|
||||
this.toolStripButton16.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton14.Image")));
|
||||
this.toolStripButton16.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton16.Name = "toolStripButton16";
|
||||
this.toolStripButton16.Size = new System.Drawing.Size(65, 22);
|
||||
this.toolStripButton16.Text = "Dump";
|
||||
this.toolStripButton16.ToolTipText = "Dump Template ID to tile number mapping to console";
|
||||
this.toolStripButton16.Click += new System.EventHandler(this.Export2Clicked);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// 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(70, 22);
|
||||
this.toolStripButton3.Text = "Overlays";
|
||||
this.toolStripButton3.ToolTipText = "Show/hide terrain type overlays";
|
||||
this.toolStripButton3.CheckOnClick = true;
|
||||
this.toolStripButton3.Click += new System.EventHandler(this.ShowOverlaysClicked);
|
||||
//
|
||||
// surface1
|
||||
//
|
||||
this.surface1.BackColor = System.Drawing.Color.Black;
|
||||
this.surface1.ImagesList = this.ImageList;
|
||||
this.surface1.Location = new System.Drawing.Point(0, 0);
|
||||
this.surface1.Name = "surface1";
|
||||
this.surface1.ShowTerrainTypes = this.toolStripButton3.Checked;
|
||||
this.surface1.Size = new System.Drawing.Size(653, 454);
|
||||
this.surface1.TabIndex = 2;
|
||||
this.surface1.Text = "surface1";
|
||||
//
|
||||
// frmBuilder
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(908, 596);
|
||||
this.Controls.Add(this.toolStripContainer1);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "frmBuilder";
|
||||
this.Text = "Tileset Builder 2";
|
||||
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.terrainTypes.ResumeLayout(false);
|
||||
this.terrainTypes.PerformLayout();
|
||||
this.toolStrip1.ResumeLayout(false);
|
||||
this.toolStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ToolStripContainer toolStripContainer1;
|
||||
private System.Windows.Forms.ToolStrip toolStrip1;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton2;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton3;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton14;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton15;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton16;
|
||||
public System.Windows.Forms.ImageList ImageList;
|
||||
private System.Windows.Forms.ToolStrip terrainTypes;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private Surface surface1;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel2;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton1;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel3;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel4;
|
||||
private System.Windows.Forms.ToolStripTextBox txtTilesetName;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel5;
|
||||
private System.Windows.Forms.ToolStripTextBox txtID;
|
||||
private System.Windows.Forms.ToolStripLabel lblExt;
|
||||
private System.Windows.Forms.ToolStripTextBox txtExt;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel6;
|
||||
private System.Windows.Forms.ToolStripTextBox txtPal;
|
||||
}
|
||||
}
|
||||
@@ -14,19 +14,19 @@ using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using System.Runtime.InteropServices;
|
||||
using OpenRA.FileFormats;
|
||||
|
||||
namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
public partial class frmBuilder : Form
|
||||
public partial class FormBuilder : Form
|
||||
{
|
||||
string srcfile;
|
||||
int size;
|
||||
public TerrainTypeInfo[] TerrainType;
|
||||
public Palette tpal;
|
||||
public Palette TerrainPalette;
|
||||
public bool PaletteFromImage = true;
|
||||
public string PaletteFile = "";
|
||||
public string ImageFile = "";
|
||||
@@ -40,13 +40,13 @@ namespace OpenRA.TilesetBuilder
|
||||
public void CreateNewTileset()
|
||||
{
|
||||
this.Show();
|
||||
using (var fNew = new frmNew { })
|
||||
if (DialogResult.OK == fNew.ShowDialog())
|
||||
using (var formNew = new FormNew { })
|
||||
if (DialogResult.OK == formNew.ShowDialog())
|
||||
{
|
||||
PaletteFromImage = fNew.PaletteFromImage;
|
||||
PaletteFile = fNew.PaletteFile;
|
||||
ImageFile = fNew.ImageFile;
|
||||
TileSize = fNew.TileSize;
|
||||
PaletteFromImage = formNew.PaletteFromImage;
|
||||
PaletteFile = formNew.PaletteFile;
|
||||
ImageFile = formNew.ImageFile;
|
||||
TileSize = formNew.TileSize;
|
||||
|
||||
srcfile = ImageFile;
|
||||
this.size = TileSize;
|
||||
@@ -56,12 +56,12 @@ namespace OpenRA.TilesetBuilder
|
||||
Bitmap rbitmap = fbitmap.Clone(new Rectangle(0, 0, fbitmap.Width, fbitmap.Height),
|
||||
fbitmap.PixelFormat);
|
||||
|
||||
int[] ShadowIndex = { };
|
||||
int[] shadowIndex = { };
|
||||
|
||||
if (!PaletteFromImage)
|
||||
{
|
||||
tpal = Palette.Load(PaletteFile, ShadowIndex);
|
||||
rbitmap.Palette = tpal.AsSystemPalette();
|
||||
TerrainPalette = Palette.Load(PaletteFile, shadowIndex);
|
||||
rbitmap.Palette = TerrainPalette.AsSystemPalette();
|
||||
}
|
||||
|
||||
surface1.Image = (Bitmap)rbitmap;
|
||||
@@ -75,18 +75,18 @@ namespace OpenRA.TilesetBuilder
|
||||
}
|
||||
}
|
||||
|
||||
public frmBuilder(string src, string tsize, bool AutoExport, string OutputDir)
|
||||
public FormBuilder(string src, string tsize, bool autoExport, string outputDir)
|
||||
{
|
||||
InitializeComponent();
|
||||
Dictionary<string, TerrainTypeInfo> DefTerrain = new Dictionary<string, TerrainTypeInfo>();
|
||||
Dictionary<string, TerrainTypeInfo> terrainDefinition = new Dictionary<string, TerrainTypeInfo>();
|
||||
|
||||
int size = int.Parse(tsize);
|
||||
|
||||
var yaml = MiniYaml.DictFromFile("OpenRA.TilesetBuilder/defaults.yaml");
|
||||
DefTerrain = yaml["Terrain"].NodesDict.Values.Select(y => new TerrainTypeInfo(y)).ToDictionary(t => t.Type);
|
||||
terrainDefinition = yaml["Terrain"].NodesDict.Values.Select(y => new TerrainTypeInfo(y)).ToDictionary(t => t.Type);
|
||||
int i = 0;
|
||||
surface1.icon = new Bitmap[DefTerrain.Keys.Count];
|
||||
TerrainType = new TerrainTypeInfo[DefTerrain.Keys.Count];
|
||||
surface1.Icon = new Bitmap[terrainDefinition.Keys.Count];
|
||||
TerrainType = new TerrainTypeInfo[terrainDefinition.Keys.Count];
|
||||
|
||||
var title = this.Text;
|
||||
surface1.UpdateMouseTilePosition += (x, y, tileNr) =>
|
||||
@@ -95,29 +95,30 @@ namespace OpenRA.TilesetBuilder
|
||||
};
|
||||
|
||||
surface1.Enabled = false;
|
||||
foreach (var deftype in DefTerrain)
|
||||
foreach (var deftype in terrainDefinition)
|
||||
{
|
||||
Bitmap icon = new Bitmap(16, 16);
|
||||
int x, y;
|
||||
var icon = new Bitmap(16, 16);
|
||||
|
||||
// Loop through the images pixels to reset color.
|
||||
for (x = 0; x < icon.Width; x++)
|
||||
for (var x = 0; x < icon.Width; x++)
|
||||
{
|
||||
for (y = 0; y < icon.Height; y++)
|
||||
for (var y = 0; y < icon.Height; y++)
|
||||
{
|
||||
Color newColor = deftype.Value.Color;
|
||||
icon.SetPixel(x, y, newColor);
|
||||
}
|
||||
}
|
||||
surface1.icon[i] = icon;
|
||||
|
||||
surface1.Icon[i] = icon;
|
||||
TerrainType[i] = deftype.Value;
|
||||
|
||||
ToolStripButton TerrainTypeButton = new ToolStripButton(deftype.Key, icon, TerrainTypeSelectorClicked);
|
||||
TerrainTypeButton.ToolTipText = deftype.Key;
|
||||
TerrainTypeButton.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
|
||||
TerrainTypeButton.Tag = i.ToString();
|
||||
TerrainTypeButton.ImageAlign = ContentAlignment.MiddleLeft;
|
||||
var terrainTypeButton = new ToolStripButton(deftype.Key, icon, TerrainTypeSelectorClicked);
|
||||
terrainTypeButton.ToolTipText = deftype.Key;
|
||||
terrainTypeButton.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
|
||||
terrainTypeButton.Tag = i.ToString();
|
||||
terrainTypeButton.ImageAlign = ContentAlignment.MiddleLeft;
|
||||
i++;
|
||||
tsTerrainTypes.Items.Add(TerrainTypeButton);
|
||||
terrainTypes.Items.Add(terrainTypeButton);
|
||||
}
|
||||
|
||||
if (src.Length > 0)
|
||||
@@ -139,9 +140,9 @@ namespace OpenRA.TilesetBuilder
|
||||
CreateNewTileset();
|
||||
}
|
||||
|
||||
if (AutoExport)
|
||||
if (autoExport)
|
||||
{
|
||||
Export(OutputDir);
|
||||
Export(outputDir);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
@@ -173,7 +174,7 @@ namespace OpenRA.TilesetBuilder
|
||||
|
||||
public void Save()
|
||||
{
|
||||
using (var w = XmlWriter.Create(Path.ChangeExtension(srcfile,"tsx"),
|
||||
using (var w = XmlWriter.Create(Path.ChangeExtension(srcfile, "tsx"),
|
||||
new XmlWriterSettings { Indent = true, IndentChars = " " }))
|
||||
{
|
||||
var tilesetName = txtTilesetName.Text;
|
||||
@@ -187,8 +188,8 @@ namespace OpenRA.TilesetBuilder
|
||||
w.WriteAttributeString("value", tilesetName);
|
||||
w.WriteEndElement();
|
||||
|
||||
for( var i = 0; i <= surface1.TerrainTypes.GetUpperBound(0); i++ )
|
||||
for( var j = 0; j <= surface1.TerrainTypes.GetUpperBound(1); j++ )
|
||||
for (var i = 0; i <= surface1.TerrainTypes.GetUpperBound(0); i++)
|
||||
for (var j = 0; j <= surface1.TerrainTypes.GetUpperBound(1); j++)
|
||||
if (surface1.TerrainTypes[i, j] != 0)
|
||||
{
|
||||
w.WriteStartElement("terrain");
|
||||
@@ -254,15 +255,15 @@ namespace OpenRA.TilesetBuilder
|
||||
|
||||
string ExportTemplate(Template t, int n, string suffix, string dir)
|
||||
{
|
||||
var TileSize = size;
|
||||
var tileSize = size;
|
||||
var filename = Path.Combine(dir, "{0}{1:00}{2}".F(txtTilesetName.Text, n, suffix));
|
||||
var totalTiles = t.Width * t.Height;
|
||||
|
||||
var ms = new MemoryStream();
|
||||
using (var bw = new BinaryWriter(ms))
|
||||
{
|
||||
bw.Write((ushort)TileSize);
|
||||
bw.Write((ushort)TileSize);
|
||||
bw.Write((ushort)tileSize);
|
||||
bw.Write((ushort)tileSize);
|
||||
bw.Write((uint)totalTiles);
|
||||
bw.Write((ushort)t.Width);
|
||||
bw.Write((ushort)t.Height);
|
||||
@@ -290,16 +291,15 @@ namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
if (t.Cells.ContainsKey(new int2(u + t.Left, v + t.Top)))
|
||||
{
|
||||
byte* q = p + data.Stride * TileSize * (v + t.Top) + TileSize * (u + t.Left);
|
||||
for (var j = 0; j < TileSize; j++)
|
||||
for (var i = 0; i < TileSize; i++)
|
||||
byte* q = p + data.Stride * tileSize * (v + t.Top) + tileSize * (u + t.Left);
|
||||
for (var j = 0; j < tileSize; j++)
|
||||
for (var i = 0; i < tileSize; i++)
|
||||
{
|
||||
bw.Write(q[i + j * data.Stride]);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
for (var x = 0; x < TileSize * TileSize; x++)
|
||||
for (var x = 0; x < tileSize * tileSize; x++)
|
||||
bw.Write((byte)0); /* TODO: don't fill with air */
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ namespace OpenRA.TilesetBuilder
|
||||
bw.Flush();
|
||||
|
||||
var flagsStart = ms.Position;
|
||||
for (var x = 0; x < totalTiles; x++ )
|
||||
for (var x = 0; x < totalTiles; x++)
|
||||
bw.Write((byte)0);
|
||||
|
||||
bw.Flush();
|
||||
@@ -334,12 +334,13 @@ namespace OpenRA.TilesetBuilder
|
||||
|
||||
File.WriteAllBytes(filename, bytes);
|
||||
}
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
public void Export (string OutputDir)
|
||||
public void Export(string outputDir)
|
||||
{
|
||||
var dir = Path.Combine(Path.GetDirectoryName(srcfile), Platform.SupportDir+OutputDir);
|
||||
var dir = Path.Combine(Path.GetDirectoryName(srcfile), Platform.SupportDir + outputDir);
|
||||
Directory.CreateDirectory(dir);
|
||||
var tilesetName = txtTilesetName.Text;
|
||||
var tilesetID = txtID.Text;
|
||||
@@ -350,30 +351,24 @@ namespace OpenRA.TilesetBuilder
|
||||
if (tilesetID.Length < 1) { tilesetID = "TEMPERAT"; }
|
||||
if (tilesetPalette.Length < 1) { tilesetPalette = "temperat"; }
|
||||
if (tilesetExt.Length < 1) { tilesetExt = ".tem,.shp"; }
|
||||
|
||||
// Create a Tileset definition
|
||||
// TODO: Pull this info from the GUI
|
||||
var tilesetFile = "";
|
||||
//var mixFile = "";
|
||||
tilesetFile = tilesetName.ToLower();
|
||||
if (tilesetFile.Length < 8)
|
||||
{
|
||||
tilesetFile = tilesetName.ToLower() + ".yaml";
|
||||
//mixFile = tilesetName.ToLower() + ".mix";
|
||||
}
|
||||
else
|
||||
{
|
||||
tilesetFile = tilesetName.ToLower().Substring(0, 8) + ".yaml";
|
||||
//mixFile = tilesetName.ToLower().Substring(0, 8) + ".mix";
|
||||
}
|
||||
|
||||
string[] Ext = tilesetExt.Split(',');
|
||||
var ext = tilesetExt.Split(',');
|
||||
var tileset = new TileSet()
|
||||
{
|
||||
Name = tilesetName,
|
||||
Id = tilesetID.ToUpper(),
|
||||
TileSize = size,
|
||||
Palette = tilesetPalette.ToLower(),
|
||||
Extensions = new string[] { Ext[0], Ext[1] }
|
||||
Extensions = new string[] { ext[0], ext[1] }
|
||||
};
|
||||
|
||||
// List of files to add to the mix file
|
||||
@@ -401,14 +396,14 @@ namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
Id = cur,
|
||||
Image = "{0}{1:00}".F(txtTilesetName.Text, cur),
|
||||
Size = new int2(tp.Width,tp.Height),
|
||||
Size = new int2(tp.Width, tp.Height),
|
||||
};
|
||||
|
||||
foreach (var t in tp.Cells)
|
||||
{
|
||||
string ttype = "Clear";
|
||||
ttype = TerrainType[surface1.TerrainTypes[t.Key.X, t.Key.Y]].Type;
|
||||
var idx = ((t.Key.X - tp.Left) + tp.Width * (t.Key.Y - tp.Top));
|
||||
var idx = (t.Key.X - tp.Left) + tp.Width * (t.Key.Y - tp.Top);
|
||||
template.Tiles.Add((byte)idx, ttype);
|
||||
}
|
||||
|
||||
@@ -417,13 +412,6 @@ namespace OpenRA.TilesetBuilder
|
||||
}
|
||||
|
||||
tileset.Save(Path.Combine(dir, tilesetFile));
|
||||
//throw new NotImplementedException("NotI");
|
||||
//PackageWriter.CreateMix(Path.Combine(dir, mixFile),fileList);
|
||||
|
||||
// Cleanup
|
||||
//foreach (var file in fileList)
|
||||
//File.Delete(file);
|
||||
|
||||
Console.WriteLine("Finished export");
|
||||
}
|
||||
|
||||
@@ -437,7 +425,7 @@ namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
foreach (var t in tp.Cells)
|
||||
{
|
||||
var idx = ((t.Key.X - tp.Left) + tp.Width * (t.Key.Y - tp.Top));
|
||||
var idx = (t.Key.X - tp.Left) + tp.Width * (t.Key.Y - tp.Top);
|
||||
|
||||
// TemplateID CellID tilenr TemplateW TemplateH XinTilesPNG YinTilesPNG
|
||||
Console.WriteLine("{0} {1} {2} {3} {4} {5} {6}",
|
||||
@@ -447,8 +435,7 @@ namespace OpenRA.TilesetBuilder
|
||||
tp.Width,
|
||||
tp.Height,
|
||||
t.Key.X,
|
||||
t.Key.Y
|
||||
);
|
||||
t.Key.Y);
|
||||
}
|
||||
|
||||
cur++;
|
||||
@@ -457,23 +444,14 @@ namespace OpenRA.TilesetBuilder
|
||||
Console.WriteLine("# end\n");
|
||||
}
|
||||
|
||||
private void toolStripContainer1_TopToolStripPanel_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void surface1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void txtTilesetName_TextChanged(object sender, EventArgs e)
|
||||
private void TilesetNameChanged(object sender, EventArgs e)
|
||||
{
|
||||
var tilesetFile = txtTilesetName.Text;
|
||||
if (tilesetFile.Length > 8)
|
||||
{
|
||||
tilesetFile = tilesetFile.ToLower().Substring(0, 8);
|
||||
}
|
||||
|
||||
txtID.Text = tilesetFile.ToUpper();
|
||||
txtPal.Text = tilesetFile.ToLower() + ".pal";
|
||||
if (tilesetFile.Length < 3)
|
||||
@@ -486,7 +464,7 @@ namespace OpenRA.TilesetBuilder
|
||||
}
|
||||
}
|
||||
|
||||
private void toolStripButton15_Click(object sender, EventArgs e)
|
||||
private void NewTilesetButton(object sender, EventArgs e)
|
||||
{
|
||||
CreateNewTileset();
|
||||
}
|
||||
@@ -1,228 +1,229 @@
|
||||
namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
partial class frmNew
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.numSize = new System.Windows.Forms.NumericUpDown();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.txtPal = new System.Windows.Forms.TextBox();
|
||||
this.btnPalBrowse = new System.Windows.Forms.Button();
|
||||
this.chkUsePalFromImage = new System.Windows.Forms.CheckBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.imgImage = new System.Windows.Forms.PictureBox();
|
||||
this.btnImgBrowse = new System.Windows.Forms.Button();
|
||||
this.txtImage = new System.Windows.Forms.TextBox();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numSize)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgImage)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// numSize
|
||||
//
|
||||
this.numSize.Location = new System.Drawing.Point(66, 6);
|
||||
this.numSize.Maximum = new decimal(new int[] {
|
||||
264,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numSize.Minimum = new decimal(new int[] {
|
||||
24,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numSize.Name = "numSize";
|
||||
this.numSize.Size = new System.Drawing.Size(49, 20);
|
||||
this.numSize.TabIndex = 0;
|
||||
this.numSize.Value = new decimal(new int[] {
|
||||
24,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numSize.ValueChanged += new System.EventHandler(this.numSize_ValueChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(48, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Tile size:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 34);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(43, 13);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Palette:";
|
||||
//
|
||||
// txtPal
|
||||
//
|
||||
this.txtPal.Location = new System.Drawing.Point(15, 52);
|
||||
this.txtPal.Name = "txtPal";
|
||||
this.txtPal.ReadOnly = true;
|
||||
this.txtPal.Size = new System.Drawing.Size(267, 20);
|
||||
this.txtPal.TabIndex = 3;
|
||||
//
|
||||
// btnPalBrowse
|
||||
//
|
||||
this.btnPalBrowse.Enabled = false;
|
||||
this.btnPalBrowse.Location = new System.Drawing.Point(288, 50);
|
||||
this.btnPalBrowse.Name = "btnPalBrowse";
|
||||
this.btnPalBrowse.Size = new System.Drawing.Size(26, 23);
|
||||
this.btnPalBrowse.TabIndex = 4;
|
||||
this.btnPalBrowse.Text = "...";
|
||||
this.btnPalBrowse.UseVisualStyleBackColor = true;
|
||||
this.btnPalBrowse.Click += new System.EventHandler(this.btnPalBrowse_Click);
|
||||
//
|
||||
// chkUsePalFromImage
|
||||
//
|
||||
this.chkUsePalFromImage.AutoSize = true;
|
||||
this.chkUsePalFromImage.Checked = true;
|
||||
this.chkUsePalFromImage.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkUsePalFromImage.Location = new System.Drawing.Point(66, 34);
|
||||
this.chkUsePalFromImage.Name = "chkUsePalFromImage";
|
||||
this.chkUsePalFromImage.Size = new System.Drawing.Size(134, 17);
|
||||
this.chkUsePalFromImage.TabIndex = 5;
|
||||
this.chkUsePalFromImage.Text = "Use palette from image";
|
||||
this.chkUsePalFromImage.UseVisualStyleBackColor = true;
|
||||
this.chkUsePalFromImage.CheckedChanged += new System.EventHandler(this.chkUsePalFromImage_CheckedChanged);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(12, 75);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(39, 13);
|
||||
this.label3.TabIndex = 6;
|
||||
this.label3.Text = "Image:";
|
||||
//
|
||||
// imgImage
|
||||
//
|
||||
this.imgImage.BackColor = System.Drawing.Color.Black;
|
||||
this.imgImage.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.imgImage.Location = new System.Drawing.Point(15, 120);
|
||||
this.imgImage.Name = "imgImage";
|
||||
this.imgImage.Size = new System.Drawing.Size(299, 219);
|
||||
this.imgImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.imgImage.TabIndex = 7;
|
||||
this.imgImage.TabStop = false;
|
||||
//
|
||||
// btnImgBrowse
|
||||
//
|
||||
this.btnImgBrowse.Location = new System.Drawing.Point(288, 91);
|
||||
this.btnImgBrowse.Name = "btnImgBrowse";
|
||||
this.btnImgBrowse.Size = new System.Drawing.Size(26, 23);
|
||||
this.btnImgBrowse.TabIndex = 9;
|
||||
this.btnImgBrowse.Text = "...";
|
||||
this.btnImgBrowse.UseVisualStyleBackColor = true;
|
||||
this.btnImgBrowse.Click += new System.EventHandler(this.btnImgBrowse_Click);
|
||||
//
|
||||
// txtImage
|
||||
//
|
||||
this.txtImage.Location = new System.Drawing.Point(15, 91);
|
||||
this.txtImage.Name = "txtImage";
|
||||
this.txtImage.ReadOnly = true;
|
||||
this.txtImage.Size = new System.Drawing.Size(267, 20);
|
||||
this.txtImage.TabIndex = 8;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(239, 345);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 10;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(158, 345);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOk.TabIndex = 11;
|
||||
this.btnOk.Text = "OK";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// frmNew
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(329, 378);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnImgBrowse);
|
||||
this.Controls.Add(this.txtImage);
|
||||
this.Controls.Add(this.imgImage);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.chkUsePalFromImage);
|
||||
this.Controls.Add(this.btnPalBrowse);
|
||||
this.Controls.Add(this.txtPal);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.numSize);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmNew";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "New Tileset";
|
||||
((System.ComponentModel.ISupportInitialize)(this.numSize)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgImage)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.NumericUpDown numSize;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox txtPal;
|
||||
private System.Windows.Forms.Button btnPalBrowse;
|
||||
private System.Windows.Forms.CheckBox chkUsePalFromImage;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.PictureBox imgImage;
|
||||
private System.Windows.Forms.Button btnImgBrowse;
|
||||
private System.Windows.Forms.TextBox txtImage;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
}
|
||||
namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
partial class FormNew
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.numSize = new System.Windows.Forms.NumericUpDown();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.txtPal = new System.Windows.Forms.TextBox();
|
||||
this.btnPalBrowse = new System.Windows.Forms.Button();
|
||||
this.chkUsePalFromImage = new System.Windows.Forms.CheckBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.imgImage = new System.Windows.Forms.PictureBox();
|
||||
this.btnImgBrowse = new System.Windows.Forms.Button();
|
||||
this.txtImage = new System.Windows.Forms.TextBox();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numSize)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgImage)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// numSize
|
||||
//
|
||||
this.numSize.Location = new System.Drawing.Point(66, 6);
|
||||
this.numSize.Maximum = new decimal(new int[] {
|
||||
264,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numSize.Minimum = new decimal(new int[] {
|
||||
24,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numSize.Name = "numSize";
|
||||
this.numSize.Size = new System.Drawing.Size(49, 20);
|
||||
this.numSize.TabIndex = 0;
|
||||
this.numSize.Value = new decimal(new int[] {
|
||||
24,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numSize.ValueChanged += new System.EventHandler(this.NumSizeValueChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(48, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Tile size:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 34);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(43, 13);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Palette:";
|
||||
//
|
||||
// txtPal
|
||||
//
|
||||
this.txtPal.Location = new System.Drawing.Point(15, 52);
|
||||
this.txtPal.Name = "txtPal";
|
||||
this.txtPal.ReadOnly = true;
|
||||
this.txtPal.Size = new System.Drawing.Size(267, 20);
|
||||
this.txtPal.TabIndex = 3;
|
||||
//
|
||||
// btnPalBrowse
|
||||
//
|
||||
this.btnPalBrowse.Enabled = false;
|
||||
this.btnPalBrowse.Location = new System.Drawing.Point(288, 50);
|
||||
this.btnPalBrowse.Name = "btnPalBrowse";
|
||||
this.btnPalBrowse.Size = new System.Drawing.Size(26, 23);
|
||||
this.btnPalBrowse.TabIndex = 4;
|
||||
this.btnPalBrowse.Text = "...";
|
||||
this.btnPalBrowse.UseVisualStyleBackColor = true;
|
||||
this.btnPalBrowse.Click += new System.EventHandler(this.PaletteBrowseClick);
|
||||
//
|
||||
// chkUsePalFromImage
|
||||
//
|
||||
this.chkUsePalFromImage.AutoSize = true;
|
||||
this.chkUsePalFromImage.Checked = true;
|
||||
this.chkUsePalFromImage.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkUsePalFromImage.Location = new System.Drawing.Point(66, 34);
|
||||
this.chkUsePalFromImage.Name = "chkUsePalFromImage";
|
||||
this.chkUsePalFromImage.Size = new System.Drawing.Size(134, 17);
|
||||
this.chkUsePalFromImage.TabIndex = 5;
|
||||
this.chkUsePalFromImage.Text = "Use palette from image";
|
||||
this.chkUsePalFromImage.UseVisualStyleBackColor = true;
|
||||
this.chkUsePalFromImage.CheckedChanged += new System.EventHandler(this.UsePaletteFromImageCheckedChanged);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(12, 75);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(39, 13);
|
||||
this.label3.TabIndex = 6;
|
||||
this.label3.Text = "Image:";
|
||||
//
|
||||
// imgImage
|
||||
//
|
||||
this.imgImage.BackColor = System.Drawing.Color.Black;
|
||||
this.imgImage.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.imgImage.Location = new System.Drawing.Point(15, 120);
|
||||
this.imgImage.Name = "imgImage";
|
||||
this.imgImage.Size = new System.Drawing.Size(299, 219);
|
||||
this.imgImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.imgImage.TabIndex = 7;
|
||||
this.imgImage.TabStop = false;
|
||||
//
|
||||
// btnImgBrowse
|
||||
//
|
||||
this.btnImgBrowse.Location = new System.Drawing.Point(288, 91);
|
||||
this.btnImgBrowse.Name = "btnImgBrowse";
|
||||
this.btnImgBrowse.Size = new System.Drawing.Size(26, 23);
|
||||
this.btnImgBrowse.TabIndex = 9;
|
||||
this.btnImgBrowse.Text = "...";
|
||||
this.btnImgBrowse.UseVisualStyleBackColor = true;
|
||||
this.btnImgBrowse.Click += new System.EventHandler(this.ImageBrowseClick);
|
||||
//
|
||||
// txtImage
|
||||
//
|
||||
this.txtImage.Location = new System.Drawing.Point(15, 91);
|
||||
this.txtImage.Name = "txtImage";
|
||||
this.txtImage.ReadOnly = true;
|
||||
this.txtImage.Size = new System.Drawing.Size(267, 20);
|
||||
this.txtImage.TabIndex = 8;
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(239, 345);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 10;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.CancelButtonClick);
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(158, 345);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOk.TabIndex = 11;
|
||||
this.btnOk.Text = "OK";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.OkButtonClick);
|
||||
//
|
||||
// frmNew
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(329, 378);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnImgBrowse);
|
||||
this.Controls.Add(this.txtImage);
|
||||
this.Controls.Add(this.imgImage);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.chkUsePalFromImage);
|
||||
this.Controls.Add(this.btnPalBrowse);
|
||||
this.Controls.Add(this.txtPal);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.numSize);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "frmNew";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "New Tileset";
|
||||
((System.ComponentModel.ISupportInitialize)(this.numSize)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgImage)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.NumericUpDown numSize;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.TextBox txtPal;
|
||||
private System.Windows.Forms.Button btnPalBrowse;
|
||||
private System.Windows.Forms.CheckBox chkUsePalFromImage;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.PictureBox imgImage;
|
||||
private System.Windows.Forms.Button btnImgBrowse;
|
||||
private System.Windows.Forms.TextBox txtImage;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
}
|
||||
}
|
||||
@@ -8,24 +8,24 @@ using System.Windows.Forms;
|
||||
|
||||
namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
public partial class frmNew : Form
|
||||
public partial class FormNew : Form
|
||||
{
|
||||
public bool PaletteFromImage = true;
|
||||
public string PaletteFile = "";
|
||||
public string ImageFile = "";
|
||||
public int TileSize = 24;
|
||||
|
||||
public frmNew()
|
||||
public FormNew()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
private void CancelButtonClick(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
private void OkButtonClick(object sender, EventArgs e)
|
||||
{
|
||||
if (!PaletteFromImage)
|
||||
{
|
||||
@@ -34,6 +34,7 @@ namespace OpenRA.TilesetBuilder
|
||||
MessageBox.Show("No palette specified", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
if (ImageFile.Length < 5)
|
||||
{
|
||||
MessageBox.Show("No image selected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
@@ -45,7 +46,7 @@ namespace OpenRA.TilesetBuilder
|
||||
}
|
||||
}
|
||||
|
||||
private void chkUsePalFromImage_CheckedChanged(object sender, EventArgs e)
|
||||
private void UsePaletteFromImageCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (chkUsePalFromImage.Checked)
|
||||
{
|
||||
@@ -59,7 +60,7 @@ namespace OpenRA.TilesetBuilder
|
||||
}
|
||||
}
|
||||
|
||||
private void btnPalBrowse_Click(object sender, EventArgs e)
|
||||
private void PaletteBrowseClick(object sender, EventArgs e)
|
||||
{
|
||||
using (var ofd = new OpenFileDialog { Filter = "C&C Palette (*.pal)|*.pal" })
|
||||
if (DialogResult.OK == ofd.ShowDialog())
|
||||
@@ -69,7 +70,7 @@ namespace OpenRA.TilesetBuilder
|
||||
}
|
||||
}
|
||||
|
||||
private void btnImgBrowse_Click(object sender, EventArgs e)
|
||||
private void ImageBrowseClick(object sender, EventArgs e)
|
||||
{
|
||||
using (var ofd = new OpenFileDialog { Filter = "8bit Image (*.png,*.pcx,*.bmp)|*.png;*.pcx;*.bmp" })
|
||||
if (DialogResult.OK == ofd.ShowDialog())
|
||||
@@ -80,7 +81,7 @@ namespace OpenRA.TilesetBuilder
|
||||
}
|
||||
}
|
||||
|
||||
private void numSize_ValueChanged(object sender, EventArgs e)
|
||||
private void NumSizeValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
TileSize = (int)numSize.Value;
|
||||
}
|
||||
@@ -74,25 +74,9 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="frmBuilder.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmBuilder.Designer.cs">
|
||||
<DependentUpon>frmBuilder.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmNew.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmNew.Designer.cs">
|
||||
<DependentUpon>frmNew.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="frmBuilder.resx">
|
||||
<DependentUpon>frmBuilder.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmNew.resx">
|
||||
<DependentUpon>frmNew.cs</DependentUpon>
|
||||
<DependentUpon>FormNew.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
@@ -120,6 +104,21 @@
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Template.cs" />
|
||||
<Compile Include="FormBuilder.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FormBuilder.Designer.cs">
|
||||
<DependentUpon>FormBuilder.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="FormBuilder.resx">
|
||||
<DependentUpon>FormBuilder.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="FormNew.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FormNew.Designer.cs">
|
||||
<DependentUpon>FormNew.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||
|
||||
@@ -21,17 +21,17 @@ namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
//Console.WriteLine("{0} {1} {2} {3}",args[0], args[1], args[2], args[3]);
|
||||
|
||||
if (args.Length < 1)
|
||||
{
|
||||
Application.Run(new frmBuilder("", "0", false, "Tilesets"));
|
||||
Application.Run(new FormBuilder("", "0", false, "Tilesets"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (args.Contains("--export"))
|
||||
Application.Run(new frmBuilder(args[0], args[1], true, args[3]));
|
||||
Application.Run(new FormBuilder(args[0], args[1], true, args[3]));
|
||||
else
|
||||
Application.Run(new frmBuilder(args[0], args[1], false, "Tilesets"));
|
||||
Application.Run(new FormBuilder(args[0], args[1], false, "Tilesets"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,31 +9,29 @@ namespace OpenRA.TilesetBuilder
|
||||
class Surface : Control
|
||||
{
|
||||
public Bitmap Image;
|
||||
private ImageList ImagesListControl;
|
||||
public int[,] TerrainTypes;
|
||||
public List<Template> Templates = new List<Template>();
|
||||
private bool bShowTerrainTypes;
|
||||
public string InputMode;
|
||||
public Bitmap[] icon;
|
||||
public Bitmap[] Icon;
|
||||
public int TileSize;
|
||||
public int TilesPerRow;
|
||||
//private System.ComponentModel.IContainer components;
|
||||
|
||||
|
||||
public event Action<int, int, int> UpdateMouseTilePosition = (x, y, t) => { };
|
||||
|
||||
Template CurrentTemplate;
|
||||
Template currentTemplate;
|
||||
ImageList imagesListControl;
|
||||
bool showTerrainTypes;
|
||||
|
||||
public bool ShowTerrainTypes
|
||||
{
|
||||
get { return bShowTerrainTypes; }
|
||||
set { bShowTerrainTypes = value; }
|
||||
get { return showTerrainTypes; }
|
||||
set { showTerrainTypes = value; }
|
||||
}
|
||||
|
||||
public ImageList ImagesList
|
||||
{
|
||||
get { return ImagesListControl; }
|
||||
set { ImagesListControl = value; }
|
||||
get { return imagesListControl; }
|
||||
set { imagesListControl = value; }
|
||||
}
|
||||
|
||||
public Surface()
|
||||
@@ -60,12 +58,12 @@ namespace OpenRA.TilesetBuilder
|
||||
for (var j = 0; j <= TerrainTypes.GetUpperBound(1); j++)
|
||||
if (TerrainTypes[i, j] != 0)
|
||||
{
|
||||
//e.Graphics.FillRectangle(Brushes.Black, TileSize * i + 8, TileSize * j + 8, 16, 16);
|
||||
////e.Graphics.FillRectangle(Brushes.Black, TileSize * i + 8, TileSize * j + 8, 16, 16);
|
||||
|
||||
e.Graphics.DrawImage(icon[TerrainTypes[i, j]], TileSize * i + 8, TileSize * j + 8, 16, 16);
|
||||
e.Graphics.DrawImage(Icon[TerrainTypes[i, j]], TileSize * i + 8, TileSize * j + 8, 16, 16);
|
||||
|
||||
//e.Graphics.DrawString(TerrainTypes[i, j].ToString(),
|
||||
//Font, Brushes.LimeGreen, TileSize * i + 10, TileSize * j + 10);
|
||||
////e.Graphics.DrawString(TerrainTypes[i, j].ToString(),
|
||||
////Font, Brushes.LimeGreen, TileSize * i + 10, TileSize * j + 10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +74,7 @@ namespace OpenRA.TilesetBuilder
|
||||
|
||||
foreach (var c in t.Cells.Keys)
|
||||
{
|
||||
if (CurrentTemplate == t)
|
||||
if (currentTemplate == t)
|
||||
e.Graphics.FillRectangle(currentBrush, TileSize * c.X, TileSize * c.Y, TileSize, TileSize);
|
||||
|
||||
if (!t.Cells.ContainsKey(c + new int2(-1, 0)))
|
||||
@@ -99,9 +97,9 @@ namespace OpenRA.TilesetBuilder
|
||||
{
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
CurrentTemplate = Templates.FirstOrDefault(t => t.Cells.ContainsKey(pos));
|
||||
if (CurrentTemplate == null)
|
||||
Templates.Add(CurrentTemplate = new Template { Cells = new Dictionary<int2, bool> { { pos, true } } });
|
||||
currentTemplate = Templates.FirstOrDefault(t => t.Cells.ContainsKey(pos));
|
||||
if (currentTemplate == null)
|
||||
Templates.Add(currentTemplate = new Template { Cells = new Dictionary<int2, bool> { { pos, true } } });
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
@@ -109,7 +107,7 @@ namespace OpenRA.TilesetBuilder
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
Templates.RemoveAll(t => t.Cells.ContainsKey(pos));
|
||||
CurrentTemplate = null;
|
||||
currentTemplate = null;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
@@ -126,11 +124,11 @@ namespace OpenRA.TilesetBuilder
|
||||
|
||||
if (InputMode == null)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left && CurrentTemplate != null)
|
||||
if (e.Button == MouseButtons.Left && currentTemplate != null)
|
||||
{
|
||||
if (!CurrentTemplate.Cells.ContainsKey(pos))
|
||||
if (!currentTemplate.Cells.ContainsKey(pos))
|
||||
{
|
||||
CurrentTemplate.Cells[pos] = true;
|
||||
currentTemplate.Cells[pos] = true;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user