remove the WinForms map editor
This commit is contained in:
37
Makefile
37
Makefile
@@ -79,7 +79,7 @@ INSTALL_DATA = $(INSTALL) -m644
|
||||
|
||||
# program targets
|
||||
CORE = rsdl2 rnull game utility
|
||||
TOOLS = editor gamemonitor
|
||||
TOOLS = gamemonitor
|
||||
VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`)
|
||||
|
||||
# dependencies
|
||||
@@ -169,24 +169,6 @@ mod_ts_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_common_TARGET)
|
||||
PROGRAMS += mod_ts
|
||||
mod_ts: $(mod_ts_TARGET)
|
||||
|
||||
##### Tools #####
|
||||
|
||||
# Map Editor
|
||||
editor_SRCS := $(shell find OpenRA.Editor/ -iname '*.cs')
|
||||
editor_TARGET = OpenRA.Editor.exe
|
||||
editor_KIND = winexe
|
||||
editor_DEPS = $(game_TARGET) $(mod_common_TARGET)
|
||||
editor_LIBS = System.Windows.Forms.dll System.Data.dll System.Drawing.dll $(editor_DEPS) thirdparty/download/Eluant.dll
|
||||
editor_EXTRA = -resource:OpenRA.Editor.Form1.resources -resource:OpenRA.Editor.MapSelect.resources
|
||||
editor_FLAGS = -win32icon:OpenRA.Editor/OpenRA.Editor.Icon.ico
|
||||
|
||||
PROGRAMS += editor
|
||||
OpenRA.Editor.MapSelect.resources:
|
||||
resgen2 OpenRA.Editor/MapSelect.resx OpenRA.Editor.MapSelect.resources 1> /dev/null
|
||||
OpenRA.Editor.Form1.resources:
|
||||
resgen2 OpenRA.Editor/Form1.resx OpenRA.Editor.Form1.resources 1> /dev/null
|
||||
editor: OpenRA.Editor.MapSelect.resources OpenRA.Editor.Form1.resources $(editor_TARGET)
|
||||
|
||||
check: utility mods
|
||||
@echo
|
||||
@echo "Checking for code style violations in OpenRA.Game..."
|
||||
@@ -213,9 +195,6 @@ check: utility mods
|
||||
@echo "Checking for code style violations in OpenRA.Mods.TS..."
|
||||
@mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Mods.TS
|
||||
@echo
|
||||
@echo "Checking for code style violations in OpenRA.Editor..."
|
||||
@mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Editor
|
||||
@echo
|
||||
@echo "Checking for code style violations in OpenRA.Renderer.Sdl2..."
|
||||
@mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Renderer.Sdl2
|
||||
@echo
|
||||
@@ -291,7 +270,7 @@ default: core
|
||||
|
||||
core: game renderers mods utility
|
||||
|
||||
tools: editor gamemonitor
|
||||
tools: gamemonitor
|
||||
|
||||
package: all-dependencies core tools docs version
|
||||
|
||||
@@ -397,7 +376,6 @@ install-linux-icons:
|
||||
install-linux-desktop:
|
||||
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications"
|
||||
@$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications"
|
||||
@$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications"
|
||||
|
||||
install-linux-mime:
|
||||
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/mime/packages/"
|
||||
@@ -426,24 +404,13 @@ install-linux-scripts:
|
||||
@$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)"
|
||||
@-$(RM) openra
|
||||
|
||||
@echo "#!/bin/sh" > openra-editor
|
||||
@echo 'cd "$(gameinstalldir)"' >> openra-editor
|
||||
@echo 'exec mono OpenRA.Editor.exe "$$@"' >> openra-editor
|
||||
@$(INSTALL_DIR) "$(BIN_INSTALL_DIR)"
|
||||
@$(INSTALL_PROGRAM) -m +rx openra-editor "$(BIN_INSTALL_DIR)"
|
||||
@-$(RM) openra-editor
|
||||
|
||||
uninstall:
|
||||
@-$(RM_R) "$(DATA_INSTALL_DIR)"
|
||||
@-$(RM_F) "$(BIN_INSTALL_DIR)/openra"
|
||||
@-$(RM_F) "$(BIN_INSTALL_DIR)/openra-editor"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/applications/openra.desktop"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/applications/openra-editor.desktop"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/16x16/apps/openra.png"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/openra.png"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/openra-editor.png"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra.png"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra-editor.png"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/openra.png"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/openra.png"
|
||||
@-$(RM_F) "$(DESTDIR)$(datadir)/mime/packages/openra.xml"
|
||||
|
||||
90
OpenRA.Editor/ActorPropertiesDialog.Designer.cs
generated
90
OpenRA.Editor/ActorPropertiesDialog.Designer.cs
generated
@@ -1,90 +0,0 @@
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
partial class ActorPropertiesDialog
|
||||
{
|
||||
/// <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.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.button1.Location = new System.Drawing.Point(226, 333);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "Cancel";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.button2.Enabled = false;
|
||||
this.button2.Location = new System.Drawing.Point(145, 333);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 0;
|
||||
this.button2.Text = "OK";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoScroll = true;
|
||||
this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(13, 13);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(288, 314);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// ActorPropertiesDialog
|
||||
//
|
||||
this.AcceptButton = this.button2;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.button1;
|
||||
this.ClientSize = new System.Drawing.Size(313, 368);
|
||||
this.Controls.Add(this.flowLayoutPanel1);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ActorPropertiesDialog";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Actor Properties";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
public partial class ActorPropertiesDialog : Form
|
||||
{
|
||||
public ActorPropertiesDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void AddRow(string name, Control c)
|
||||
{
|
||||
flowLayoutPanel1.Controls.Add(new Label
|
||||
{
|
||||
Text = name,
|
||||
Width = flowLayoutPanel1.Width * 3 / 10,
|
||||
Height = 25,
|
||||
TextAlign = ContentAlignment.MiddleLeft,
|
||||
});
|
||||
|
||||
c.Width = flowLayoutPanel1.Width * 6 / 10 - 25;
|
||||
c.Height = 25;
|
||||
flowLayoutPanel1.Controls.Add(c);
|
||||
}
|
||||
|
||||
public Control MakeEditorControl(Type t, Func<object> getter, Action<object> setter)
|
||||
{
|
||||
var r = new TextBox();
|
||||
r.Text = FieldSaver.FormatValue(getter(), t);
|
||||
r.LostFocus += (e, _) => setter(FieldLoader.GetValue("<editor internals>", t, r.Text));
|
||||
r.Enabled = false;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,35 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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.Drawing;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
class ActorTemplate
|
||||
{
|
||||
public Bitmap Bitmap;
|
||||
public ActorInfo Info;
|
||||
public EditorAppearanceInfo Appearance;
|
||||
}
|
||||
|
||||
class BrushTemplate
|
||||
{
|
||||
public Bitmap Bitmap;
|
||||
public ushort N;
|
||||
}
|
||||
|
||||
class ResourceTemplate
|
||||
{
|
||||
public Bitmap Bitmap;
|
||||
public ResourceTypeInfo Info;
|
||||
public int Value;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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.Linq;
|
||||
using SGraphics = System.Drawing.Graphics;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
class ActorTool : ITool
|
||||
{
|
||||
ActorTemplate actorTemplate;
|
||||
public ActorTool(ActorTemplate actor) { this.actorTemplate = actor; }
|
||||
|
||||
public void Preview(Surface surface, SGraphics g)
|
||||
{
|
||||
surface.DrawActor(g, surface.GetBrushLocation(), actorTemplate,
|
||||
surface.GetPaletteForPlayer(surface.NewActorOwner));
|
||||
}
|
||||
|
||||
public void Apply(Surface surface)
|
||||
{
|
||||
if (surface.Actors.Any(a => a.Value.Location() == surface.GetBrushLocation()))
|
||||
return;
|
||||
|
||||
var owner = surface.NewActorOwner;
|
||||
var id = NextActorName(surface);
|
||||
surface.Actors[id] = new ActorReference(actorTemplate.Info.Name.ToLowerInvariant())
|
||||
{
|
||||
new LocationInit(surface.GetBrushLocation()),
|
||||
new OwnerInit(owner)
|
||||
};
|
||||
}
|
||||
|
||||
static string NextActorName(Surface surface)
|
||||
{
|
||||
var id = 0;
|
||||
for (;;)
|
||||
{
|
||||
var possible = "Actor{0}".F(id++);
|
||||
if (!surface.Actors.ContainsKey(possible)) return possible;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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.Windows.Forms;
|
||||
using SGraphics = System.Drawing.Graphics;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
class BrushTool : ITool
|
||||
{
|
||||
BrushTemplate brushTemplate;
|
||||
|
||||
public BrushTool(BrushTemplate brush) { this.brushTemplate = brush; }
|
||||
|
||||
public void Apply(Surface surface)
|
||||
{
|
||||
// change the bits in the map
|
||||
var template = surface.TileSet.Templates[brushTemplate.N];
|
||||
var tile = surface.TileSetRenderer.Data(brushTemplate.N);
|
||||
var pos = surface.GetBrushLocation();
|
||||
|
||||
if (surface.GetModifiers() == Keys.Shift)
|
||||
{
|
||||
FloodFillWithBrush(surface, pos);
|
||||
return;
|
||||
}
|
||||
|
||||
for (var u = 0; u < template.Size.X; u++)
|
||||
for (var v = 0; v < template.Size.Y; v++)
|
||||
{
|
||||
var cell = pos + new CVec(u, v);
|
||||
if (surface.Map.Contains(cell))
|
||||
{
|
||||
var z = u + v * template.Size.X;
|
||||
if (tile != null && tile[z].Length > 0)
|
||||
{
|
||||
var index = template.PickAny ? (byte)((u + pos.X) % 4 + ((v + pos.Y) % 4) * 4) : (byte)z;
|
||||
surface.Map.MapTiles.Value[cell] = new TerrainTile(brushTemplate.N, index);
|
||||
}
|
||||
|
||||
var ch = new int2((pos.X + u) / Surface.ChunkSize, (pos.Y + v) / Surface.ChunkSize);
|
||||
if (surface.Chunks.ContainsKey(ch))
|
||||
{
|
||||
surface.Chunks[ch].Dispose();
|
||||
surface.Chunks.Remove(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Preview(Surface surface, SGraphics g)
|
||||
{
|
||||
g.DrawImage(brushTemplate.Bitmap,
|
||||
surface.TileSetRenderer.TileSize * surface.GetBrushLocation().X * surface.Zoom + surface.GetOffset().X,
|
||||
surface.TileSetRenderer.TileSize * surface.GetBrushLocation().Y * surface.Zoom + surface.GetOffset().Y,
|
||||
brushTemplate.Bitmap.Width * surface.Zoom,
|
||||
brushTemplate.Bitmap.Height * surface.Zoom);
|
||||
}
|
||||
|
||||
void FloodFillWithBrush(Surface s, CPos pos)
|
||||
{
|
||||
var queue = new Queue<CPos>();
|
||||
var replace = s.Map.MapTiles.Value[pos];
|
||||
var touched = new bool[s.Map.MapSize.X, s.Map.MapSize.Y];
|
||||
|
||||
Action<int, int> maybeEnqueue = (x, y) =>
|
||||
{
|
||||
var c = new CPos(x, y);
|
||||
if (s.Map.Contains(c) && !touched[x, y])
|
||||
{
|
||||
queue.Enqueue(c);
|
||||
touched[x, y] = true;
|
||||
}
|
||||
};
|
||||
|
||||
queue.Enqueue(pos);
|
||||
while (queue.Count > 0)
|
||||
{
|
||||
var p = queue.Dequeue();
|
||||
if (s.Map.MapTiles.Value[p].Type != replace.Type)
|
||||
continue;
|
||||
|
||||
var a = FindEdge(s, p, new CVec(-1, 0), replace);
|
||||
var b = FindEdge(s, p, new CVec(1, 0), replace);
|
||||
|
||||
for (var x = a.X; x <= b.X; x++)
|
||||
{
|
||||
s.Map.MapTiles.Value[new CPos(x, p.Y)] = new TerrainTile(brushTemplate.N, (byte)0);
|
||||
if (s.Map.MapTiles.Value[new CPos(x, p.Y - 1)].Type == replace.Type)
|
||||
maybeEnqueue(x, p.Y - 1);
|
||||
if (s.Map.MapTiles.Value[new CPos(x, p.Y + 1)].Type == replace.Type)
|
||||
maybeEnqueue(x, p.Y + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: optimize */
|
||||
foreach (var ch in s.Chunks.Values) ch.Dispose();
|
||||
s.Chunks.Clear();
|
||||
}
|
||||
|
||||
static CPos FindEdge(Surface s, CPos p, CVec d, TerrainTile replace)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
var q = p + d;
|
||||
if (!s.Map.Contains(q)) return p;
|
||||
if (s.Map.MapTiles.Value[q].Type != replace.Type) return p;
|
||||
p = q;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
98
OpenRA.Editor/ErrorListDialog.Designer.cs
generated
98
OpenRA.Editor/ErrorListDialog.Designer.cs
generated
@@ -1,98 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
partial class ErrorListDialog
|
||||
{
|
||||
/// <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.label1 = new System.Windows.Forms.Label();
|
||||
this.listBox1 = new System.Windows.Forms.ListBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label1.Location = new System.Drawing.Point(10, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(610, 23);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Your map import completed, but with errors:";
|
||||
//
|
||||
// listBox1
|
||||
//
|
||||
this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.listBox1.FormattingEnabled = true;
|
||||
this.listBox1.Location = new System.Drawing.Point(13, 30);
|
||||
this.listBox1.Name = "listBox1";
|
||||
this.listBox1.Size = new System.Drawing.Size(607, 316);
|
||||
this.listBox1.TabIndex = 1;
|
||||
//
|
||||
// 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.Cancel;
|
||||
this.button1.Location = new System.Drawing.Point(545, 359);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 2;
|
||||
this.button1.Text = "Close";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// ErrorListDialog
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(632, 394);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.listBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Name = "ErrorListDialog";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Map Import Errors";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.ListBox listBox1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
public partial class ErrorListDialog : Form
|
||||
{
|
||||
public ErrorListDialog(IEnumerable<string> errors)
|
||||
{
|
||||
InitializeComponent();
|
||||
foreach (var e in errors)
|
||||
listBox1.Items.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
1133
OpenRA.Editor/Form1.Designer.cs
generated
1133
OpenRA.Editor/Form1.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1,735 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1(string[] args)
|
||||
{
|
||||
InitializeComponent();
|
||||
AppDomain.CurrentDomain.AssemblyResolve += GlobalFileSystem.ResolveAssembly;
|
||||
|
||||
currentMod = args.FirstOrDefault() ?? "ra";
|
||||
|
||||
toolStripComboBox1.Items.AddRange(ModMetadata.AllMods.Keys.ToArray());
|
||||
|
||||
toolStripComboBox1.SelectedIndexChanged += (_, e) =>
|
||||
{
|
||||
tilePalette.SuspendLayout();
|
||||
actorPalette.SuspendLayout();
|
||||
resourcePalette.SuspendLayout();
|
||||
tilePalette.Controls.Clear();
|
||||
actorPalette.Controls.Clear();
|
||||
resourcePalette.Controls.Clear();
|
||||
tilePalette.ResumeLayout();
|
||||
actorPalette.ResumeLayout();
|
||||
resourcePalette.ResumeLayout();
|
||||
surface1.Bind(null, null, null, null, null);
|
||||
miniMapBox.Image = null;
|
||||
currentMod = toolStripComboBox1.SelectedItem as string;
|
||||
|
||||
Game.InitializeSettings(Arguments.Empty);
|
||||
Game.ModData = new ModData(currentMod);
|
||||
GlobalFileSystem.LoadFromManifest(Game.ModData.Manifest);
|
||||
Program.Rules = Game.ModData.RulesetCache.LoadDefaultRules();
|
||||
|
||||
var mod = Game.ModData.Manifest.Mod;
|
||||
Text = "{0} Mod Version: {1} - OpenRA Editor".F(mod.Title, mod.Version);
|
||||
|
||||
loadedMapName = null;
|
||||
};
|
||||
|
||||
toolStripComboBox1.SelectedItem = currentMod;
|
||||
|
||||
surface1.AfterChange += OnMapChanged;
|
||||
surface1.MousePositionChanged += s => toolStripStatusLabelMousePosition.Text = s;
|
||||
surface1.ActorDoubleClicked += ActorDoubleClicked;
|
||||
|
||||
if (args.Length >= 2)
|
||||
LoadMap(args[1]);
|
||||
}
|
||||
|
||||
void OnMapChanged()
|
||||
{
|
||||
MakeDirty();
|
||||
var tileSet = Program.Rules.TileSets[surface1.Map.Tileset];
|
||||
miniMapBox.Image = Minimap.RenderMapPreview(tileSet, surface1.Map, true);
|
||||
cashToolStripStatusLabel.Text = CalculateTotalResource().ToString();
|
||||
}
|
||||
|
||||
void ActorDoubleClicked(KeyValuePair<string, ActorReference> kv)
|
||||
{
|
||||
using (var apd = new ActorPropertiesDialog())
|
||||
{
|
||||
var name = kv.Key;
|
||||
apd.AddRow("(Name)", apd.MakeEditorControl(typeof(string), () => name, v => name = (string)v));
|
||||
apd.AddRow("(Type)", apd.MakeEditorControl(typeof(string), () => kv.Value.Type, v => kv.Value.Type = (string)v));
|
||||
|
||||
var objSaved = kv.Value.Save();
|
||||
|
||||
// TODO: make this work properly
|
||||
foreach (var init in Program.Rules.Actors[kv.Value.Type].GetInitKeys())
|
||||
{
|
||||
var initName = init.First;
|
||||
apd.AddRow(initName,
|
||||
apd.MakeEditorControl(init.Second,
|
||||
() =>
|
||||
{
|
||||
var nodesDict = objSaved.ToDictionary();
|
||||
return nodesDict.ContainsKey(initName) ? nodesDict[initName].Value : null;
|
||||
},
|
||||
_ => { }));
|
||||
}
|
||||
|
||||
apd.ShowDialog();
|
||||
|
||||
// TODO: writeback
|
||||
}
|
||||
}
|
||||
|
||||
void MakeDirty() { dirty = true; }
|
||||
|
||||
string loadedMapName;
|
||||
string currentMod = "ra";
|
||||
TileSet tileset;
|
||||
TileSetRenderer tilesetRenderer;
|
||||
bool dirty = false;
|
||||
|
||||
void LoadMap(string mapname)
|
||||
{
|
||||
tilePalette.Controls.Clear();
|
||||
actorPalette.Controls.Clear();
|
||||
resourcePalette.Controls.Clear();
|
||||
|
||||
loadedMapName = mapname;
|
||||
|
||||
// load the map
|
||||
var map = new Map(mapname);
|
||||
|
||||
// upgrade maps that have no player definitions. editor doesnt care,
|
||||
// but this breaks the game pretty badly.
|
||||
if (map.PlayerDefinitions.Count == 0)
|
||||
{
|
||||
var players = new MapPlayers(map.Rules, map.SpawnPoints.Value.Length);
|
||||
map.PlayerDefinitions = players.ToMiniYaml();
|
||||
}
|
||||
|
||||
PrepareMapResources(Game.ModData, map);
|
||||
|
||||
// Calculate total net worth of resources in cash
|
||||
cashToolStripStatusLabel.Text = CalculateTotalResource().ToString();
|
||||
|
||||
dirty = false;
|
||||
}
|
||||
|
||||
void NewMap(Map map)
|
||||
{
|
||||
tilePalette.Controls.Clear();
|
||||
actorPalette.Controls.Clear();
|
||||
resourcePalette.Controls.Clear();
|
||||
|
||||
loadedMapName = null;
|
||||
PrepareMapResources(Game.ModData, map);
|
||||
|
||||
MakeDirty();
|
||||
}
|
||||
|
||||
// this code is insanely stupid, and mostly my fault -- chrisf
|
||||
void PrepareMapResources(ModData modData, Map map)
|
||||
{
|
||||
Program.Rules = map.Rules;
|
||||
|
||||
tileset = Program.Rules.TileSets[map.Tileset];
|
||||
tilesetRenderer = new TileSetRenderer(tileset, modData.Manifest.TileSize);
|
||||
var shadowIndex = new int[] { 3, 4 };
|
||||
var palette = new ImmutablePalette(GlobalFileSystem.Open(tileset.Palette), shadowIndex);
|
||||
|
||||
// required for desert terrain in RA
|
||||
var playerPalette = tileset.PlayerPalette ?? tileset.Palette;
|
||||
var shadowedPalette = new ImmutablePalette(GlobalFileSystem.Open(playerPalette), shadowIndex);
|
||||
|
||||
surface1.Bind(map, tileset, tilesetRenderer, palette, shadowedPalette);
|
||||
|
||||
// construct the palette of tiles
|
||||
var palettes = new[] { tilePalette, actorPalette, resourcePalette };
|
||||
foreach (var p in palettes) { p.Visible = false; p.SuspendLayout(); }
|
||||
|
||||
var templateOrder = tileset.EditorTemplateOrder ?? new string[] { };
|
||||
foreach (var tc in tileset.Templates.GroupBy(t => t.Value.Category).OrderBy(t => templateOrder.IndexOf(t.Key)))
|
||||
{
|
||||
var category = tc.Key ?? "(Uncategorized)";
|
||||
var categoryHeader = new Label
|
||||
{
|
||||
BackColor = SystemColors.Highlight,
|
||||
ForeColor = SystemColors.HighlightText,
|
||||
Text = category,
|
||||
AutoSize = false,
|
||||
Height = 24,
|
||||
TextAlign = ContentAlignment.MiddleLeft,
|
||||
Width = tilePalette.ClientSize.Width,
|
||||
};
|
||||
|
||||
// hook this manually, anchoring inside FlowLayoutPanel is flaky.
|
||||
tilePalette.Resize += (_, e) => categoryHeader.Width = tilePalette.ClientSize.Width;
|
||||
|
||||
if (tilePalette.Controls.Count > 0)
|
||||
tilePalette.SetFlowBreak(
|
||||
tilePalette.Controls[tilePalette.Controls.Count - 1], true);
|
||||
tilePalette.Controls.Add(categoryHeader);
|
||||
|
||||
foreach (var t in tc)
|
||||
{
|
||||
try
|
||||
{
|
||||
var bitmap = tilesetRenderer.RenderTemplate((ushort)t.Key, palette);
|
||||
var ibox = new PictureBox
|
||||
{
|
||||
Image = bitmap,
|
||||
Width = bitmap.Width / 2,
|
||||
Height = bitmap.Height / 2,
|
||||
SizeMode = PictureBoxSizeMode.StretchImage
|
||||
};
|
||||
|
||||
var brushTemplate = new BrushTemplate { Bitmap = bitmap, N = t.Key };
|
||||
ibox.Click += (_, e) => surface1.SetTool(new BrushTool(brushTemplate));
|
||||
|
||||
var template = t.Value;
|
||||
tilePalette.Controls.Add(ibox);
|
||||
tt.SetToolTip(ibox, "{1}:{0} ({2}x{3})".F(template.Images[0], template.Id, template.Size.X, template.Size.Y));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
var actorTemplates = new List<ActorTemplate>();
|
||||
|
||||
foreach (var a in Program.Rules.Actors.Keys)
|
||||
{
|
||||
try
|
||||
{
|
||||
var info = Program.Rules.Actors[a];
|
||||
if (!info.Traits.Contains<ILegacyEditorRenderInfo>()) continue;
|
||||
|
||||
var etf = info.Traits.GetOrDefault<EditorTilesetFilterInfo>();
|
||||
if (etf != null && etf.ExcludeTilesets != null
|
||||
&& etf.ExcludeTilesets.Contains(tileset.Id)) continue;
|
||||
if (etf != null && etf.RequireTilesets != null
|
||||
&& !etf.RequireTilesets.Contains(tileset.Id)) continue;
|
||||
|
||||
var templatePalette = shadowedPalette;
|
||||
var rsi = info.Traits.GetOrDefault<ILegacyEditorRenderInfo>();
|
||||
|
||||
// exception for desert buildings
|
||||
if (rsi != null && rsi.EditorPalette != null && rsi.EditorPalette.Contains("terrain"))
|
||||
templatePalette = palette;
|
||||
|
||||
var race = Program.Rules.Actors["world"].Traits.WithInterface<CountryInfo>().First().Race;
|
||||
var sequenceProvider = Program.Rules.Sequences[tileset.Id];
|
||||
var template = RenderUtils.RenderActor(info, sequenceProvider, tileset, templatePalette, race);
|
||||
var ibox = new PictureBox
|
||||
{
|
||||
Image = template.Bitmap,
|
||||
Width = 32,
|
||||
Height = 32,
|
||||
SizeMode = PictureBoxSizeMode.Zoom,
|
||||
BorderStyle = BorderStyle.FixedSingle
|
||||
};
|
||||
|
||||
ibox.Click += (_, e) => surface1.SetTool(new ActorTool(template));
|
||||
|
||||
actorPalette.Controls.Add(ibox);
|
||||
|
||||
tt.SetToolTip(ibox, "{0}".F(info.Name));
|
||||
|
||||
actorTemplates.Add(template);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
surface1.BindActorTemplates(actorTemplates);
|
||||
|
||||
var resourceTemplates = new List<ResourceTemplate>();
|
||||
|
||||
foreach (var a in Program.Rules.Actors["world"].Traits.WithInterface<ResourceTypeInfo>())
|
||||
{
|
||||
try
|
||||
{
|
||||
var template = RenderUtils.RenderResourceType(a, tileset, shadowedPalette);
|
||||
var ibox = new PictureBox
|
||||
{
|
||||
Image = template.Bitmap,
|
||||
Width = 32,
|
||||
Height = 32,
|
||||
SizeMode = PictureBoxSizeMode.Zoom,
|
||||
BorderStyle = BorderStyle.FixedSingle
|
||||
};
|
||||
|
||||
ibox.Click += (_, e) => surface1.SetTool(new ResourceTool(template));
|
||||
|
||||
resourcePalette.Controls.Add(ibox);
|
||||
|
||||
tt.SetToolTip(ibox, "{0}:{1}cr".F(template.Info.Name, template.Info.ValuePerUnit));
|
||||
|
||||
resourceTemplates.Add(template);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
surface1.BindResourceTemplates(resourceTemplates);
|
||||
|
||||
foreach (var p in palettes)
|
||||
{
|
||||
p.Visible = true;
|
||||
p.ResumeLayout();
|
||||
}
|
||||
|
||||
miniMapBox.Image = Minimap.RenderMapPreview(tileset, surface1.Map, true);
|
||||
|
||||
propertiesToolStripMenuItem.Enabled = true;
|
||||
toolStripMenuItemProperties.Enabled = true;
|
||||
resizeToolStripMenuItem.Enabled = true;
|
||||
toolStripMenuItemResize.Enabled = true;
|
||||
saveToolStripMenuItem.Enabled = true;
|
||||
toolStripMenuItemSave.Enabled = true;
|
||||
saveAsToolStripMenuItem.Enabled = true;
|
||||
miniMapToPng.Enabled = true;
|
||||
|
||||
PopulateActorOwnerChooser();
|
||||
}
|
||||
|
||||
void PopulateActorOwnerChooser()
|
||||
{
|
||||
actorOwnerChooser.Items.Clear();
|
||||
actorOwnerChooser.Items.AddRange(new MapPlayers(surface1.Map.PlayerDefinitions).Players.Values.ToArray());
|
||||
actorOwnerChooser.SelectedIndex = 0;
|
||||
surface1.NewActorOwner = ((PlayerReference)actorOwnerChooser.SelectedItem).Name;
|
||||
}
|
||||
|
||||
void ResizeClicked(object sender, EventArgs e)
|
||||
{
|
||||
using (var rd = new ResizeDialog())
|
||||
{
|
||||
rd.MapWidth.Value = surface1.Map.MapSize.X;
|
||||
rd.MapHeight.Value = surface1.Map.MapSize.Y;
|
||||
rd.CordonLeft.Value = surface1.Map.Bounds.Left;
|
||||
rd.CordonTop.Value = surface1.Map.Bounds.Top;
|
||||
rd.CordonRight.Value = surface1.Map.Bounds.Right;
|
||||
rd.CordonBottom.Value = surface1.Map.Bounds.Bottom;
|
||||
|
||||
if (DialogResult.OK != rd.ShowDialog())
|
||||
return;
|
||||
|
||||
surface1.Map.ResizeCordon((int)rd.CordonLeft.Value,
|
||||
(int)rd.CordonTop.Value,
|
||||
(int)rd.CordonRight.Value,
|
||||
(int)rd.CordonBottom.Value);
|
||||
|
||||
if ((int)rd.MapWidth.Value != surface1.Map.MapSize.X || (int)rd.MapHeight.Value != surface1.Map.MapSize.Y)
|
||||
{
|
||||
surface1.Map.Resize((int)rd.MapWidth.Value, (int)rd.MapHeight.Value);
|
||||
surface1.Bind(surface1.Map, surface1.TileSet, surface1.TileSetRenderer, surface1.Palette, surface1.PlayerPalette); // rebind it to invalidate all caches
|
||||
}
|
||||
|
||||
surface1.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
void SaveClicked(object sender, EventArgs e)
|
||||
{
|
||||
if (loadedMapName == null)
|
||||
SaveAsClicked(sender, e);
|
||||
else
|
||||
{
|
||||
surface1.Map.RequiresMod = currentMod;
|
||||
surface1.Map.Save(loadedMapName);
|
||||
dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
void SaveAsClicked(object sender, EventArgs e)
|
||||
{
|
||||
using (var nms = new MapSelect(currentMod))
|
||||
{
|
||||
nms.NewText.ReadOnly = false;
|
||||
nms.ButtonOkay.Text = "Save";
|
||||
nms.NewText.Text = "unnamed";
|
||||
nms.PathOutText.ReadOnly = false;
|
||||
|
||||
if (DialogResult.OK == nms.ShowDialog())
|
||||
{
|
||||
if (nms.NewText.Text == "")
|
||||
nms.NewText.Text = "unnamed";
|
||||
|
||||
// TODO: Allow the user to choose map format (directory vs oramap)
|
||||
loadedMapName = Path.Combine(nms.MapFolderPath, nms.NewText.Text + ".oramap");
|
||||
SaveClicked(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OpenClicked(object sender, EventArgs e)
|
||||
{
|
||||
using (var nms = new MapSelect(currentMod))
|
||||
{
|
||||
nms.NewText.ReadOnly = true;
|
||||
nms.PathOutText.ReadOnly = true;
|
||||
nms.ButtonOkay.Text = "Open";
|
||||
|
||||
if (DialogResult.OK == nms.ShowDialog())
|
||||
LoadMap((string)nms.NewText.Tag);
|
||||
}
|
||||
}
|
||||
|
||||
void NewClicked(object sender, EventArgs e)
|
||||
{
|
||||
using (var nmd = new NewMapDialog())
|
||||
{
|
||||
nmd.TheaterBox.Items.Clear();
|
||||
nmd.TheaterBox.Items.AddRange(Program.Rules.TileSets.Select(a => a.Value.Id).ToArray());
|
||||
nmd.TheaterBox.SelectedIndex = 0;
|
||||
|
||||
if (DialogResult.OK == nmd.ShowDialog())
|
||||
{
|
||||
var tileset = Program.Rules.TileSets[nmd.TheaterBox.SelectedItem as string];
|
||||
var map = Map.FromTileset(tileset);
|
||||
|
||||
map.Resize((int)nmd.MapWidth.Value, (int)nmd.MapHeight.Value);
|
||||
map.ResizeCordon((int)nmd.CordonLeft.Value, (int)nmd.CordonTop.Value,
|
||||
(int)nmd.CordonRight.Value, (int)nmd.CordonBottom.Value);
|
||||
|
||||
var players = new MapPlayers(map.Rules, map.SpawnPoints.Value.Length);
|
||||
map.PlayerDefinitions = players.ToMiniYaml();
|
||||
|
||||
map.FixOpenAreas(Program.Rules);
|
||||
|
||||
NewMap(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PropertiesClicked(object sender, EventArgs e)
|
||||
{
|
||||
using (var pd = new PropertiesDialog())
|
||||
{
|
||||
pd.TitleBox.Text = surface1.Map.Title;
|
||||
pd.DescBox.Text = surface1.Map.Description;
|
||||
pd.AuthorBox.Text = surface1.Map.Author;
|
||||
pd.MapVisibilityComboBox.SelectedIndex = pd.MapVisibilityComboBox.FindStringExact(Enum.GetName(typeof(MapVisibility), surface1.Map.Visibility));
|
||||
|
||||
if (DialogResult.OK != pd.ShowDialog())
|
||||
return;
|
||||
|
||||
surface1.Map.Title = pd.TitleBox.Text;
|
||||
surface1.Map.Description = pd.DescBox.Text;
|
||||
surface1.Map.Author = pd.AuthorBox.Text;
|
||||
surface1.Map.Visibility = (MapVisibility)Enum.Parse(typeof(MapVisibility), pd.MapVisibilityComboBox.SelectedItem.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) surface1.IsPanning = true; }
|
||||
void Form1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) surface1.IsPanning = false; }
|
||||
|
||||
void CloseClicked(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
void OnFormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (!dirty) return;
|
||||
|
||||
switch (MessageBox.Show("The map has been modified since it was last saved. " + "\r\n" + "Save changes now?",
|
||||
"Unsaved Changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation))
|
||||
{
|
||||
case DialogResult.Yes: SaveClicked(null, EventArgs.Empty); break;
|
||||
case DialogResult.No: break;
|
||||
case DialogResult.Cancel: e.Cancel = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
void ExportMinimap(object sender, EventArgs e)
|
||||
{
|
||||
using (var sfd = new SaveFileDialog()
|
||||
{
|
||||
InitialDirectory = Path.Combine(Environment.CurrentDirectory, "maps"),
|
||||
DefaultExt = "*.png",
|
||||
Filter = "PNG Image (*.png)|*.png",
|
||||
Title = "Export Minimap to PNG",
|
||||
FileName = Path.ChangeExtension(loadedMapName, ".png"),
|
||||
RestoreDirectory = true
|
||||
})
|
||||
if (DialogResult.OK == sfd.ShowDialog())
|
||||
miniMapBox.Image.Save(sfd.FileName);
|
||||
}
|
||||
|
||||
void ShowActorNamesClicked(object sender, EventArgs e)
|
||||
{
|
||||
showActorNamesToolStripMenuItem.Checked ^= true;
|
||||
toolStripMenuItemShowActorNames.Checked ^= true;
|
||||
surface1.ShowActorNames = showActorNamesToolStripMenuItem.Checked;
|
||||
}
|
||||
|
||||
void ShowGridClicked(object sender, EventArgs e)
|
||||
{
|
||||
showGridToolStripMenuItem.Checked ^= true;
|
||||
toolStripMenuItemShowGrid.Checked ^= true;
|
||||
surface1.ShowGrid = showGridToolStripMenuItem.Checked;
|
||||
surface1.Chunks.Clear();
|
||||
}
|
||||
|
||||
void FixOpenAreas(object sender, EventArgs e)
|
||||
{
|
||||
dirty = true;
|
||||
surface1.Map.FixOpenAreas(Program.Rules);
|
||||
surface1.Chunks.Clear();
|
||||
surface1.Invalidate();
|
||||
}
|
||||
|
||||
void SetupDefaultPlayers(object sender, EventArgs e)
|
||||
{
|
||||
dirty = true;
|
||||
var players = new MapPlayers(surface1.Map.Rules, surface1.Map.SpawnPoints.Value.Length);
|
||||
surface1.Map.PlayerDefinitions = players.ToMiniYaml();
|
||||
|
||||
surface1.Chunks.Clear();
|
||||
surface1.Invalidate();
|
||||
|
||||
PopulateActorOwnerChooser();
|
||||
}
|
||||
|
||||
void DrawPlayerListItem(object sender, DrawItemEventArgs e)
|
||||
{
|
||||
// color block
|
||||
var player = e.Index >= 0 ? (PlayerReference)((ComboBox)sender).Items[e.Index] : null;
|
||||
|
||||
e.DrawBackground();
|
||||
e.DrawFocusRectangle();
|
||||
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
var color = player.Color.RGB;
|
||||
using (var brush = new SolidBrush(color))
|
||||
e.Graphics.FillRectangle(brush, e.Bounds.Left + 2, e.Bounds.Top + 2, e.Bounds.Height + 6, e.Bounds.Height - 4);
|
||||
using (var foreBrush = new SolidBrush(e.ForeColor))
|
||||
e.Graphics.DrawString(player.Name, e.Font, foreBrush, e.Bounds.Left + e.Bounds.Height + 12, e.Bounds.Top);
|
||||
}
|
||||
|
||||
void OnSelectedPlayerChanged(object sender, EventArgs e)
|
||||
{
|
||||
var player = actorOwnerChooser.SelectedItem as PlayerReference;
|
||||
surface1.NewActorOwner = player.Name;
|
||||
}
|
||||
|
||||
void CopySelectionToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
surface1.CopySelection();
|
||||
}
|
||||
|
||||
void OpenRAWebsiteToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://www.openra.net");
|
||||
}
|
||||
|
||||
void OpenRAResourcesToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://resource.openra.net");
|
||||
}
|
||||
|
||||
void WikiDocumentationToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://wiki.openra.net");
|
||||
}
|
||||
|
||||
void DiscussionForumsToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://www.sleipnirstuff.com/forum/viewforum.php?f=80");
|
||||
}
|
||||
|
||||
void IssueTrackerToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://bugs.openra.net");
|
||||
}
|
||||
|
||||
void DeveloperBountiesToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://www.bountysource.com/trackers/36085-openra");
|
||||
}
|
||||
|
||||
void SourceCodeToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://github.com/OpenRA/OpenRA");
|
||||
}
|
||||
|
||||
void AboutToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
MessageBox.Show(
|
||||
"OpenRA and OpenRA Editor are Free/Libre Open Source Software released under the GNU General Public License version 3. See AUTHORS and COPYING for details.",
|
||||
"About",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Asterisk);
|
||||
}
|
||||
|
||||
void HelpToolStripButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://wiki.openra.net/Mapping");
|
||||
}
|
||||
|
||||
void ToolStripMenuItemNewClick(object sender, EventArgs e)
|
||||
{
|
||||
NewClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemOpenClick(object sender, EventArgs e)
|
||||
{
|
||||
OpenClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemSaveClick(object sender, EventArgs e)
|
||||
{
|
||||
SaveClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemPropertiesClick(object sender, EventArgs e)
|
||||
{
|
||||
PropertiesClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemResizeClick(object sender, EventArgs e)
|
||||
{
|
||||
ResizeClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemShowActorNamesClick(object sender, EventArgs e)
|
||||
{
|
||||
ShowActorNamesClicked(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemFixOpenAreasClick(object sender, EventArgs e)
|
||||
{
|
||||
FixOpenAreas(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemSetupDefaultPlayersClick(object sender, EventArgs e)
|
||||
{
|
||||
SetupDefaultPlayers(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemCopySelectionClick(object sender, EventArgs e)
|
||||
{
|
||||
CopySelectionToolStripMenuItemClick(sender, e);
|
||||
}
|
||||
|
||||
void ToolStripMenuItemShowGridClick(object sender, EventArgs e)
|
||||
{
|
||||
ShowGridClicked(sender, e);
|
||||
}
|
||||
|
||||
public int CalculateTotalResource()
|
||||
{
|
||||
var totalResource = 0;
|
||||
for (var i = 0; i < surface1.Map.MapSize.X; i++)
|
||||
for (var j = 0; j < surface1.Map.MapSize.Y; j++)
|
||||
{
|
||||
var cell = new CPos(i, j);
|
||||
if (surface1.Map.MapResources.Value[cell].Type != 0)
|
||||
totalResource += GetResourceValue(i, j);
|
||||
}
|
||||
|
||||
return totalResource;
|
||||
}
|
||||
|
||||
int GetAdjecentCellsWith(int resourceType, int x, int y)
|
||||
{
|
||||
var sum = 0;
|
||||
for (var u = -1; u < 2; u++)
|
||||
for (var v = -1; v < 2; v++)
|
||||
{
|
||||
var cell = new CPos(x + u, y + v);
|
||||
|
||||
if (!surface1.Map.Contains(cell))
|
||||
continue;
|
||||
|
||||
if (surface1.Map.MapResources.Value[cell].Type == resourceType)
|
||||
++sum;
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
int GetResourceValue(int x, int y)
|
||||
{
|
||||
var imageLength = 0;
|
||||
var type = surface1.Map.MapResources.Value[new CPos(x, y)].Type;
|
||||
var template = surface1.ResourceTemplates.FirstOrDefault(a => a.Value.Info.ResourceType == type).Value;
|
||||
if (type == 1)
|
||||
imageLength = 12;
|
||||
else if (type == 2)
|
||||
imageLength = 3;
|
||||
var density = (GetAdjecentCellsWith(type, x, y) * imageLength - 1) / 9;
|
||||
var value = template.Info.ValuePerUnit;
|
||||
return density * value;
|
||||
}
|
||||
|
||||
void ZoomInToolStripButtonClick(object sender, System.EventArgs e)
|
||||
{
|
||||
if (surface1.Map == null) return;
|
||||
|
||||
surface1.Zoom /= .75f;
|
||||
|
||||
surface1.Invalidate();
|
||||
}
|
||||
|
||||
void ZoomOutToolStripButtonClick(object sender, System.EventArgs e)
|
||||
{
|
||||
if (surface1.Map == null) return;
|
||||
|
||||
surface1.Zoom *= .75f;
|
||||
|
||||
surface1.Invalidate();
|
||||
}
|
||||
|
||||
void PanToolStripButtonClick(object sender, System.EventArgs e)
|
||||
{
|
||||
panToolStripButton.Checked ^= true;
|
||||
surface1.IsPanning = panToolStripButton.Checked;
|
||||
}
|
||||
|
||||
void ShowRulerToolStripMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
showRulerToolStripMenuItem.Checked ^= true;
|
||||
showRulerToolStripItem.Checked ^= true;
|
||||
surface1.ShowRuler = showRulerToolStripMenuItem.Checked;
|
||||
surface1.Chunks.Clear();
|
||||
}
|
||||
|
||||
void ShowRulerToolStripItemClick(object sender, System.EventArgs e)
|
||||
{
|
||||
ShowRulerToolStripMenuItemClick(sender, e);
|
||||
}
|
||||
|
||||
void EraserToolStripButtonClick(object sender, System.EventArgs e)
|
||||
{
|
||||
eraserToolStripButton.Checked ^= true;
|
||||
surface1.IsErasing = eraserToolStripButton.Checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,20 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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 SGraphics = System.Drawing.Graphics;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
interface ITool
|
||||
{
|
||||
void Apply(Surface surface);
|
||||
void Preview(Surface surface, SGraphics g);
|
||||
}
|
||||
}
|
||||
319
OpenRA.Editor/MapSelect.Designer.cs
generated
319
OpenRA.Editor/MapSelect.Designer.cs
generated
@@ -1,319 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
partial class MapSelect
|
||||
{
|
||||
// TODO:
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
// TODO:
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
// TODO:
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MapSelect));
|
||||
this.MapList = new System.Windows.Forms.ListView();
|
||||
this.ColumnMapName = new System.Windows.Forms.ColumnHeader("(none)");
|
||||
this.MapIconsList = new System.Windows.Forms.ImageList(this.components);
|
||||
this.ButtonCancel = new System.Windows.Forms.Button();
|
||||
this.ButtonOkay = new System.Windows.Forms.Button();
|
||||
this.NewLabel = new System.Windows.Forms.Label();
|
||||
this.NewText = new System.Windows.Forms.TextBox();
|
||||
this.MiniMapBox = new System.Windows.Forms.PictureBox();
|
||||
this.BottomPanel = new System.Windows.Forms.Panel();
|
||||
this.PathOutText = new System.Windows.Forms.TextBox();
|
||||
this.PathOutLabel = new System.Windows.Forms.Label();
|
||||
this.PathLabel = new System.Windows.Forms.Label();
|
||||
this.SplitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.MapListLabel = new System.Windows.Forms.Label();
|
||||
this.DescTxt = new System.Windows.Forms.TextBox();
|
||||
this.DescLabel = new System.Windows.Forms.Label();
|
||||
this.TheaterText = new System.Windows.Forms.TextBox();
|
||||
this.TheaterLabel = new System.Windows.Forms.Label();
|
||||
this.AuthorText = new System.Windows.Forms.TextBox();
|
||||
this.AuthorLabel = new System.Windows.Forms.Label();
|
||||
this.TitleText = new System.Windows.Forms.TextBox();
|
||||
this.MapNameLabel = new System.Windows.Forms.Label();
|
||||
this.MiniMapLabel = new System.Windows.Forms.Label();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)this.MiniMapBox).BeginInit();
|
||||
this.BottomPanel.SuspendLayout();
|
||||
this.SplitContainer1.Panel1.SuspendLayout();
|
||||
this.SplitContainer1.Panel2.SuspendLayout();
|
||||
this.SplitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit();
|
||||
this.SuspendLayout();
|
||||
|
||||
this.MapList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.MapList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.ColumnMapName });
|
||||
this.MapList.FullRowSelect = true;
|
||||
this.MapList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
|
||||
this.MapList.LargeImageList = this.MapIconsList;
|
||||
this.MapList.Location = new System.Drawing.Point(15, 25);
|
||||
this.MapList.MultiSelect = false;
|
||||
this.MapList.Name = "MapList";
|
||||
this.MapList.Size = new System.Drawing.Size(273, 294);
|
||||
this.MapList.SmallImageList = this.MapIconsList;
|
||||
this.MapList.StateImageList = this.MapIconsList;
|
||||
this.MapList.TabIndex = 0;
|
||||
this.MapList.UseCompatibleStateImageBehavior = false;
|
||||
this.MapList.View = System.Windows.Forms.View.Details;
|
||||
this.MapList.SelectedIndexChanged += new System.EventHandler(this.MapList_SelectedIndexChanged);
|
||||
|
||||
this.ColumnMapName.Text = "Map name";
|
||||
this.ColumnMapName.Width = 240;
|
||||
|
||||
this.MapIconsList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
|
||||
this.MapIconsList.ImageSize = new System.Drawing.Size(24, 24);
|
||||
this.MapIconsList.TransparentColor = System.Drawing.Color.Transparent;
|
||||
|
||||
this.ButtonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.ButtonCancel.Location = new System.Drawing.Point(407, 35);
|
||||
this.ButtonCancel.Name = "btnCancel";
|
||||
this.ButtonCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.ButtonCancel.TabIndex = 3;
|
||||
this.ButtonCancel.Text = "Cancel";
|
||||
this.ButtonCancel.UseVisualStyleBackColor = true;
|
||||
|
||||
this.ButtonOkay.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.ButtonOkay.Location = new System.Drawing.Point(326, 35);
|
||||
this.ButtonOkay.Name = "btnOk";
|
||||
this.ButtonOkay.Size = new System.Drawing.Size(75, 23);
|
||||
this.ButtonOkay.TabIndex = 2;
|
||||
this.ButtonOkay.Text = "Open";
|
||||
this.ButtonOkay.UseVisualStyleBackColor = true;
|
||||
|
||||
this.NewLabel.AutoSize = true;
|
||||
this.NewLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)204);
|
||||
this.NewLabel.Location = new System.Drawing.Point(12, 40);
|
||||
this.NewLabel.Name = "lblNew";
|
||||
this.NewLabel.Size = new System.Drawing.Size(69, 13);
|
||||
this.NewLabel.TabIndex = 3;
|
||||
this.NewLabel.Text = "Map name:";
|
||||
|
||||
this.NewText.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.NewText.Location = new System.Drawing.Point(88, 37);
|
||||
this.NewText.Name = "txtNew";
|
||||
this.NewText.ReadOnly = true;
|
||||
this.NewText.Size = new System.Drawing.Size(232, 20);
|
||||
this.NewText.TabIndex = 1;
|
||||
|
||||
this.MiniMapBox.BackColor = System.Drawing.Color.Black;
|
||||
this.MiniMapBox.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.MiniMapBox.Location = new System.Drawing.Point(32, 25);
|
||||
this.MiniMapBox.Name = "pbMinimap";
|
||||
this.MiniMapBox.Size = new System.Drawing.Size(124, 124);
|
||||
this.MiniMapBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.MiniMapBox.TabIndex = 5;
|
||||
this.MiniMapBox.TabStop = false;
|
||||
|
||||
this.BottomPanel.Controls.Add(this.pictureBox1);
|
||||
this.BottomPanel.Controls.Add(this.PathOutText);
|
||||
this.BottomPanel.Controls.Add(this.PathOutLabel);
|
||||
this.BottomPanel.Controls.Add(this.PathLabel);
|
||||
this.BottomPanel.Controls.Add(this.ButtonCancel);
|
||||
this.BottomPanel.Controls.Add(this.ButtonOkay);
|
||||
this.BottomPanel.Controls.Add(this.NewText);
|
||||
this.BottomPanel.Controls.Add(this.NewLabel);
|
||||
this.BottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.BottomPanel.Location = new System.Drawing.Point(0, 332);
|
||||
this.BottomPanel.MaximumSize = new System.Drawing.Size(0, 70);
|
||||
this.BottomPanel.Name = "pnlBottom";
|
||||
this.BottomPanel.Size = new System.Drawing.Size(494, 70);
|
||||
this.BottomPanel.TabIndex = 6;
|
||||
|
||||
this.PathOutText.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.PathOutText.Location = new System.Drawing.Point(55, 10);
|
||||
this.PathOutText.Name = "txtPathOut";
|
||||
this.PathOutText.ReadOnly = true;
|
||||
this.PathOutText.Size = new System.Drawing.Size(265, 20);
|
||||
this.PathOutText.TabIndex = 0;
|
||||
this.PathOutText.TextChanged += new System.EventHandler(this.PathOutTextChanged);
|
||||
|
||||
this.PathOutLabel.AutoSize = true;
|
||||
this.PathOutLabel.Location = new System.Drawing.Point(55, 13);
|
||||
this.PathOutLabel.Name = "lblPathOut";
|
||||
this.PathOutLabel.Size = new System.Drawing.Size(0, 13);
|
||||
this.PathOutLabel.TabIndex = 6;
|
||||
|
||||
this.PathLabel.AutoSize = true;
|
||||
this.PathLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (byte)204);
|
||||
this.PathLabel.Location = new System.Drawing.Point(12, 13);
|
||||
this.PathLabel.Name = "lblPath";
|
||||
this.PathLabel.Size = new System.Drawing.Size(37, 13);
|
||||
this.PathLabel.TabIndex = 5;
|
||||
this.PathLabel.Text = "Path:";
|
||||
|
||||
this.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.SplitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.SplitContainer1.Name = "splitContainer1";
|
||||
|
||||
this.SplitContainer1.Panel1.Controls.Add(this.MapListLabel);
|
||||
this.SplitContainer1.Panel1.Controls.Add(this.MapList);
|
||||
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.DescTxt);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.DescLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.TheaterText);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.TheaterLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.AuthorText);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.AuthorLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.TitleText);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.MapNameLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.MiniMapLabel);
|
||||
this.SplitContainer1.Panel2.Controls.Add(this.MiniMapBox);
|
||||
this.SplitContainer1.Size = new System.Drawing.Size(494, 332);
|
||||
this.SplitContainer1.SplitterDistance = 300;
|
||||
this.SplitContainer1.TabIndex = 7;
|
||||
|
||||
this.MapListLabel.AutoSize = true;
|
||||
this.MapListLabel.Location = new System.Drawing.Point(12, 9);
|
||||
this.MapListLabel.Name = "lblMapList";
|
||||
this.MapListLabel.Size = new System.Drawing.Size(81, 13);
|
||||
this.MapListLabel.TabIndex = 1;
|
||||
this.MapListLabel.Text = "Available maps:";
|
||||
|
||||
this.DescTxt.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.DescTxt.Location = new System.Drawing.Point(16, 289);
|
||||
this.DescTxt.Name = "txtDesc";
|
||||
this.DescTxt.ReadOnly = true;
|
||||
this.DescTxt.Size = new System.Drawing.Size(162, 20);
|
||||
this.DescTxt.TabIndex = 14;
|
||||
|
||||
this.DescLabel.AutoSize = true;
|
||||
this.DescLabel.Location = new System.Drawing.Point(13, 273);
|
||||
this.DescLabel.Name = "lblDesc";
|
||||
this.DescLabel.Size = new System.Drawing.Size(63, 13);
|
||||
this.DescLabel.TabIndex = 13;
|
||||
this.DescLabel.Text = "Description:";
|
||||
|
||||
this.TheaterText.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.TheaterText.Location = new System.Drawing.Point(16, 252);
|
||||
this.TheaterText.Name = "txtTheater";
|
||||
this.TheaterText.ReadOnly = true;
|
||||
this.TheaterText.Size = new System.Drawing.Size(162, 20);
|
||||
this.TheaterText.TabIndex = 12;
|
||||
|
||||
this.TheaterLabel.AutoSize = true;
|
||||
this.TheaterLabel.Location = new System.Drawing.Point(13, 236);
|
||||
this.TheaterLabel.Name = "lblTheater";
|
||||
this.TheaterLabel.Size = new System.Drawing.Size(47, 13);
|
||||
this.TheaterLabel.TabIndex = 11;
|
||||
this.TheaterLabel.Text = "Tileset:";
|
||||
|
||||
this.AuthorText.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.AuthorText.Location = new System.Drawing.Point(16, 214);
|
||||
this.AuthorText.Name = "txtAuthor";
|
||||
this.AuthorText.ReadOnly = true;
|
||||
this.AuthorText.Size = new System.Drawing.Size(162, 20);
|
||||
this.AuthorText.TabIndex = 10;
|
||||
|
||||
this.AuthorLabel.AutoSize = true;
|
||||
this.AuthorLabel.Location = new System.Drawing.Point(13, 198);
|
||||
this.AuthorLabel.Name = "lblAuthor";
|
||||
this.AuthorLabel.Size = new System.Drawing.Size(41, 13);
|
||||
this.AuthorLabel.TabIndex = 9;
|
||||
this.AuthorLabel.Text = "Author:";
|
||||
|
||||
this.TitleText.BackColor = System.Drawing.SystemColors.ButtonFace;
|
||||
this.TitleText.Location = new System.Drawing.Point(16, 177);
|
||||
this.TitleText.Name = "txtTitle";
|
||||
this.TitleText.ReadOnly = true;
|
||||
this.TitleText.Size = new System.Drawing.Size(162, 20);
|
||||
this.TitleText.TabIndex = 8;
|
||||
|
||||
this.MapNameLabel.AutoSize = true;
|
||||
this.MapNameLabel.Location = new System.Drawing.Point(13, 161);
|
||||
this.MapNameLabel.Name = "lblMapName";
|
||||
this.MapNameLabel.Size = new System.Drawing.Size(30, 13);
|
||||
this.MapNameLabel.TabIndex = 7;
|
||||
this.MapNameLabel.Text = "Title:";
|
||||
|
||||
this.MiniMapLabel.AutoSize = true;
|
||||
this.MiniMapLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)204);
|
||||
this.MiniMapLabel.Location = new System.Drawing.Point(29, 9);
|
||||
this.MiniMapLabel.Name = "lblMinimap";
|
||||
this.MiniMapLabel.Size = new System.Drawing.Size(71, 13);
|
||||
this.MiniMapLabel.TabIndex = 6;
|
||||
this.MiniMapLabel.Text = "Map preview:";
|
||||
|
||||
this.pictureBox1.Image = (System.Drawing.Image)resources.GetObject("pictureBox1.Image");
|
||||
this.pictureBox1.Location = new System.Drawing.Point(336, -9);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(54, 35);
|
||||
this.pictureBox1.TabIndex = 7;
|
||||
this.pictureBox1.TabStop = false;
|
||||
this.pictureBox1.Visible = false;
|
||||
|
||||
this.AcceptButton = this.ButtonOkay;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.ButtonCancel;
|
||||
this.ClientSize = new System.Drawing.Size(494, 402);
|
||||
this.Controls.Add(this.SplitContainer1);
|
||||
this.Controls.Add(this.BottomPanel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MapSelect";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Select map";
|
||||
this.Load += new System.EventHandler(this.MapSelect_Load);
|
||||
((System.ComponentModel.ISupportInitialize)this.MiniMapBox).EndInit();
|
||||
this.BottomPanel.ResumeLayout(false);
|
||||
this.BottomPanel.PerformLayout();
|
||||
this.SplitContainer1.Panel1.ResumeLayout(false);
|
||||
this.SplitContainer1.Panel1.PerformLayout();
|
||||
this.SplitContainer1.Panel2.ResumeLayout(false);
|
||||
this.SplitContainer1.Panel2.PerformLayout();
|
||||
this.SplitContainer1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
public System.Windows.Forms.ListView MapList;
|
||||
public System.Windows.Forms.Button ButtonCancel;
|
||||
public System.Windows.Forms.Button ButtonOkay;
|
||||
public System.Windows.Forms.Label NewLabel;
|
||||
public System.Windows.Forms.TextBox NewText;
|
||||
public System.Windows.Forms.ColumnHeader ColumnMapName;
|
||||
public System.Windows.Forms.ImageList MapIconsList;
|
||||
public System.Windows.Forms.PictureBox MiniMapBox;
|
||||
public System.Windows.Forms.Panel BottomPanel;
|
||||
public System.Windows.Forms.SplitContainer SplitContainer1;
|
||||
public System.Windows.Forms.Label MiniMapLabel;
|
||||
public System.Windows.Forms.TextBox TheaterText;
|
||||
public System.Windows.Forms.Label TheaterLabel;
|
||||
public System.Windows.Forms.TextBox AuthorText;
|
||||
public System.Windows.Forms.Label AuthorLabel;
|
||||
public System.Windows.Forms.TextBox TitleText;
|
||||
public System.Windows.Forms.Label MapNameLabel;
|
||||
public System.Windows.Forms.TextBox DescTxt;
|
||||
public System.Windows.Forms.Label DescLabel;
|
||||
public System.Windows.Forms.Label MapListLabel;
|
||||
public System.Windows.Forms.Label PathOutLabel;
|
||||
public System.Windows.Forms.Label PathLabel;
|
||||
public System.Windows.Forms.TextBox PathOutText;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
public partial class MapSelect : Form
|
||||
{
|
||||
public string MapFolderPath;
|
||||
|
||||
public bool DirectoryIsEmpty(string path)
|
||||
{
|
||||
return !Directory.GetFileSystemEntries(path).Any();
|
||||
}
|
||||
|
||||
public MapSelect(string currentMod)
|
||||
{
|
||||
MapFolderPath = Platform.ResolvePath("^", "maps", currentMod);
|
||||
|
||||
if (!Directory.Exists(MapFolderPath))
|
||||
Directory.CreateDirectory(MapFolderPath);
|
||||
|
||||
InitializeComponent();
|
||||
MapIconsList.Images.Add(pictureBox1.Image);
|
||||
}
|
||||
|
||||
void MapSelect_Load(object sender, EventArgs e)
|
||||
{
|
||||
MapList.Items.Clear();
|
||||
PathOutText.Text = MapFolderPath;
|
||||
|
||||
if (DirectoryIsEmpty(MapFolderPath))
|
||||
return;
|
||||
|
||||
foreach (var map in MapCache.FindMapsIn(MapFolderPath))
|
||||
{
|
||||
var map1 = new ListViewItem();
|
||||
map1.Tag = map;
|
||||
map1.Text = Path.GetFileNameWithoutExtension(map);
|
||||
map1.ImageIndex = 0;
|
||||
MapList.Items.Add(map1);
|
||||
}
|
||||
|
||||
// hack
|
||||
if (NewText.Text != "unnamed")
|
||||
MapList.Items[0].Selected = true;
|
||||
}
|
||||
|
||||
void MapList_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (MapList.SelectedItems.Count == 1)
|
||||
{
|
||||
NewText.Text = MapList.SelectedItems[0].Text;
|
||||
NewText.Tag = MapList.SelectedItems[0].Tag;
|
||||
|
||||
var map = new Map((string)NewText.Tag);
|
||||
TitleText.Text = map.Title;
|
||||
AuthorText.Text = map.Author;
|
||||
TheaterText.Text = map.Tileset;
|
||||
DescTxt.Text = map.Description;
|
||||
MiniMapBox.Image = null;
|
||||
|
||||
try
|
||||
{
|
||||
var tileset = Program.Rules.TileSets[map.Tileset];
|
||||
MiniMapBox.Image = Minimap.RenderMapPreview(tileset, map, true);
|
||||
}
|
||||
catch (Exception ed)
|
||||
{
|
||||
Console.WriteLine("No map preview image found: {0}", ed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PathOutTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
MapFolderPath = PathOutText.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="MapIconsList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAArjSURBVFhHrVcJUFRXFmVpkE0Wg0ZEMoIBl8RodGSMmVES
|
||||
R0NiChVxCyIIAmFfhe6maeh9AZodZHFpUFQWcQmKisiuLKLEKFFEcIuljtZMYmI5Uc/c14EZYyapmpq8
|
||||
qlP/9/+/373v3HPu+19P7/cf+jSlEWHCOEuzZfNn2Yvo3Pj3D/PTjCwYAwtgyeFwFk163Tos2tvtWJZw
|
||||
zeUjmYFP6vL9fhw31vRPI8/9LnmMrtCWZhtPcJ7hbC/W8DwfnS0LR0t5NKoFazHcqsaprE3YGbMQLrYW
|
||||
W/7fBAxogjGEd5wcXuPK4jxa60qD75VrfIbKMrYMD7VlPX/Ul49rp8RoyPbFIaEnhpuU6NRGoVa2HKuX
|
||||
zEj/X8vAVmlIsDY2Nna2sjBd+ee5b7Yq4tfgfm8a7pxNw60OFa6e4uFmhxr/uFSIexfz0VsZh7PaIJzb
|
||||
F42u8hAcV2/ANz3KF8Hub52kucb+Fv+jAccbm5quWOfxYX5y6Mcnq/IDh1oreX/vOcx9drdbjTudUgye
|
||||
Tsb1piT0H4/DACUw0JiEh33ZePhlFi7UxOCLtI1o2x6IW2cUqM/egLtdediV9MnjSTYm60bE+Ys8rMzN
|
||||
zd1c3/vLgVRV3lN1XjkqyzNoNaEUjIvrLXwMtQsw1JqEy/UxuHg0DJcp+KXj8bh0IobOucSGDA8vpqE6
|
||||
+VNINixBU0kQbp5JJ8jxDSXdeyAE5arlAxTZ/BfRra2tS8Tqwh9L9tQhq6gSabm7odLkoP8oF90V/rjR
|
||||
LsRgExc32oS40ZFCiQgw2Mgj+gW42pBI4OPSsUh6Jgn1mX4ojXJH865IXDzCx50uDe6fV+P8oQQ4Tx6r
|
||||
pOATmVteKgdjXu/Mhk1h328rO4TMwn3gp2YhmquEX7gAfYfjcb4qGH0HQ3D5WAiunU7ApfpofH0ymhIS
|
||||
UwkSqQRb6VoYvm6IZvXG7W4VBVbjwQU1/tanIQZkGDqtwOmSjzHXxXaLsZnZpy85QpdAnfunax/mllRD
|
||||
ma2FQJyHxORMJAqzwBVpUJgtRLF8E7bxlqKjzA991QEYaIijgFwMt6VggJK60hCFr46F4sqprbjbLaf6
|
||||
S0icIh1rwy1i3OvNQff+GEgj3r87/c1JLIGfjX1LP/F6KJDlIy1vN4SyQohVRdAU7IVIXQxuSiZ8/OOw
|
||||
JYyP8EiqfV04Lh2JoHIwMSbiwoFgtO1ah97aTSTMKGIjDl/WhONWl5jKlYrbZ9OJGRWVIg/+axf8SK5a
|
||||
8WoC5fPm//l2qqIIOaVVECm3QZG5C7L0HZCklYJLTCQKNUiWFYAnykJYRDRaywNxrTGRyhKNKyciiIEY
|
||||
dFd743z1ZioT6eJkHK41kXDbRFSKbHzTpcJwsxoHc71fTLGzyBix+L/zUFlaWX+VTcFZ4NzSamQXV1Lw
|
||||
EggkeeBRAsnSfKgyy6DKKcNnxEahIgRfHg5B/7EoDDYn4ma7FD0VAThfG4Cemi3EDI90IKWVq3GbHHKz
|
||||
nUpCbrh6QokEr5mPTEw4773MQij9aPZY5fNYrC6hEhRAnrkTjJEkcS5ieWokS/IhUZdCrtlJbGQiIjQQ
|
||||
/YeD0VMVhoTVbmgs8iVBctG11xtdlUHkDGpQpIN7velUAhmG2+W43spclI6K9JWY6TyxlGKOGxWjG53s
|
||||
5HBMBpZ7+iI6UY44vhoiVTH4ohxCLoTyArqu1OlBll6CZHE20mI9EOjuis3L5uFCbTh6D4Wgu8offYeC
|
||||
qSRccgcPD/qyMEiBb55VYahFgSuNckhjlr2YaGMqH2ntOiKmEAQGBgbnNviGPg2LFSM4UoiAUD78ghLo
|
||||
yEVojBhRiQqEx0nAI5sKiBH/z+OgVfuic7c/Lh+NwZndfughDfQdCtL1hKFmEW51ymn1EjpSAh1ytFCL
|
||||
Pl+nhKebY8XLTYn16DWEgzY2ttdzyI6yjB06+uP4acRANokvhzRRjBR5oe4aN4WupeYgNCIWZ2vj0b17
|
||||
I/UKf3Tt34jOis9otTyyILmkORUDTRKyqxj9DSI07Y0k26Yhes38Roo3YVQH7OVhGiGR0K7O0epEqCRB
|
||||
shKwRIQkQrZqMelAIM6ncihII9uQSCXZEi2HSMjDXvVqXKSGdTLbg6z6OVkwGcfLQvHB4jkYbJMS/UL0
|
||||
1aeSM6So1Hg/oljTR93AupEVYSXhGE+soZa8X+cIlgALzFhg5/HJ6YhIzACXVs9EKiHRMmckSfMQGx0G
|
||||
rXIldU4/dJSvJx3EoSDZC7OszHByTxTOfZGEq00y9B3lo70iElamhp4Ujy1eN8wIrEOd0BRW6DpiWEwq
|
||||
giKSdYiIl5IOUskRKh39AmKECZNP7Mg0O6Ci59Pzd4O/NQK7FBvQULyGOmMUpBsX4KqjGTL5qzHQIqJy
|
||||
iNG6Px5dtYlY7jqhmeKxvUE32C7FGKiP58uf5W6v0ekgPkmNrYIMor4YqcoinQBFdGQrl2ZsB4/cwBJR
|
||||
Zml/+k0sxcQnQZzgDWHIIni9NQHSHU5IS15EPSEN11ok6G9UQs1dh/lvv/GdkZHR3NEETOhkIUE7zvb1
|
||||
wRRFwYv0vD3UBTORJCEdSHMhydgFCXVHVnuWEGvZrDewjqmzKbHDNjHmFl5KBlasWokiFwtop5nhyL6p
|
||||
2JO/CN2HBdSgMpHJ88GH82c8s7b4T1vmUPA3CFxCp19QzBPdtpxdRqon2kkDKRSYXeOJcyBUFMI7IJ70
|
||||
kYsEgRLTXGbgrzNnwmWqC2Y4OsLZZjx43El4ggXI1zohy24MAFd4u9tj8YLpmD71DTiMtwGHY1A7ygB7
|
||||
52N29CLULV7qeT+HnFCoPairu87/RC9rTjE8JYJoY/p4lR8lVQAp7Rc+/pHY7OKE61NN8a21MbQpfwC+
|
||||
m4fbQ7MQNdcCfWMMsTPWDi2yyRgyNkDhOGPYGhpeo97jP5oAcwJjYQ4hk3DOyzvwn9v3HtUJjHXAzSFc
|
||||
RHHlCAznIyAsCZa2k56u3xT2gtHPmGHCdXtnHh47mKBqjS1K5Q7ITrCjlf8RqXPM0bDUCr3bp2C9nj70
|
||||
DDinKMYSwmujCbAjY4G9ZrN3tyMLP/D4IT1vP/J21CBeoKaa55MTUhAeK8J7i91v0DMdxqZmgw7Oc74N
|
||||
iFQ8T5YX6ZzisWI9Uiebo8rKCOcsjLAv1Z72BydUxE5ElcTuKf2P9RunEeGzmD8bTIzsI0I7wc7xdgyf
|
||||
NiayWVoueZ1qz7zPT8l5McnBqZieYZsYO/a4zF7yaKWP4HlASMKLj9xX4WrXWzhdMxUFlkaI1tPDAZE9
|
||||
Htc4wWuhOas5Y/oXgUezYDdZdmK2N6zzCfuB1V1GFkulNswT5cFllms73f+QMIWwjCDjGJnUW1rbfu2z
|
||||
wvXJk85pUH5gieNJdugvd8QV7RSc0TjgiMwevkvH3np1xa/+ZplZE9jecNh14UcPmO8VmnLyfzGr/feU
|
||||
mB/dY7VjybItdSZhrb6+fvEYY6PuMWOMn7ZbGeILfQNYmnN+mO1o/OBdCw74HAMsMjR8NjL/r+Yx+p3H
|
||||
XhjKZs93uxMZr4Z/uOb54qWf3bGf4pw3EpC1UPYsS3g0EU9K4uBsI86zYHPOY3MOp4zuRRLyDfT1O941
|
||||
Mrzvb86Bob4h+0r6zcEmdiFICA2vvT55kLFBYOJhnYt9or06TOmCJ7HTbGxgADpndmaJMU29QxAQKvTo
|
||||
vhnHkN1nX12/OlgCNoT3CZsIvgRWc9ao2IT/bTD3+BID7N1/zisBWCKOBB/CagKf8PboJP8CoUmu3yhA
|
||||
ga8AAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
295
OpenRA.Editor/NewMapDialog.Designer.cs
generated
295
OpenRA.Editor/NewMapDialog.Designer.cs
generated
@@ -1,295 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
partial class NewMapDialog
|
||||
{
|
||||
/// <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.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.CordonBottom = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonTop = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonRight = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonLeft = new System.Windows.Forms.NumericUpDown();
|
||||
this.MapHeight = new System.Windows.Forms.NumericUpDown();
|
||||
this.MapWidth = new System.Windows.Forms.NumericUpDown();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.TheaterBox = new System.Windows.Forms.ComboBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonBottom)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonTop)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonRight)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonLeft)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapHeight)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapWidth)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.button2.Location = new System.Drawing.Point(229, 160);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 7;
|
||||
this.button2.Text = "OK";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.button1.Location = new System.Drawing.Point(310, 160);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 8;
|
||||
this.button1.Text = "Cancel";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(31, 77);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(107, 13);
|
||||
this.label3.TabIndex = 9;
|
||||
this.label3.Text = "Cordon Right/Bottom";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(31, 51);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(86, 13);
|
||||
this.label2.TabIndex = 11;
|
||||
this.label2.Text = "Cordon Left/Top";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(31, 25);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(27, 13);
|
||||
this.label1.TabIndex = 10;
|
||||
this.label1.Text = "Size";
|
||||
//
|
||||
// cordonBottom
|
||||
//
|
||||
this.CordonBottom.Location = new System.Drawing.Point(280, 75);
|
||||
this.CordonBottom.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonBottom.Name = "cordonBottom";
|
||||
this.CordonBottom.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonBottom.TabIndex = 5;
|
||||
this.CordonBottom.Value = new decimal(new int[] {
|
||||
112,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonBottom.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// cordonTop
|
||||
//
|
||||
this.CordonTop.Location = new System.Drawing.Point(280, 49);
|
||||
this.CordonTop.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonTop.Name = "cordonTop";
|
||||
this.CordonTop.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonTop.TabIndex = 3;
|
||||
this.CordonTop.Value = new decimal(new int[] {
|
||||
16,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonTop.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// cordonRight
|
||||
//
|
||||
this.CordonRight.Location = new System.Drawing.Point(169, 75);
|
||||
this.CordonRight.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonRight.Name = "cordonRight";
|
||||
this.CordonRight.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonRight.TabIndex = 4;
|
||||
this.CordonRight.Value = new decimal(new int[] {
|
||||
112,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonRight.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// cordonLeft
|
||||
//
|
||||
this.CordonLeft.Location = new System.Drawing.Point(169, 49);
|
||||
this.CordonLeft.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonLeft.Name = "cordonLeft";
|
||||
this.CordonLeft.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonLeft.TabIndex = 2;
|
||||
this.CordonLeft.Value = new decimal(new int[] {
|
||||
16,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonLeft.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// height
|
||||
//
|
||||
this.MapHeight.Increment = new decimal(new int[] {
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapHeight.Location = new System.Drawing.Point(280, 23);
|
||||
this.MapHeight.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapHeight.Name = "height";
|
||||
this.MapHeight.Size = new System.Drawing.Size(105, 20);
|
||||
this.MapHeight.TabIndex = 1;
|
||||
this.MapHeight.Value = new decimal(new int[] {
|
||||
128,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapHeight.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// width
|
||||
//
|
||||
this.MapWidth.Increment = new decimal(new int[] {
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapWidth.Location = new System.Drawing.Point(169, 23);
|
||||
this.MapWidth.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapWidth.Name = "width";
|
||||
this.MapWidth.Size = new System.Drawing.Size(105, 20);
|
||||
this.MapWidth.TabIndex = 0;
|
||||
this.MapWidth.Value = new decimal(new int[] {
|
||||
128,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapWidth.Enter += new System.EventHandler(this.SelectText);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(31, 124);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(44, 13);
|
||||
this.label4.TabIndex = 14;
|
||||
this.label4.Text = "Tileset";
|
||||
//
|
||||
// theater
|
||||
//
|
||||
this.TheaterBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.TheaterBox.FormattingEnabled = true;
|
||||
this.TheaterBox.Location = new System.Drawing.Point(169, 121);
|
||||
this.TheaterBox.Name = "theater";
|
||||
this.TheaterBox.Size = new System.Drawing.Size(216, 21);
|
||||
this.TheaterBox.TabIndex = 6;
|
||||
//
|
||||
// NewMapDialog
|
||||
//
|
||||
this.AcceptButton = this.button2;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.button1;
|
||||
this.ClientSize = new System.Drawing.Size(418, 210);
|
||||
this.Controls.Add(this.TheaterBox);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.CordonBottom);
|
||||
this.Controls.Add(this.CordonTop);
|
||||
this.Controls.Add(this.CordonRight);
|
||||
this.Controls.Add(this.CordonLeft);
|
||||
this.Controls.Add(this.MapHeight);
|
||||
this.Controls.Add(this.MapWidth);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Name = "NewMapDialog";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "New Map";
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonBottom)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonTop)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonRight)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonLeft)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapHeight)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapWidth)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
public System.Windows.Forms.NumericUpDown CordonBottom;
|
||||
public System.Windows.Forms.NumericUpDown CordonTop;
|
||||
public System.Windows.Forms.NumericUpDown CordonRight;
|
||||
public System.Windows.Forms.NumericUpDown CordonLeft;
|
||||
public System.Windows.Forms.NumericUpDown MapHeight;
|
||||
public System.Windows.Forms.NumericUpDown MapWidth;
|
||||
private System.Windows.Forms.Label label4;
|
||||
public System.Windows.Forms.ComboBox TheaterBox;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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 OpenRA.Editor
|
||||
{
|
||||
public partial class NewMapDialog : Form
|
||||
{
|
||||
public NewMapDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void SelectText(object sender, System.EventArgs e)
|
||||
{
|
||||
var ud = sender as NumericUpDown;
|
||||
ud.Select(0, ud.ToString().Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,211 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{00038B75-405B-44F5-8691-BD2546DBE224}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenRA.Editor</RootNamespace>
|
||||
<AssemblyName>OpenRA.Editor</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ApplicationIcon>OpenRA.Editor.Icon.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<OutputPath>..\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Eluant">
|
||||
<HintPath>..\thirdparty\download\Eluant.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ActorPropertiesDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ActorPropertiesDialog.Designer.cs">
|
||||
<DependentUpon>ActorPropertiesDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ActorTemplate.cs" />
|
||||
<Compile Include="ActorTool.cs" />
|
||||
<Compile Include="BrushTool.cs" />
|
||||
<Compile Include="ErrorListDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ErrorListDialog.Designer.cs">
|
||||
<DependentUpon>ErrorListDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ITool.cs" />
|
||||
<Compile Include="MapSelect.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MapSelect.Designer.cs">
|
||||
<DependentUpon>MapSelect.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NewMapDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="NewMapDialog.Designer.cs">
|
||||
<DependentUpon>NewMapDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="PropertiesDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PropertiesDialog.Designer.cs">
|
||||
<DependentUpon>PropertiesDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="ActorPropertiesDialog.resx">
|
||||
<DependentUpon>ActorPropertiesDialog.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MapSelect.resx">
|
||||
<DependentUpon>MapSelect.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="NewMapDialog.resx">
|
||||
<DependentUpon>NewMapDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="PropertiesDialog.resx">
|
||||
<DependentUpon>PropertiesDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ResizeDialog.resx">
|
||||
<DependentUpon>ResizeDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="RenderUtils.cs" />
|
||||
<Compile Include="ResizeDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ResizeDialog.Designer.cs">
|
||||
<DependentUpon>ResizeDialog.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ResourceTool.cs" />
|
||||
<Compile Include="Surface.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TileSetRenderer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenRA.Game\OpenRA.Game.csproj">
|
||||
<Project>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</Project>
|
||||
<Name>OpenRA.Game</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OpenRA.Mods.Common\OpenRA.Mods.Common.csproj">
|
||||
<Project>{FE6C8CC0-2F07-442A-B29F-17617B3B7FC6}</Project>
|
||||
<Name>OpenRA.Mods.Common</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="OpenRA.Editor.Icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,33 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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.Globalization;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
public static Ruleset Rules;
|
||||
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Log.AddChannel("perf", null);
|
||||
|
||||
Application.CurrentCulture = CultureInfo.InvariantCulture;
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
Application.Run(new Form1(args));
|
||||
}
|
||||
}
|
||||
}
|
||||
63
OpenRA.Editor/Properties/Resources.Designer.cs
generated
63
OpenRA.Editor/Properties/Resources.Designer.cs
generated
@@ -1,63 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.269
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OpenRA.Editor.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// 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", "4.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() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRA.Editor.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
26
OpenRA.Editor/Properties/Settings.Designer.cs
generated
26
OpenRA.Editor/Properties/Settings.Designer.cs
generated
@@ -1,26 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.269
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OpenRA.Editor.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
182
OpenRA.Editor/PropertiesDialog.Designer.cs
generated
182
OpenRA.Editor/PropertiesDialog.Designer.cs
generated
@@ -1,182 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
partial class PropertiesDialog
|
||||
{
|
||||
/// <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.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.TitleBox = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.DescBox = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.AuthorBox = new System.Windows.Forms.TextBox();
|
||||
this.MapVisibilityComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// 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.OK;
|
||||
this.button2.Location = new System.Drawing.Point(196, 193);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 14;
|
||||
this.button2.Text = "OK";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// 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.Cancel;
|
||||
this.button1.Location = new System.Drawing.Point(277, 193);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 15;
|
||||
this.button1.Text = "Cancel";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 50);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(27, 13);
|
||||
this.label1.TabIndex = 16;
|
||||
this.label1.Text = "Title";
|
||||
//
|
||||
// title
|
||||
//
|
||||
this.TitleBox.Location = new System.Drawing.Point(66, 47);
|
||||
this.TitleBox.Name = "title";
|
||||
this.TitleBox.Size = new System.Drawing.Size(286, 20);
|
||||
this.TitleBox.TabIndex = 17;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(12, 76);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(32, 13);
|
||||
this.label2.TabIndex = 16;
|
||||
this.label2.Text = "Desc";
|
||||
//
|
||||
// desc
|
||||
//
|
||||
this.DescBox.Location = new System.Drawing.Point(66, 73);
|
||||
this.DescBox.Name = "desc";
|
||||
this.DescBox.Size = new System.Drawing.Size(286, 20);
|
||||
this.DescBox.TabIndex = 17;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(12, 102);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(38, 13);
|
||||
this.label3.TabIndex = 16;
|
||||
this.label3.Text = "Author";
|
||||
//
|
||||
// author
|
||||
//
|
||||
this.AuthorBox.Location = new System.Drawing.Point(66, 99);
|
||||
this.AuthorBox.Name = "author";
|
||||
this.AuthorBox.Size = new System.Drawing.Size(286, 20);
|
||||
this.AuthorBox.TabIndex = 17;
|
||||
//
|
||||
//
|
||||
// mapVisibilityComboBox
|
||||
//
|
||||
this.MapVisibilityComboBox.FormattingEnabled = true;
|
||||
this.MapVisibilityComboBox.Items.AddRange(new object[] {
|
||||
"Lobby",
|
||||
"Shellmap",
|
||||
"MissionSelector"});
|
||||
this.MapVisibilityComboBox.Location = new System.Drawing.Point(150, 137);
|
||||
this.MapVisibilityComboBox.Name = "mapVisibilityComboBox";
|
||||
this.MapVisibilityComboBox.Size = new System.Drawing.Size(121, 21);
|
||||
this.MapVisibilityComboBox.TabIndex = 19;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(90, 140);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(58, 13);
|
||||
this.label4.TabIndex = 20;
|
||||
this.label4.Text = "Map class:";
|
||||
// PropertiesDialog
|
||||
//
|
||||
this.AcceptButton = this.button2;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.button1;
|
||||
this.ClientSize = new System.Drawing.Size(370, 228);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.MapVisibilityComboBox);
|
||||
this.Controls.Add(this.AuthorBox);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.DescBox);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.TitleBox);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Name = "PropertiesDialog";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Map Properties";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
public System.Windows.Forms.TextBox TitleBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
public System.Windows.Forms.TextBox DescBox;
|
||||
private System.Windows.Forms.Label label3;
|
||||
public System.Windows.Forms.TextBox AuthorBox;
|
||||
public System.Windows.Forms.ComboBox MapVisibilityComboBox;
|
||||
private System.Windows.Forms.Label label4;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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 OpenRA.Editor
|
||||
{
|
||||
public partial class PropertiesDialog : Form
|
||||
{
|
||||
public PropertiesDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,112 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
using OpenRA.Mods.Common.SpriteLoaders;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
static class RenderUtils
|
||||
{
|
||||
static Bitmap RenderShp(ShpTDSprite shp, IPalette p)
|
||||
{
|
||||
var frame = shp.Frames.First();
|
||||
|
||||
var bitmap = new Bitmap(frame.Size.Width, frame.Size.Height, PixelFormat.Format8bppIndexed);
|
||||
|
||||
bitmap.Palette = p.AsSystemPalette();
|
||||
|
||||
var data = bitmap.LockBits(bitmap.Bounds(),
|
||||
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
|
||||
|
||||
unsafe
|
||||
{
|
||||
var q = (byte*)data.Scan0.ToPointer();
|
||||
var stride2 = data.Stride;
|
||||
|
||||
for (var i = 0; i < frame.Size.Width; i++)
|
||||
for (var j = 0; j < frame.Size.Height; j++)
|
||||
q[j * stride2 + i] = frame.Data[i + frame.Size.Width * j];
|
||||
}
|
||||
|
||||
bitmap.UnlockBits(data);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
static readonly string[] LegacyExtensions = new[] { ".shp", ".tem", "" };
|
||||
|
||||
static string ResolveFilename(string name, TileSet tileSet)
|
||||
{
|
||||
var ssl = Game.ModData.SpriteSequenceLoader as TilesetSpecificSpriteSequenceLoader;
|
||||
var extensions = ssl != null ? new[] { ssl.TilesetExtensions[tileSet.Id], ssl.DefaultSpriteExtension }.Append(LegacyExtensions) :
|
||||
LegacyExtensions.AsEnumerable();
|
||||
|
||||
foreach (var e in extensions)
|
||||
if (GlobalFileSystem.Exists(name + e))
|
||||
return name + e;
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public static ActorTemplate RenderActor(ActorInfo info, SequenceProvider sequenceProvider, TileSet tileset, IPalette p, string race)
|
||||
{
|
||||
var image = info.Traits.Get<ILegacyEditorRenderInfo>().EditorImage(info, sequenceProvider, race);
|
||||
image = ResolveFilename(image, tileset);
|
||||
using (var s = GlobalFileSystem.Open(image))
|
||||
{
|
||||
var shp = new ShpTDSprite(s);
|
||||
var bitmap = RenderShp(shp, p);
|
||||
|
||||
return new ActorTemplate
|
||||
{
|
||||
Bitmap = bitmap,
|
||||
Info = info,
|
||||
Appearance = info.Traits.GetOrDefault<EditorAppearanceInfo>()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static ResourceTemplate RenderResourceType(ResourceTypeInfo info, TileSet tileset, IPalette p)
|
||||
{
|
||||
var image = ResolveFilename(info.EditorSprite, tileset);
|
||||
using (var s = GlobalFileSystem.Open(image))
|
||||
{
|
||||
// TODO: Do this properly
|
||||
var shp = new ShpTDSprite(s);
|
||||
var frame = shp.Frames.Last();
|
||||
|
||||
var bitmap = new Bitmap(frame.Size.Width, frame.Size.Height, PixelFormat.Format8bppIndexed);
|
||||
bitmap.Palette = p.AsSystemPalette();
|
||||
var data = bitmap.LockBits(bitmap.Bounds(),
|
||||
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
|
||||
|
||||
unsafe
|
||||
{
|
||||
var q = (byte*)data.Scan0.ToPointer();
|
||||
var stride = data.Stride;
|
||||
|
||||
for (var i = 0; i < frame.Size.Width; i++)
|
||||
for (var j = 0; j < frame.Size.Height; j++)
|
||||
q[j * stride + i] = frame.Data[i + frame.Size.Width * j];
|
||||
}
|
||||
|
||||
bitmap.UnlockBits(data);
|
||||
return new ResourceTemplate { Bitmap = bitmap, Info = info, Value = shp.Frames.Count - 1 };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
235
OpenRA.Editor/ResizeDialog.Designer.cs
generated
235
OpenRA.Editor/ResizeDialog.Designer.cs
generated
@@ -1,235 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
partial class ResizeDialog
|
||||
{
|
||||
/// <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.MapWidth = new System.Windows.Forms.NumericUpDown();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.CordonLeft = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonTop = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonRight = new System.Windows.Forms.NumericUpDown();
|
||||
this.CordonBottom = new System.Windows.Forms.NumericUpDown();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.MapHeight = new System.Windows.Forms.NumericUpDown();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapWidth)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonLeft)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonTop)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonRight)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonBottom)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapHeight)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// width
|
||||
//
|
||||
this.MapWidth.Increment = new decimal(new int[] {
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapWidth.Location = new System.Drawing.Point(161, 18);
|
||||
this.MapWidth.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapWidth.Name = "width";
|
||||
this.MapWidth.Size = new System.Drawing.Size(105, 20);
|
||||
this.MapWidth.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(23, 20);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(27, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Size";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(23, 46);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(86, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Cordon Left/Top";
|
||||
//
|
||||
// cordonLeft
|
||||
//
|
||||
this.CordonLeft.Location = new System.Drawing.Point(161, 44);
|
||||
this.CordonLeft.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonLeft.Name = "cordonLeft";
|
||||
this.CordonLeft.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonLeft.TabIndex = 0;
|
||||
//
|
||||
// cordonTop
|
||||
//
|
||||
this.CordonTop.Location = new System.Drawing.Point(272, 44);
|
||||
this.CordonTop.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonTop.Name = "cordonTop";
|
||||
this.CordonTop.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonTop.TabIndex = 0;
|
||||
//
|
||||
// cordonRight
|
||||
//
|
||||
this.CordonRight.Location = new System.Drawing.Point(161, 70);
|
||||
this.CordonRight.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonRight.Name = "cordonRight";
|
||||
this.CordonRight.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonRight.TabIndex = 0;
|
||||
//
|
||||
// cordonBottom
|
||||
//
|
||||
this.CordonBottom.Location = new System.Drawing.Point(272, 70);
|
||||
this.CordonBottom.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.CordonBottom.Name = "cordonBottom";
|
||||
this.CordonBottom.Size = new System.Drawing.Size(105, 20);
|
||||
this.CordonBottom.TabIndex = 0;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(23, 72);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(107, 13);
|
||||
this.label3.TabIndex = 1;
|
||||
this.label3.Text = "Cordon Right/Bottom";
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.button1.Location = new System.Drawing.Point(302, 111);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 2;
|
||||
this.button1.Text = "Cancel";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.button2.Location = new System.Drawing.Point(221, 111);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 2;
|
||||
this.button2.Text = "OK";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// height
|
||||
//
|
||||
this.MapHeight.Increment = new decimal(new int[] {
|
||||
8,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapHeight.Location = new System.Drawing.Point(272, 18);
|
||||
this.MapHeight.Maximum = new decimal(new int[] {
|
||||
2048,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.MapHeight.Name = "height";
|
||||
this.MapHeight.Size = new System.Drawing.Size(105, 20);
|
||||
this.MapHeight.TabIndex = 0;
|
||||
//
|
||||
// ResizeDialog
|
||||
//
|
||||
this.AcceptButton = this.button2;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.button1;
|
||||
this.ClientSize = new System.Drawing.Size(409, 146);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.CordonBottom);
|
||||
this.Controls.Add(this.CordonTop);
|
||||
this.Controls.Add(this.CordonRight);
|
||||
this.Controls.Add(this.CordonLeft);
|
||||
this.Controls.Add(this.MapHeight);
|
||||
this.Controls.Add(this.MapWidth);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Name = "ResizeDialog";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Resize Map";
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapWidth)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonLeft)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonTop)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonRight)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.CordonBottom)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.MapHeight)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
public System.Windows.Forms.NumericUpDown MapWidth;
|
||||
public System.Windows.Forms.NumericUpDown CordonLeft;
|
||||
public System.Windows.Forms.NumericUpDown CordonTop;
|
||||
public System.Windows.Forms.NumericUpDown CordonRight;
|
||||
public System.Windows.Forms.NumericUpDown CordonBottom;
|
||||
public System.Windows.Forms.NumericUpDown MapHeight;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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 OpenRA.Editor
|
||||
{
|
||||
public partial class ResizeDialog : Form
|
||||
{
|
||||
public ResizeDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,45 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 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 SGraphics = System.Drawing.Graphics;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
class ResourceTool : ITool
|
||||
{
|
||||
ResourceTemplate resourceTemplate;
|
||||
|
||||
public ResourceTool(ResourceTemplate resource) { resourceTemplate = resource; }
|
||||
|
||||
public void Apply(Surface surface)
|
||||
{
|
||||
var type = (byte)resourceTemplate.Info.ResourceType;
|
||||
var index = (byte)random.Next(resourceTemplate.Info.MaxDensity);
|
||||
surface.Map.MapResources.Value[surface.GetBrushLocation()] = new ResourceTile(type, index);
|
||||
|
||||
var ch = new int2(surface.GetBrushLocation().X / Surface.ChunkSize,
|
||||
surface.GetBrushLocation().Y / Surface.ChunkSize);
|
||||
|
||||
if (surface.Chunks.ContainsKey(ch))
|
||||
{
|
||||
surface.Chunks[ch].Dispose();
|
||||
surface.Chunks.Remove(ch);
|
||||
}
|
||||
}
|
||||
|
||||
public void Preview(Surface surface, SGraphics g)
|
||||
{
|
||||
surface.DrawImage(g, resourceTemplate.Bitmap, surface.GetBrushLocation(), false, null);
|
||||
}
|
||||
|
||||
Random random = new Random();
|
||||
}
|
||||
}
|
||||
@@ -1,588 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
using SGraphics = System.Drawing.Graphics;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
static class ActorReferenceExts
|
||||
{
|
||||
public static CPos Location(this ActorReference ar)
|
||||
{
|
||||
return (CPos)ar.InitDict.Get<LocationInit>().Value(null);
|
||||
}
|
||||
|
||||
public static void DrawStringContrast(this SGraphics g, Font f, string s, int x, int y, Brush fg, Brush bg)
|
||||
{
|
||||
g.DrawString(s, f, bg, x - 1, y - 1);
|
||||
g.DrawString(s, f, bg, x + 1, y - 1);
|
||||
g.DrawString(s, f, bg, x - 1, y + 1);
|
||||
g.DrawString(s, f, bg, x + 1, y + 1);
|
||||
|
||||
g.DrawString(s, f, fg, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
class Surface : Control
|
||||
{
|
||||
public Map Map { get; private set; }
|
||||
public Dictionary<string, ActorReference> Actors { get; private set; }
|
||||
public TileSet TileSet { get; private set; }
|
||||
public TileSetRenderer TileSetRenderer { get; private set; }
|
||||
public IPalette Palette { get; private set; }
|
||||
public IPalette PlayerPalette { get; private set; }
|
||||
public int2 Offset;
|
||||
|
||||
public int2 GetOffset() { return Offset; }
|
||||
|
||||
public float Zoom = 1.0f;
|
||||
|
||||
ITool currentTool;
|
||||
|
||||
public bool IsPanning;
|
||||
public bool IsErasing;
|
||||
public bool ShowActorNames;
|
||||
public bool ShowGrid;
|
||||
public bool ShowRuler;
|
||||
|
||||
public bool IsPaste { get { return TileSelection != null && ResourceSelection != null; } }
|
||||
public TerrainTile[,] TileSelection;
|
||||
public ResourceTile[,] ResourceSelection;
|
||||
public CPos SelectionStart;
|
||||
public CPos SelectionEnd;
|
||||
|
||||
public string NewActorOwner;
|
||||
|
||||
public event Action AfterChange = () => { };
|
||||
public event Action<string> MousePositionChanged = _ => { };
|
||||
public event Action<KeyValuePair<string, ActorReference>> ActorDoubleClicked = _ => { };
|
||||
|
||||
Dictionary<string, ActorTemplate> actorTemplates = new Dictionary<string, ActorTemplate>();
|
||||
public Dictionary<int, ResourceTemplate> ResourceTemplates = new Dictionary<int, ResourceTemplate>();
|
||||
|
||||
static readonly Font MarkerFont = new Font(FontFamily.GenericSansSerif, 12.0f, FontStyle.Regular);
|
||||
static readonly SolidBrush TextBrush = new SolidBrush(Color.Red);
|
||||
|
||||
public Keys GetModifiers() { return ModifierKeys; }
|
||||
|
||||
public void Bind(Map m, TileSet ts, TileSetRenderer tsr, IPalette p, IPalette pp)
|
||||
{
|
||||
Map = m;
|
||||
if (m != null)
|
||||
Actors = m.ActorDefinitions.ToDictionary(n => n.Key, n => new ActorReference(n.Value.Value, n.Value.ToDictionary()));
|
||||
|
||||
TileSet = ts;
|
||||
TileSetRenderer = tsr;
|
||||
Palette = p;
|
||||
PlayerPalette = pp;
|
||||
playerPalettes = null;
|
||||
Chunks.Clear();
|
||||
currentTool = null;
|
||||
}
|
||||
|
||||
public void SetTool(ITool tool) { currentTool = tool; ClearSelection(); }
|
||||
|
||||
public void BindActorTemplates(IEnumerable<ActorTemplate> templates)
|
||||
{
|
||||
actorTemplates = templates.ToDictionary(a => a.Info.Name.ToLowerInvariant());
|
||||
}
|
||||
|
||||
public void BindResourceTemplates(IEnumerable<ResourceTemplate> templates)
|
||||
{
|
||||
ResourceTemplates = templates.ToDictionary(a => a.Info.ResourceType);
|
||||
}
|
||||
|
||||
public Dictionary<int2, Bitmap> Chunks = new Dictionary<int2, Bitmap>();
|
||||
|
||||
public Surface()
|
||||
{
|
||||
BackColor = Color.Black;
|
||||
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
UpdateStyles();
|
||||
}
|
||||
|
||||
static readonly Pen SelectionPen = new Pen(Color.Blue);
|
||||
static readonly Pen PastePen = new Pen(Color.Green);
|
||||
static readonly Pen CordonPen = new Pen(Color.Red);
|
||||
|
||||
int2 mousePos;
|
||||
|
||||
public void Scroll(int2 dx)
|
||||
{
|
||||
Offset -= dx;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnDoubleClick(EventArgs e)
|
||||
{
|
||||
base.OnDoubleClick(e);
|
||||
|
||||
var x = Actors.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
|
||||
if (x.Key != null)
|
||||
ActorDoubleClicked(x);
|
||||
}
|
||||
|
||||
protected override void OnMouseWheel(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseWheel(e);
|
||||
|
||||
if (Map == null) return;
|
||||
|
||||
Zoom *= e.Delta > 0 ? 4.0f / 3.0f : .75f;
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(EventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
|
||||
this.Parent.Focus();
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnMouseEnter(EventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
|
||||
this.Focus();
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseMove(e);
|
||||
|
||||
if (Map == null) return;
|
||||
|
||||
var oldMousePos = mousePos;
|
||||
mousePos = new int2(e.Location);
|
||||
MousePositionChanged(GetBrushLocation().ToString());
|
||||
|
||||
if (e.Button == MouseButtons.Middle || (e.Button != MouseButtons.None && IsPanning))
|
||||
Scroll(oldMousePos - mousePos);
|
||||
else
|
||||
{
|
||||
if (e.Button == MouseButtons.Right || (IsErasing && e.Button == MouseButtons.Left))
|
||||
Erase();
|
||||
|
||||
if (e.Button == MouseButtons.Left && !IsErasing)
|
||||
Draw();
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
void Erase()
|
||||
{
|
||||
// Crash preventing
|
||||
var brushLocation = GetBrushLocation();
|
||||
|
||||
if (Map == null || brushLocation.X >= Map.MapSize.X ||
|
||||
brushLocation.Y >= Map.MapSize.Y ||
|
||||
brushLocation.X < 0 ||
|
||||
brushLocation.Y < 0)
|
||||
return;
|
||||
|
||||
currentTool = null;
|
||||
|
||||
var key = Actors.FirstOrDefault(a => a.Value.Location() == brushLocation);
|
||||
if (key.Key != null) Actors.Remove(key.Key);
|
||||
|
||||
if (Map.MapResources.Value[brushLocation].Type != 0)
|
||||
{
|
||||
Map.MapResources.Value[brushLocation] = new ResourceTile(0, 0);
|
||||
var ch = new int2(brushLocation.X / ChunkSize, brushLocation.Y / ChunkSize);
|
||||
if (Chunks.ContainsKey(ch))
|
||||
{
|
||||
Chunks[ch].Dispose();
|
||||
Chunks.Remove(ch);
|
||||
}
|
||||
}
|
||||
|
||||
AfterChange();
|
||||
ClearSelection();
|
||||
}
|
||||
|
||||
void Draw()
|
||||
{
|
||||
if (currentTool != null)
|
||||
{
|
||||
currentTool.Apply(this);
|
||||
AfterChange();
|
||||
}
|
||||
else if (IsPaste)
|
||||
PasteSelection();
|
||||
else
|
||||
SelectionEnd = GetBrushLocationBR();
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseDown(e);
|
||||
|
||||
if (Map == null) return;
|
||||
|
||||
if (!IsPanning)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right) Erase();
|
||||
if (e.Button == MouseButtons.Left && !IsErasing)
|
||||
{
|
||||
Draw();
|
||||
if (!IsPaste)
|
||||
SelectionStart = SelectionEnd = GetBrushLocation();
|
||||
}
|
||||
}
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
public const int ChunkSize = 8; // 8x8 chunks ==> 192x192 bitmaps.
|
||||
|
||||
Bitmap RenderChunk(int u, int v)
|
||||
{
|
||||
var bitmap = new Bitmap(ChunkSize * TileSetRenderer.TileSize, ChunkSize * TileSetRenderer.TileSize);
|
||||
|
||||
var data = bitmap.LockBits(bitmap.Bounds(),
|
||||
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||
|
||||
unsafe
|
||||
{
|
||||
var p = (int*)data.Scan0.ToPointer();
|
||||
var stride = data.Stride >> 2;
|
||||
|
||||
for (var i = 0; i < ChunkSize; i++)
|
||||
for (var j = 0; j < ChunkSize; j++)
|
||||
{
|
||||
var ui = u * ChunkSize + i;
|
||||
var vj = v * ChunkSize + j;
|
||||
var uv = new MPos(ui, vj);
|
||||
if (uv.U >= Map.MapSize.X || uv.V >= Map.MapSize.Y)
|
||||
{
|
||||
for (var x = 0; x < TileSetRenderer.TileSize; x++)
|
||||
for (var y = 0; y < TileSetRenderer.TileSize; y++)
|
||||
p[(j * TileSetRenderer.TileSize + y) * stride + i * TileSetRenderer.TileSize + x] = 0;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
var tr = Map.MapTiles.Value[uv];
|
||||
var tile = TileSetRenderer.Data(tr.Type);
|
||||
if (tile == null)
|
||||
continue;
|
||||
|
||||
var index = (tr.Index < tile.Length) ? tr.Index : (byte)0;
|
||||
var rawImage = tile[index];
|
||||
for (var x = 0; x < TileSetRenderer.TileSize; x++)
|
||||
for (var y = 0; y < TileSetRenderer.TileSize; y++)
|
||||
p[(j * TileSetRenderer.TileSize + y) * stride + i * TileSetRenderer.TileSize + x] =
|
||||
Palette.GetColor(rawImage[x + TileSetRenderer.TileSize * y]).ToArgb();
|
||||
|
||||
if (Map.MapResources.Value[uv].Type != 0)
|
||||
{
|
||||
var resourceImage = ResourceTemplates[Map.MapResources.Value[uv].Type].Bitmap;
|
||||
var srcdata = resourceImage.LockBits(resourceImage.Bounds(),
|
||||
ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
|
||||
|
||||
var q = (int*)srcdata.Scan0.ToPointer();
|
||||
var srcstride = srcdata.Stride >> 2;
|
||||
|
||||
for (var x = 0; x < TileSetRenderer.TileSize; x++)
|
||||
for (var y = 0; y < TileSetRenderer.TileSize; y++)
|
||||
{
|
||||
var c = q[y * srcstride + x];
|
||||
if ((c & 0xff000000) != 0) /* quick & dirty, i cbf doing real alpha */
|
||||
p[(j * TileSetRenderer.TileSize + y) * stride + i * TileSetRenderer.TileSize + x] = c;
|
||||
}
|
||||
|
||||
resourceImage.UnlockBits(srcdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bitmap.UnlockBits(data);
|
||||
|
||||
if (ShowGrid)
|
||||
{
|
||||
using (var g = SGraphics.FromImage(bitmap))
|
||||
{
|
||||
var ts = Game.ModData.Manifest.TileSize;
|
||||
var rect = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
|
||||
ControlPaint.DrawGrid(g, rect, new Size(2, ts.Height), Color.DarkRed);
|
||||
ControlPaint.DrawGrid(g, rect, new Size(ts.Width, 2), Color.DarkRed);
|
||||
ControlPaint.DrawGrid(g, rect, new Size(ts.Width, ts.Height), Color.Red);
|
||||
}
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public CPos GetBrushLocation()
|
||||
{
|
||||
var vX = (int)Math.Floor((mousePos.X - Offset.X) / Zoom);
|
||||
var vY = (int)Math.Floor((mousePos.Y - Offset.Y) / Zoom);
|
||||
return new CPos(vX / TileSetRenderer.TileSize, vY / TileSetRenderer.TileSize);
|
||||
}
|
||||
|
||||
public CPos GetBrushLocationBR()
|
||||
{
|
||||
var vX = (int)Math.Floor((mousePos.X - Offset.X) / Zoom);
|
||||
var vY = (int)Math.Floor((mousePos.Y - Offset.Y) / Zoom);
|
||||
return new CPos(
|
||||
(vX + TileSetRenderer.TileSize - 1) / TileSetRenderer.TileSize,
|
||||
(vY + TileSetRenderer.TileSize - 1) / TileSetRenderer.TileSize);
|
||||
}
|
||||
|
||||
public void DrawActor(SGraphics g, CPos p, ActorTemplate t, ColorPalette cp)
|
||||
{
|
||||
var centered = t.Appearance == null || !t.Appearance.RelativeToTopLeft;
|
||||
var actorPalette = cp;
|
||||
if (t.Appearance != null && t.Appearance.UseTerrainPalette)
|
||||
actorPalette = Palette.AsSystemPalette();
|
||||
DrawImage(g, t.Bitmap, p, centered, actorPalette);
|
||||
}
|
||||
|
||||
float2 GetDrawPosition(CPos location, Bitmap bmp, bool centered)
|
||||
{
|
||||
float offsetX = centered ? bmp.Width / 2 - TileSetRenderer.TileSize / 2 : 0;
|
||||
var drawX = TileSetRenderer.TileSize * location.X * Zoom + Offset.X - offsetX;
|
||||
|
||||
float offsetY = centered ? bmp.Height / 2 - TileSetRenderer.TileSize / 2 : 0;
|
||||
var drawY = TileSetRenderer.TileSize * location.Y * Zoom + Offset.Y - offsetY;
|
||||
|
||||
return new float2(drawX, drawY);
|
||||
}
|
||||
|
||||
public void DrawImage(SGraphics g, Bitmap bmp, CPos location, bool centered, ColorPalette cp)
|
||||
{
|
||||
var drawPos = GetDrawPosition(location, bmp, centered);
|
||||
|
||||
var sourceRect = new RectangleF(0, 0, bmp.Width, bmp.Height);
|
||||
var destRect = new RectangleF(drawPos.X, drawPos.Y, bmp.Width * Zoom, bmp.Height * Zoom);
|
||||
|
||||
var restorePalette = bmp.Palette;
|
||||
if (cp != null) bmp.Palette = cp;
|
||||
g.DrawImage(bmp, destRect, sourceRect, GraphicsUnit.Pixel);
|
||||
if (cp != null) bmp.Palette = restorePalette;
|
||||
}
|
||||
|
||||
void DrawActorBorder(SGraphics g, CPos p, ActorTemplate t)
|
||||
{
|
||||
var centered = t.Appearance == null || !t.Appearance.RelativeToTopLeft;
|
||||
var drawPos = GetDrawPosition(p, t.Bitmap, centered);
|
||||
|
||||
g.DrawRectangle(CordonPen,
|
||||
drawPos.X, drawPos.Y,
|
||||
t.Bitmap.Width * Zoom, t.Bitmap.Height * Zoom);
|
||||
}
|
||||
|
||||
ColorPalette GetPaletteForPlayerInner(string name)
|
||||
{
|
||||
var pr = new MapPlayers(Map.PlayerDefinitions).Players[name];
|
||||
var pcpi = Program.Rules.Actors["world"].Traits.Get<PlayerColorPaletteInfo>();
|
||||
var remap = new PlayerColorRemap(pcpi.RemapIndex, pr.Color, pcpi.Ramp);
|
||||
return new ImmutablePalette(PlayerPalette, remap).AsSystemPalette();
|
||||
}
|
||||
|
||||
Cache<string, ColorPalette> playerPalettes;
|
||||
|
||||
public ColorPalette GetPaletteForPlayer(string player)
|
||||
{
|
||||
if (playerPalettes == null)
|
||||
playerPalettes = new Cache<string, ColorPalette>(GetPaletteForPlayerInner);
|
||||
|
||||
return playerPalettes[player];
|
||||
}
|
||||
|
||||
ColorPalette GetPaletteForActor(ActorReference ar)
|
||||
{
|
||||
var ownerInit = ar.InitDict.GetOrDefault<OwnerInit>();
|
||||
if (ownerInit == null)
|
||||
return null;
|
||||
|
||||
return GetPaletteForPlayer(ownerInit.PlayerName);
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
if (Map == null) return;
|
||||
if (TileSet == null) return;
|
||||
|
||||
for (var u = 0; u < Map.MapSize.X; u += ChunkSize)
|
||||
for (var v = 0; v < Map.MapSize.Y; v += ChunkSize)
|
||||
{
|
||||
var x = new int2(u / ChunkSize, v / ChunkSize);
|
||||
if (!Chunks.ContainsKey(x)) Chunks[x] = RenderChunk(u / ChunkSize, v / ChunkSize);
|
||||
|
||||
var bmp = Chunks[x];
|
||||
|
||||
var drawX = TileSetRenderer.TileSize * (float)ChunkSize * (float)x.X * Zoom + Offset.X;
|
||||
var drawY = TileSetRenderer.TileSize * (float)ChunkSize * (float)x.Y * Zoom + Offset.Y;
|
||||
var sourceRect = new RectangleF(0, 0, bmp.Width, bmp.Height);
|
||||
var destRect = new RectangleF(drawX, drawY, bmp.Width * Zoom, bmp.Height * Zoom);
|
||||
e.Graphics.DrawImage(bmp, destRect, sourceRect, GraphicsUnit.Pixel);
|
||||
}
|
||||
|
||||
e.Graphics.DrawRectangle(CordonPen,
|
||||
Map.Bounds.Left * TileSetRenderer.TileSize * Zoom + Offset.X,
|
||||
Map.Bounds.Top * TileSetRenderer.TileSize * Zoom + Offset.Y,
|
||||
Map.Bounds.Width * TileSetRenderer.TileSize * Zoom,
|
||||
Map.Bounds.Height * TileSetRenderer.TileSize * Zoom);
|
||||
|
||||
e.Graphics.DrawRectangle(SelectionPen,
|
||||
(SelectionStart.X * TileSetRenderer.TileSize * Zoom) + Offset.X,
|
||||
(SelectionStart.Y * TileSetRenderer.TileSize * Zoom) + Offset.Y,
|
||||
(SelectionEnd - SelectionStart).X * TileSetRenderer.TileSize * Zoom,
|
||||
(SelectionEnd - SelectionStart).Y * TileSetRenderer.TileSize * Zoom);
|
||||
|
||||
if (IsPaste)
|
||||
{
|
||||
var loc = GetBrushLocation();
|
||||
var width = Math.Abs((SelectionStart - SelectionEnd).X);
|
||||
var height = Math.Abs((SelectionStart - SelectionEnd).Y);
|
||||
|
||||
e.Graphics.DrawRectangle(PastePen,
|
||||
(loc.X * TileSetRenderer.TileSize * Zoom) + Offset.X,
|
||||
(loc.Y * TileSetRenderer.TileSize * Zoom) + Offset.Y,
|
||||
width * (TileSetRenderer.TileSize * Zoom),
|
||||
height * (TileSetRenderer.TileSize * Zoom));
|
||||
}
|
||||
|
||||
foreach (var ar in Actors)
|
||||
{
|
||||
if (actorTemplates.ContainsKey(ar.Value.Type))
|
||||
DrawActor(e.Graphics, ar.Value.Location(), actorTemplates[ar.Value.Type],
|
||||
GetPaletteForActor(ar.Value));
|
||||
else
|
||||
Console.WriteLine("Warning: Unknown or excluded actor: {0}", ar.Value.Type);
|
||||
}
|
||||
|
||||
if (ShowActorNames)
|
||||
foreach (var ar in Actors)
|
||||
if (!ar.Key.StartsWith("Actor")) // if it has a custom name
|
||||
e.Graphics.DrawStringContrast(Font, ar.Key,
|
||||
(int)(ar.Value.Location().X * TileSetRenderer.TileSize * Zoom + Offset.X),
|
||||
(int)(ar.Value.Location().Y * TileSetRenderer.TileSize * Zoom + Offset.Y),
|
||||
Brushes.White,
|
||||
Brushes.Black);
|
||||
|
||||
if (ShowRuler && Zoom > 0.2)
|
||||
{
|
||||
for (var i = Map.Bounds.Left; i <= Map.Bounds.Right; i += 8)
|
||||
{
|
||||
if (i % 8 == 0)
|
||||
{
|
||||
var point = new PointF(i * TileSetRenderer.TileSize * Zoom + Offset.X, (Map.Bounds.Top - 8) * TileSetRenderer.TileSize * Zoom + Offset.Y);
|
||||
e.Graphics.DrawString((i - Map.Bounds.Left).ToString(), MarkerFont, TextBrush, point);
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = Map.Bounds.Top; i <= Map.Bounds.Bottom; i += 8)
|
||||
{
|
||||
if (i % 8 == 0)
|
||||
{
|
||||
var point = new PointF((Map.Bounds.Left - 8) * TileSetRenderer.TileSize * Zoom + Offset.X, i * TileSetRenderer.TileSize * Zoom + Offset.Y);
|
||||
e.Graphics.DrawString((i - Map.Bounds.Left).ToString(), MarkerFont, TextBrush, point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (currentTool != null)
|
||||
currentTool.Preview(this, e.Graphics);
|
||||
|
||||
if (currentTool == null)
|
||||
{
|
||||
var x = Actors.FirstOrDefault(a => a.Value.Location() == GetBrushLocation());
|
||||
if (x.Key != null && actorTemplates.ContainsKey(x.Value.Type))
|
||||
DrawActorBorder(e.Graphics, x.Value.Location(), actorTemplates[x.Value.Type]);
|
||||
}
|
||||
|
||||
base.OnPaint(e);
|
||||
}
|
||||
|
||||
public void CopySelection()
|
||||
{
|
||||
// Grab tiles and resources within selection (doesn't do actors)
|
||||
var start = SelectionStart;
|
||||
var end = SelectionEnd;
|
||||
|
||||
if (start == end) return;
|
||||
|
||||
var width = Math.Abs((start - end).X);
|
||||
var height = Math.Abs((start - end).Y);
|
||||
|
||||
TileSelection = new TerrainTile[width, height];
|
||||
ResourceSelection = new ResourceTile[width, height];
|
||||
|
||||
for (var x = 0; x < width; x++)
|
||||
{
|
||||
for (var y = 0; y < height; y++)
|
||||
{
|
||||
// TODO: crash prevention
|
||||
var cell = new CPos(start.X + x, start.Y + y);
|
||||
TileSelection[x, y] = Map.MapTiles.Value[cell];
|
||||
ResourceSelection[x, y] = Map.MapResources.Value[cell];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PasteSelection()
|
||||
{
|
||||
var loc = GetBrushLocation();
|
||||
var width = Math.Abs((SelectionStart - SelectionEnd).X);
|
||||
var height = Math.Abs((SelectionStart - SelectionEnd).Y);
|
||||
|
||||
for (var x = 0; x < width; x++)
|
||||
{
|
||||
for (var y = 0; y < height; y++)
|
||||
{
|
||||
var mapX = loc.X + x;
|
||||
var mapY = loc.Y + y;
|
||||
var cell = new CPos(mapX, mapY);
|
||||
|
||||
// TODO: crash prevention for outside of bounds
|
||||
Map.MapTiles.Value[cell] = TileSelection[x, y];
|
||||
Map.MapResources.Value[cell] = ResourceSelection[x, y];
|
||||
|
||||
var ch = new int2(mapX / ChunkSize, mapY / ChunkSize);
|
||||
if (Chunks.ContainsKey(ch))
|
||||
{
|
||||
Chunks[ch].Dispose();
|
||||
Chunks.Remove(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AfterChange();
|
||||
}
|
||||
|
||||
void ClearSelection()
|
||||
{
|
||||
SelectionStart = CPos.Zero;
|
||||
SelectionEnd = CPos.Zero;
|
||||
TileSelection = null;
|
||||
ResourceSelection = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Linq;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Editor
|
||||
{
|
||||
public class TileSetRenderer
|
||||
{
|
||||
public readonly int TileSize;
|
||||
public TileSet TileSet;
|
||||
Dictionary<ushort, byte[][]> templates;
|
||||
|
||||
// Extract a square tile that the editor can render
|
||||
byte[] ExtractSquareTile(ISpriteFrame frame)
|
||||
{
|
||||
var data = new byte[TileSize * TileSize];
|
||||
|
||||
// Invalid tile size: return blank tile
|
||||
if (frame.Size.Width < TileSize || frame.Size.Height < TileSize)
|
||||
return new byte[0];
|
||||
|
||||
var frameData = frame.Data;
|
||||
var xOffset = (frame.Size.Width - TileSize) / 2;
|
||||
var yOffset = (frame.Size.Height - TileSize) / 2;
|
||||
|
||||
for (var y = 0; y < TileSize; y++)
|
||||
for (var x = 0; x < TileSize; x++)
|
||||
data[y * TileSize + x] = frameData[(yOffset + y) * frame.Size.Width + x + xOffset];
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public TileSetRenderer(TileSet tileset, Size tileSize)
|
||||
{
|
||||
this.TileSet = tileset;
|
||||
this.TileSize = Math.Min(tileSize.Width, tileSize.Height);
|
||||
|
||||
templates = new Dictionary<ushort, byte[][]>();
|
||||
var frameCache = new FrameCache(Game.ModData.SpriteLoaders);
|
||||
foreach (var t in tileset.Templates)
|
||||
{
|
||||
var allFrames = frameCache[t.Value.Images[0]];
|
||||
var frames = t.Value.Frames != null ? t.Value.Frames.Select(f => allFrames[f]).ToArray() : allFrames;
|
||||
templates.Add(t.Value.Id, frames.Select(f => ExtractSquareTile(f)).ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
public Bitmap RenderTemplate(ushort id, IPalette p)
|
||||
{
|
||||
var template = TileSet.Templates[id];
|
||||
var templateData = templates[id];
|
||||
|
||||
var bitmap = new Bitmap(TileSize * template.Size.X, TileSize * template.Size.Y,
|
||||
PixelFormat.Format8bppIndexed);
|
||||
|
||||
bitmap.Palette = p.AsSystemPalette();
|
||||
|
||||
var data = bitmap.LockBits(bitmap.Bounds(),
|
||||
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
|
||||
|
||||
unsafe
|
||||
{
|
||||
var q = (byte*)data.Scan0.ToPointer();
|
||||
var stride = data.Stride;
|
||||
|
||||
for (var u = 0; u < template.Size.X; u++)
|
||||
{
|
||||
for (var v = 0; v < template.Size.Y; v++)
|
||||
{
|
||||
var rawImage = templateData[u + v * template.Size.X];
|
||||
if (rawImage != null && rawImage.Length > 0)
|
||||
{
|
||||
for (var i = 0; i < TileSize; i++)
|
||||
for (var j = 0; j < TileSize; j++)
|
||||
q[(v * TileSize + j) * stride + u * TileSize + i] = rawImage[i + TileSize * j];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < TileSize; i++)
|
||||
for (var j = 0; j < TileSize; j++)
|
||||
q[(v * TileSize + j) * stride + u * TileSize + i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bitmap.UnlockBits(data);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public byte[][] Data(ushort id)
|
||||
{
|
||||
byte[][] template;
|
||||
if (!templates.TryGetValue(id, out template))
|
||||
{
|
||||
Console.WriteLine("warning: Unknown tile template {0}", id);
|
||||
return null;
|
||||
}
|
||||
|
||||
return template;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,6 @@
|
||||
<Compile Include="Traits\Armor.cs" />
|
||||
<Compile Include="Traits\CreatesShroud.cs" />
|
||||
<Compile Include="Traits\DrawLineToTarget.cs" />
|
||||
<Compile Include="Traits\EditorAppearance.cs" />
|
||||
<Compile Include="Traits\EditorTilesetFilter.cs" />
|
||||
<Compile Include="Traits\Health.cs" />
|
||||
<Compile Include="Traits\LintAttributes.cs" />
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
public class EditorAppearanceInfo : TraitInfo<EditorAppearance>
|
||||
{
|
||||
public readonly bool RelativeToTopLeft = false;
|
||||
public readonly bool UseTerrainPalette = false;
|
||||
}
|
||||
|
||||
public class EditorAppearance { }
|
||||
}
|
||||
@@ -350,10 +350,4 @@ namespace OpenRA.Traits
|
||||
void OnObjectiveCompleted(Player player, int objectiveID);
|
||||
void OnObjectiveFailed(Player player, int objectiveID);
|
||||
}
|
||||
|
||||
public interface ILegacyEditorRenderInfo
|
||||
{
|
||||
string EditorPalette { get; }
|
||||
string EditorImage(ActorInfo actor, SequenceProvider sequenceProvider, string race);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,6 @@ namespace OpenRA.Traits
|
||||
{
|
||||
public class ResourceTypeInfo : ITraitInfo
|
||||
{
|
||||
// HACK: The editor is getting really unmaintanable...
|
||||
public readonly string EditorSprite;
|
||||
|
||||
public readonly string[] Variants = { };
|
||||
public readonly string Palette = "terrain";
|
||||
public readonly string Sequence = "resources";
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
[Desc("Render trait fundament that won't work without additional With* render traits.")]
|
||||
public class RenderSpritesInfo : IRenderActorPreviewInfo, ITraitInfo, ILegacyEditorRenderInfo
|
||||
public class RenderSpritesInfo : IRenderActorPreviewInfo, ITraitInfo
|
||||
{
|
||||
[Desc("The sequence name that defines the actor sprites. Defaults to the actor name.")]
|
||||
public readonly string Image = null;
|
||||
@@ -91,9 +91,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
return (Image ?? actor.Name).ToLowerInvariant();
|
||||
}
|
||||
|
||||
public string EditorPalette { get { return Palette; } }
|
||||
public string EditorImage(ActorInfo actor, SequenceProvider sequenceProvider, string race) { return GetImage(actor, sequenceProvider, race); }
|
||||
}
|
||||
|
||||
public class RenderSprites : IRender, ITick, INotifyOwnerChanged, INotifyEffectiveOwnerChanged
|
||||
|
||||
@@ -1175,6 +1175,20 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
Console.WriteLine("See RA and C&C bridge huts or crates for reference.");
|
||||
}
|
||||
|
||||
// WinForms editor was removed
|
||||
if (engineVersion < 20150620)
|
||||
{
|
||||
if (depth == 0 && node.Value.Nodes.Exists(n => n.Key == "EditorAppearance"))
|
||||
node.Value.Nodes.RemoveAll(n => n.Key == "EditorAppearance");
|
||||
|
||||
if (depth == 1 && node.Value.Nodes.Exists(n => n.Key == "ResourceType"))
|
||||
{
|
||||
var editorSprite = node.Value.Nodes.FirstOrDefault(n => n.Key == "EditorSprite");
|
||||
if (editorSprite != null)
|
||||
node.Value.Nodes.Remove(editorSprite);
|
||||
}
|
||||
}
|
||||
|
||||
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.RA", "OpenRA.Mo
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.Cnc", "OpenRA.Mods.Cnc\OpenRA.Mods.Cnc.csproj", "{2881135D-4D62-493E-8F83-5EEE92CCC6BE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Editor", "OpenRA.Editor\OpenRA.Editor.csproj", "{00038B75-405B-44F5-8691-BD2546DBE224}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Utility", "OpenRA.Utility\OpenRA.Utility.csproj", "{F33337BE-CB69-4B24-850F-07D23E408DDF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Renderer.Null", "OpenRA.Renderer.Null\OpenRA.Renderer.Null.csproj", "{0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}"
|
||||
@@ -101,10 +99,6 @@ Global
|
||||
{2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|x86.Build.0 = Debug|x86
|
||||
{2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|x86.ActiveCfg = Release|x86
|
||||
{2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|x86.Build.0 = Release|x86
|
||||
{00038B75-405B-44F5-8691-BD2546DBE224}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{00038B75-405B-44F5-8691-BD2546DBE224}.Debug|x86.Build.0 = Debug|x86
|
||||
{00038B75-405B-44F5-8691-BD2546DBE224}.Release|x86.ActiveCfg = Release|x86
|
||||
{00038B75-405B-44F5-8691-BD2546DBE224}.Release|x86.Build.0 = Release|x86
|
||||
{F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|x86.Build.0 = Debug|x86
|
||||
{F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|x86.ActiveCfg = Release|x86
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
# launch script (executed by Desura)
|
||||
exec mono OpenRA.Editor.exe "$@"
|
||||
@@ -310,8 +310,6 @@
|
||||
WithInfantryBody:
|
||||
WithDeathAnimation:
|
||||
UseDeathTypeSuffix: false
|
||||
EditorAppearance:
|
||||
UseTerrainPalette: true
|
||||
BodyOrientation:
|
||||
DrawLineToTarget:
|
||||
AutoTarget:
|
||||
@@ -407,8 +405,6 @@
|
||||
NewOwnerVoice: no
|
||||
ActorLostNotification:
|
||||
Notification: BuildingLost
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
ShakeOnDeath:
|
||||
CombatDebugOverlay:
|
||||
Guardable:
|
||||
@@ -459,8 +455,6 @@
|
||||
Dimensions: 1,1
|
||||
Footprint: x
|
||||
RenderBuilding:
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
Tooltip:
|
||||
Name: Civilian Building (Destroyed)
|
||||
GenericVisibility: None
|
||||
@@ -491,16 +485,12 @@
|
||||
-Demolishable:
|
||||
RenderBuilding:
|
||||
Palette: terrain
|
||||
EditorAppearance:
|
||||
UseTerrainPalette: true
|
||||
|
||||
^CivFieldHusk:
|
||||
AppearsOnRadar:
|
||||
Building:
|
||||
Dimensions: 1,1
|
||||
Footprint: _
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
Tooltip:
|
||||
Name: Field (Destroyed)
|
||||
GenericVisibility: None
|
||||
@@ -533,8 +523,6 @@
|
||||
RenderBuildingWall:
|
||||
Palette: staticterrain
|
||||
GivesExperience:
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
AutoTargetIgnore:
|
||||
Sellable:
|
||||
SellSounds: cashturn.aud
|
||||
@@ -554,8 +542,6 @@
|
||||
AppearsOnRadar:
|
||||
RadarColorFromTerrain:
|
||||
Terrain: Tree
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
Health:
|
||||
HP: 500
|
||||
Armor:
|
||||
@@ -577,7 +563,6 @@
|
||||
AppearsOnRadar:
|
||||
RadarColorFromTerrain:
|
||||
Terrain: Tiberium
|
||||
EditorAppearance:
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
@@ -594,8 +579,6 @@
|
||||
AppearsOnRadar:
|
||||
RadarColorFromTerrain:
|
||||
Terrain: Tree
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
BodyOrientation:
|
||||
FrozenUnderFog:
|
||||
StartsRevealed: true
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
ResourceType: 1
|
||||
Palette: staticterrain
|
||||
TerrainType: Tiberium
|
||||
EditorSprite: ti1
|
||||
Variants: ti1,ti2,ti3,ti4,ti5,ti6,ti7,ti8,ti9,ti10,ti11,ti12
|
||||
MaxDensity: 12
|
||||
ValuePerUnit: 35
|
||||
@@ -38,7 +37,6 @@
|
||||
ResourceType: 2
|
||||
Palette: bluetiberium
|
||||
TerrainType: BlueTiberium
|
||||
EditorSprite: bti1
|
||||
Variants: bti1,bti2,bti3,bti4,bti5,bti6,bti7,bti8,bti9,bti10,bti11,bti12
|
||||
MaxDensity: 12
|
||||
ValuePerUnit: 75
|
||||
|
||||
Binary file not shown.
@@ -5,8 +5,6 @@ spicebloom:
|
||||
Footprint: x
|
||||
Dimensions: 1,1
|
||||
AppearsOnRadar:
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
ProximityCaptor:
|
||||
Types: Tree
|
||||
Tooltip:
|
||||
|
||||
@@ -172,8 +172,6 @@
|
||||
HiddenUnderFog:
|
||||
Burns:
|
||||
Interval: 2
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
Tooltip:
|
||||
Name: Destroyed Tower
|
||||
ProximityCaptor:
|
||||
@@ -334,8 +332,6 @@
|
||||
CaptureNotification:
|
||||
ActorLostNotification:
|
||||
Notification: BuildingLost
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
ShakeOnDeath:
|
||||
ProximityCaptor:
|
||||
Types: Building
|
||||
|
||||
@@ -529,8 +529,6 @@ wall:
|
||||
TargetableBuilding:
|
||||
TargetTypes: Ground
|
||||
RenderBuildingWall:
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
AutoTargetIgnore:
|
||||
ProximityCaptor:
|
||||
Types: Wall
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
ResourceType: 1
|
||||
Palette: d2k
|
||||
TerrainType: Spice
|
||||
EditorSprite: spice0.shp
|
||||
Variants: spice
|
||||
MaxDensity: 20
|
||||
ValuePerUnit: 25
|
||||
@@ -144,3 +143,4 @@ EditorWorld:
|
||||
Inherits: ^BaseWorld
|
||||
EditorActorLayer:
|
||||
D2kEditorResourceLayer:
|
||||
|
||||
|
||||
@@ -361,8 +361,6 @@
|
||||
MustBeDestroyed:
|
||||
RequiredForShortGame: true
|
||||
CaptureNotification:
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
ShakeOnDeath:
|
||||
ProximityCaptor:
|
||||
Types: Building
|
||||
@@ -410,9 +408,6 @@
|
||||
RenderBuildingWall:
|
||||
Palette: effect
|
||||
GivesExperience:
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
UseTerrainPalette: false
|
||||
AutoTargetIgnore:
|
||||
ProximityCaptor:
|
||||
Types: Wall
|
||||
@@ -504,8 +499,6 @@
|
||||
Inherits: ^TechBuilding
|
||||
RenderBuilding:
|
||||
Palette: terrain
|
||||
EditorAppearance:
|
||||
UseTerrainPalette: true
|
||||
EditorTilesetFilter:
|
||||
ExcludeTilesets: INTERIOR
|
||||
|
||||
@@ -532,9 +525,6 @@
|
||||
AppearsOnRadar:
|
||||
RadarColorFromTerrain:
|
||||
Terrain: Tree
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
UseTerrainPalette: true
|
||||
ProximityCaptor:
|
||||
Types: Tree
|
||||
Health:
|
||||
@@ -634,9 +624,6 @@
|
||||
AppearsOnRadar:
|
||||
RadarColorFromTerrain:
|
||||
Terrain: Tree
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
UseTerrainPalette: true
|
||||
ProximityCaptor:
|
||||
Types: Tree
|
||||
BodyOrientation:
|
||||
|
||||
@@ -236,9 +236,6 @@ MINE:
|
||||
AppearsOnRadar:
|
||||
RadarColorFromTerrain:
|
||||
Terrain: Ore
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
UseTerrainPalette: true
|
||||
AutoTargetIgnore:
|
||||
BodyOrientation:
|
||||
SeedsResource:
|
||||
@@ -255,9 +252,6 @@ GMINE:
|
||||
AppearsOnRadar:
|
||||
RadarColorFromTerrain:
|
||||
Terrain: Gems
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
UseTerrainPalette: false
|
||||
AutoTargetIgnore:
|
||||
BodyOrientation:
|
||||
SeedsResource:
|
||||
@@ -272,9 +266,6 @@ RAILMINE:
|
||||
Building:
|
||||
Footprint: xx
|
||||
Dimensions: 2,1
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
UseTerrainPalette: false
|
||||
AutoTargetIgnore:
|
||||
BodyOrientation:
|
||||
EditorTilesetFilter:
|
||||
@@ -292,9 +283,6 @@ QUEE:
|
||||
BodyOrientation:
|
||||
EditorTilesetFilter:
|
||||
RequireTilesets: INTERIOR
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
UseTerrainPalette: true
|
||||
|
||||
LAR1:
|
||||
HiddenUnderShroud:
|
||||
@@ -309,9 +297,6 @@ LAR1:
|
||||
BodyOrientation:
|
||||
EditorTilesetFilter:
|
||||
RequireTilesets: INTERIOR
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
UseTerrainPalette: true
|
||||
|
||||
LAR2:
|
||||
HiddenUnderShroud:
|
||||
@@ -326,9 +311,6 @@ LAR2:
|
||||
BodyOrientation:
|
||||
EditorTilesetFilter:
|
||||
RequireTilesets: INTERIOR
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: true
|
||||
UseTerrainPalette: true
|
||||
|
||||
powerproxy.parabombs:
|
||||
AlwaysVisible:
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
ResourceType@ore:
|
||||
ResourceType: 1
|
||||
Palette: player
|
||||
EditorSprite: gold01
|
||||
Variants: gold01,gold02,gold03,gold04
|
||||
MaxDensity: 12
|
||||
ValuePerUnit: 25
|
||||
@@ -77,7 +76,6 @@
|
||||
ResourceType@gem:
|
||||
ResourceType: 2
|
||||
Palette: player
|
||||
EditorSprite: gem01
|
||||
Variants: gem01,gem02,gem03,gem04
|
||||
MaxDensity: 3
|
||||
ValuePerUnit: 50
|
||||
|
||||
@@ -64,8 +64,6 @@
|
||||
RequiredForShortGame: true
|
||||
GivesExperience:
|
||||
CaptureNotification:
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
ShakeOnDeath:
|
||||
ProximityCaptor:
|
||||
Types: Building
|
||||
@@ -165,9 +163,6 @@
|
||||
RenderBuildingWall:
|
||||
Type: wall
|
||||
GivesExperience:
|
||||
EditorAppearance:
|
||||
RelativeToTopLeft: yes
|
||||
UseTerrainPalette: yes
|
||||
AutoTargetIgnore:
|
||||
ProximityCaptor:
|
||||
Types: Wall
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
ResourceType@Tiberium:
|
||||
ResourceType: 1
|
||||
Palette: greentiberium
|
||||
EditorSprite: waypoint # TODO: editor can't handle the real ones
|
||||
Variants: tib01, tib02, tib03, tib04, tib05, tib06, tib07, tib08, tib09, tib10, tib11, tib12, tib13, tib14, tib15, tib16, tib17, tib18, tib19, tib20
|
||||
MaxDensity: 12
|
||||
ValuePerUnit: 50
|
||||
@@ -34,7 +33,6 @@
|
||||
ResourceType@BlueTiberium:
|
||||
ResourceType: 2
|
||||
Palette: bluetiberium
|
||||
EditorSprite: waypoint # TODO: editor can't handle the real ones
|
||||
Variants: tib01, tib02, tib03, tib04, tib05, tib06, tib07, tib08, tib09, tib10, tib11, tib12, tib13, tib14, tib15, tib16, tib17, tib18, tib19, tib20
|
||||
MaxDensity: 12
|
||||
ValuePerUnit: 100
|
||||
@@ -161,3 +159,4 @@ EditorWorld:
|
||||
Inherits: ^BaseWorld
|
||||
EditorActorLayer:
|
||||
EditorResourceLayer:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Version: {VERSION}
|
||||
Architecture: all
|
||||
Maintainer: Chris Forbes <chrisf@ijw.co.nz>
|
||||
Installed-Size: {SIZE}
|
||||
Depends: libopenal1, mono-runtime (>= 2.10), libmono-system-core4.0-cil, libmono-system-drawing4.0-cil, libmono-system-windows-forms4.0-cil, libmono-system-data4.0-cil, libmono-system-numerics4.0-cil, libmono-system-runtime-serialization4.0-cil, libmono-system-xml-linq4.0-cil, libfreetype6, libc6, libasound2, libgl1-mesa-glx, libgl1-mesa-dri, xdg-utils, zenity, libsdl2 | libsdl2-2.0-0, liblua5.1-0
|
||||
Depends: libopenal1, mono-runtime (>= 2.10), libmono-system-core4.0-cil, libmono-system-drawing4.0-cil, libmono-system-data4.0-cil, libmono-system-numerics4.0-cil, libmono-system-runtime-serialization4.0-cil, libmono-system-xml-linq4.0-cil, libfreetype6, libc6, libasound2, libgl1-mesa-glx, libgl1-mesa-dri, xdg-utils, zenity, libsdl2 | libsdl2-2.0-0, liblua5.1-0
|
||||
Section: games
|
||||
Priority: extra
|
||||
Homepage: http://www.openra.net/
|
||||
|
||||
@@ -28,9 +28,6 @@ mv "${DEB_BUILD_ROOT}/usr/bin/" "${DEB_BUILD_ROOT}/usr/games/"
|
||||
sed "s|/usr/bin|/usr/games|g" "${DEB_BUILD_ROOT}/usr/games/openra" > temp
|
||||
mv -f temp "${DEB_BUILD_ROOT}/usr/games/openra"
|
||||
chmod +x "${DEB_BUILD_ROOT}/usr/games/openra"
|
||||
sed "s|/usr/bin|/usr/games|g" "${DEB_BUILD_ROOT}/usr/games/openra-editor" > temp
|
||||
mv -f temp "${DEB_BUILD_ROOT}/usr/games/openra-editor"
|
||||
chmod +x "${DEB_BUILD_ROOT}/usr/games/openra-editor"
|
||||
|
||||
# Put the copyright and changelog in /usr/share/doc/openra/
|
||||
mkdir -p "${DEB_BUILD_ROOT}/${DOCDIR}"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.7 KiB |
@@ -1,10 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=OpenRA Map Editor
|
||||
GenericName=Tile based RTS game map editor
|
||||
Comment=Import legacy maps and create new ones from scratch
|
||||
Icon=openra-editor
|
||||
Exec=openra-editor
|
||||
Terminal=false
|
||||
Categories=Game;StrategyGame;
|
||||
@@ -24,9 +24,8 @@ cp -r $2/* "OpenRA.app/Contents/Resources/" || exit 3
|
||||
# Remove unused icon
|
||||
rm OpenRA.app/Contents/Resources/OpenRA.ico
|
||||
|
||||
# Remove broken WinForms applications
|
||||
# Remove WinForms applications
|
||||
rm OpenRA.app/Contents/Resources/OpenRA.exe
|
||||
rm OpenRA.app/Contents/Resources/OpenRA.Editor.exe
|
||||
|
||||
# Set version string
|
||||
sed "s/{DEV_VERSION}/${1}/" OpenRA.app/Contents/Info.plist > OpenRA.app/Contents/Info.plist.tmp
|
||||
|
||||
@@ -31,7 +31,7 @@ markdown DOCUMENTATION.md > DOCUMENTATION.html
|
||||
markdown Lua-API.md > Lua-API.html
|
||||
|
||||
# List of files that are packaged on all platforms
|
||||
FILES=('OpenRA.Game.exe' 'OpenRA.Game.exe.config' 'OpenRA.Editor.exe' 'OpenRA.Utility.exe' \
|
||||
FILES=('OpenRA.Game.exe' 'OpenRA.Game.exe.config' 'OpenRA.Utility.exe' \
|
||||
'OpenRA.Renderer.Sdl2.dll' 'OpenRA.Renderer.Null.dll' \
|
||||
'lua' 'glsl' 'mods/common' 'mods/ra' 'mods/cnc' 'mods/d2k' 'mods/modchooser' \
|
||||
'AUTHORS' 'COPYING' 'README.html' 'CONTRIBUTING.html' 'DOCUMENTATION.html' 'CHANGELOG.html' \
|
||||
|
||||
@@ -126,17 +126,6 @@ Section "Game" GAME
|
||||
File "${SRCDIR}\glsl\*.vert"
|
||||
SectionEnd
|
||||
|
||||
Section "Editor" EDITOR
|
||||
SetOutPath "$INSTDIR"
|
||||
File "${SRCDIR}\OpenRA.Editor.exe"
|
||||
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\OpenRA Editor.lnk" $OUTDIR\OpenRA.Editor.exe "" \
|
||||
"$OUTDIR\OpenRA.Editor.exe" "" "" "" ""
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
SectionEnd
|
||||
|
||||
SectionGroup /e "Settings"
|
||||
Section "Desktop Shortcut" DESKTOPSHORTCUT
|
||||
SetOutPath "$INSTDIR"
|
||||
@@ -200,7 +189,6 @@ Function ${UN}Clean
|
||||
Delete $INSTDIR\OpenRA.Game.exe
|
||||
Delete $INSTDIR\OpenRA.Game.exe.config
|
||||
Delete $INSTDIR\OpenRA.Utility.exe
|
||||
Delete $INSTDIR\OpenRA.Editor.exe
|
||||
Delete $INSTDIR\OpenRA.Renderer.Null.dll
|
||||
Delete $INSTDIR\OpenRA.Renderer.Sdl2.dll
|
||||
Delete $INSTDIR\ICSharpCode.SharpZipLib.dll
|
||||
@@ -252,8 +240,6 @@ Section "Uninstall"
|
||||
IntCmp $R0 0 gameRunning
|
||||
${nsProcess::FindProcess} "OpenRA.exe" $R0
|
||||
IntCmp $R0 0 gameRunning
|
||||
${nsProcess::FindProcess} "OpenRA.Editor.exe" $R0
|
||||
IntCmp $R0 0 gameRunning
|
||||
${nsProcess::Unload}
|
||||
Call un.Clean
|
||||
Goto end
|
||||
@@ -267,12 +253,10 @@ SectionEnd
|
||||
;Section Descriptions
|
||||
;***************************
|
||||
LangString DESC_GAME ${LANG_ENGLISH} "OpenRA engine, official mods and dependencies"
|
||||
LangString DESC_EDITOR ${LANG_ENGLISH} "OpenRA map editor"
|
||||
LangString DESC_DESKTOPSHORTCUT ${LANG_ENGLISH} "Place shortcut on the Desktop."
|
||||
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${GAME} $(DESC_GAME)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${EDITOR} $(DESC_EDITOR)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${DESKTOPSHORTCUT} $(DESC_DESKTOPSHORTCUT)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
|
||||
Reference in New Issue
Block a user