Add files via upload

This commit is contained in:
Bluzume 2021-09-24 15:53:08 +12:00 committed by GitHub
parent 973ea9ca68
commit 4323c7e74c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 1770 additions and 0 deletions

25
SilicaTilesEditor.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31515.178
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilicaTilesEditor", "SilicaTilesEditor\SilicaTilesEditor.csproj", "{286BE9D8-B723-43A5-A9BA-6769D4FD36DB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{286BE9D8-B723-43A5-A9BA-6769D4FD36DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{286BE9D8-B723-43A5-A9BA-6769D4FD36DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{286BE9D8-B723-43A5-A9BA-6769D4FD36DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{286BE9D8-B723-43A5-A9BA-6769D4FD36DB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1801A7AD-3C83-4942-8E58-8656C9BDDB06}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

310
SilicaTilesEditor/MainForm.Designer.cs generated Normal file
View File

@ -0,0 +1,310 @@

namespace SilicaTilesEditor
{
partial class MainForm
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.toolMenu = new System.Windows.Forms.ToolStrip();
this.fileMenu = new System.Windows.Forms.ToolStripDropDownButton();
this.newItem = new System.Windows.Forms.ToolStripMenuItem();
this.loadItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveItem = new System.Windows.Forms.ToolStripMenuItem();
this.layerMenu = new System.Windows.Forms.ToolStripDropDownButton();
this.overlayLayerOption = new System.Windows.Forms.ToolStripMenuItem();
this.tilesetMenu = new System.Windows.Forms.ToolStripDropDownButton();
this.tileset0 = new System.Windows.Forms.ToolStripMenuItem();
this.tileset1 = new System.Windows.Forms.ToolStripMenuItem();
this.tileset2 = new System.Windows.Forms.ToolStripMenuItem();
this.tileset3 = new System.Windows.Forms.ToolStripMenuItem();
this.tileset4 = new System.Windows.Forms.ToolStripMenuItem();
this.tileset5 = new System.Windows.Forms.ToolStripMenuItem();
this.tileset6 = new System.Windows.Forms.ToolStripMenuItem();
this.tileset7 = new System.Windows.Forms.ToolStripMenuItem();
this.lookingAt = new System.Windows.Forms.Label();
this.layout = new System.Windows.Forms.TableLayoutPanel();
this.selTileId = new System.Windows.Forms.Label();
this.tileSelector = new SilicaTilesEditor.TileSelectorControl();
this.tileList = new SilicaTilesEditor.TileMapEditorControl();
this.toolMenu.SuspendLayout();
this.layout.SuspendLayout();
this.SuspendLayout();
//
// toolMenu
//
this.toolMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileMenu,
this.layerMenu,
this.tilesetMenu});
this.toolMenu.Location = new System.Drawing.Point(0, 0);
this.toolMenu.Name = "toolMenu";
this.toolMenu.Size = new System.Drawing.Size(1107, 25);
this.toolMenu.TabIndex = 0;
this.toolMenu.Text = "MainMenu";
//
// fileMenu
//
this.fileMenu.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.fileMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newItem,
this.loadItem,
this.saveItem});
this.fileMenu.ImageTransparentColor = System.Drawing.Color.Magenta;
this.fileMenu.Name = "fileMenu";
this.fileMenu.Size = new System.Drawing.Size(38, 22);
this.fileMenu.Text = "File";
//
// newItem
//
this.newItem.Name = "newItem";
this.newItem.Size = new System.Drawing.Size(121, 22);
this.newItem.Text = "New File";
this.newItem.Click += new System.EventHandler(this.newItem_Click);
//
// loadItem
//
this.loadItem.Name = "loadItem";
this.loadItem.Size = new System.Drawing.Size(121, 22);
this.loadItem.Text = "Load File";
this.loadItem.Click += new System.EventHandler(this.loadItem_Click);
//
// saveItem
//
this.saveItem.Name = "saveItem";
this.saveItem.Size = new System.Drawing.Size(121, 22);
this.saveItem.Text = "Save File";
//
// layerMenu
//
this.layerMenu.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.layerMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.overlayLayerOption});
this.layerMenu.Image = ((System.Drawing.Image)(resources.GetObject("layerMenu.Image")));
this.layerMenu.ImageTransparentColor = System.Drawing.Color.Magenta;
this.layerMenu.Name = "layerMenu";
this.layerMenu.Size = new System.Drawing.Size(48, 22);
this.layerMenu.Text = "Layer";
//
// overlayLayerOption
//
this.overlayLayerOption.Checked = true;
this.overlayLayerOption.CheckOnClick = true;
this.overlayLayerOption.CheckState = System.Windows.Forms.CheckState.Checked;
this.overlayLayerOption.Name = "overlayLayerOption";
this.overlayLayerOption.Size = new System.Drawing.Size(145, 22);
this.overlayLayerOption.Text = "Overlay Layer";
this.overlayLayerOption.ToolTipText = "Enables the overlay layer";
this.overlayLayerOption.Click += new System.EventHandler(this.overlayLayerOption_Click);
//
// tilesetMenu
//
this.tilesetMenu.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.tilesetMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tileset0,
this.tileset1,
this.tileset2,
this.tileset3,
this.tileset4,
this.tileset5,
this.tileset6,
this.tileset7});
this.tilesetMenu.Image = ((System.Drawing.Image)(resources.GetObject("tilesetMenu.Image")));
this.tilesetMenu.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tilesetMenu.Name = "tilesetMenu";
this.tilesetMenu.Size = new System.Drawing.Size(53, 22);
this.tilesetMenu.Text = "Tileset";
//
// tileset0
//
this.tileset0.Checked = true;
this.tileset0.CheckOnClick = true;
this.tileset0.CheckState = System.Windows.Forms.CheckState.Checked;
this.tileset0.Name = "tileset0";
this.tileset0.Size = new System.Drawing.Size(146, 22);
this.tileset0.Text = "NORM Tileset";
this.tileset0.Click += new System.EventHandler(this.tileset0_Click);
//
// tileset1
//
this.tileset1.CheckOnClick = true;
this.tileset1.Name = "tileset1";
this.tileset1.Size = new System.Drawing.Size(146, 22);
this.tileset1.Text = "SNOW Tileset";
this.tileset1.Click += new System.EventHandler(this.tileset1_Click);
//
// tileset2
//
this.tileset2.CheckOnClick = true;
this.tileset2.Name = "tileset2";
this.tileset2.Size = new System.Drawing.Size(146, 22);
this.tileset2.Text = "SAND Tileset";
this.tileset2.Click += new System.EventHandler(this.tileset2_Click);
//
// tileset3
//
this.tileset3.CheckOnClick = true;
this.tileset3.Name = "tileset3";
this.tileset3.Size = new System.Drawing.Size(146, 22);
this.tileset3.Text = "PIRT Tileset";
this.tileset3.Click += new System.EventHandler(this.tileset3_Click);
//
// tileset4
//
this.tileset4.CheckOnClick = true;
this.tileset4.Name = "tileset4";
this.tileset4.Size = new System.Drawing.Size(146, 22);
this.tileset4.Text = "FLWR Tileset";
this.tileset4.Click += new System.EventHandler(this.tileset4_Click);
//
// tileset5
//
this.tileset5.CheckOnClick = true;
this.tileset5.Name = "tileset5";
this.tileset5.Size = new System.Drawing.Size(146, 22);
this.tileset5.Text = "JNGL Tileset";
this.tileset5.Click += new System.EventHandler(this.tileset5_Click);
//
// tileset6
//
this.tileset6.CheckOnClick = true;
this.tileset6.Name = "tileset6";
this.tileset6.Size = new System.Drawing.Size(146, 22);
this.tileset6.Text = "CLWD Tileset";
this.tileset6.Click += new System.EventHandler(this.tileset6_Click);
//
// tileset7
//
this.tileset7.CheckOnClick = true;
this.tileset7.Name = "tileset7";
this.tileset7.Size = new System.Drawing.Size(146, 22);
this.tileset7.Text = "VOLC Tileset";
this.tileset7.Click += new System.EventHandler(this.tileset7_Click);
//
// lookingAt
//
this.lookingAt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lookingAt.AutoSize = true;
this.lookingAt.Location = new System.Drawing.Point(126, 515);
this.lookingAt.Name = "lookingAt";
this.lookingAt.Size = new System.Drawing.Size(78, 13);
this.lookingAt.TabIndex = 2;
this.lookingAt.Text = "Looking at: 0,0";
//
// layout
//
this.layout.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.layout.ColumnCount = 2;
this.layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 249F));
this.layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.layout.Controls.Add(this.tileSelector, 0, 0);
this.layout.Controls.Add(this.tileList, 1, 0);
this.layout.Location = new System.Drawing.Point(0, 22);
this.layout.Margin = new System.Windows.Forms.Padding(0);
this.layout.Name = "layout";
this.layout.RowCount = 1;
this.layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 487F));
this.layout.Size = new System.Drawing.Size(1107, 487);
this.layout.TabIndex = 4;
//
// selTileId
//
this.selTileId.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.selTileId.AutoSize = true;
this.selTileId.Location = new System.Drawing.Point(12, 515);
this.selTileId.Name = "selTileId";
this.selTileId.Size = new System.Drawing.Size(89, 13);
this.selTileId.TabIndex = 5;
this.selTileId.Text = "Seleted Tile ID: 1";
//
// tileSelector
//
this.tileSelector.AutoScroll = true;
this.tileSelector.AutoScrollMinSize = new System.Drawing.Size(0, 1440);
this.tileSelector.Dock = System.Windows.Forms.DockStyle.Fill;
this.tileSelector.Location = new System.Drawing.Point(3, 3);
this.tileSelector.Name = "tileSelector";
this.tileSelector.Size = new System.Drawing.Size(243, 481);
this.tileSelector.TabIndex = 3;
//
// tileList
//
this.tileList.BackColor = System.Drawing.Color.Blue;
this.tileList.Dock = System.Windows.Forms.DockStyle.Fill;
this.tileList.Location = new System.Drawing.Point(252, 3);
this.tileList.Name = "tileList";
this.tileList.Size = new System.Drawing.Size(852, 481);
this.tileList.TabIndex = 1;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1107, 537);
this.Controls.Add(this.selTileId);
this.Controls.Add(this.layout);
this.Controls.Add(this.lookingAt);
this.Controls.Add(this.toolMenu);
this.Name = "MainForm";
this.Text = "Horse Isle Tile Editor";
this.Load += new System.EventHandler(this.MainForm_Load);
this.toolMenu.ResumeLayout(false);
this.toolMenu.PerformLayout();
this.layout.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolMenu;
private System.Windows.Forms.ToolStripDropDownButton fileMenu;
private System.Windows.Forms.ToolStripMenuItem newItem;
private System.Windows.Forms.ToolStripMenuItem loadItem;
private System.Windows.Forms.ToolStripMenuItem saveItem;
private System.Windows.Forms.ToolStripDropDownButton layerMenu;
private System.Windows.Forms.ToolStripMenuItem overlayLayerOption;
private System.Windows.Forms.ToolStripDropDownButton tilesetMenu;
private System.Windows.Forms.ToolStripMenuItem tileset0;
private System.Windows.Forms.ToolStripMenuItem tileset1;
private System.Windows.Forms.ToolStripMenuItem tileset2;
private System.Windows.Forms.ToolStripMenuItem tileset3;
private System.Windows.Forms.ToolStripMenuItem tileset4;
private System.Windows.Forms.ToolStripMenuItem tileset5;
private System.Windows.Forms.ToolStripMenuItem tileset6;
private System.Windows.Forms.ToolStripMenuItem tileset7;
public System.Windows.Forms.Label lookingAt;
private System.Windows.Forms.TableLayoutPanel layout;
public TileMapEditorControl tileList;
public System.Windows.Forms.Label selTileId;
public TileSelectorControl tileSelector;
}
}

View File

@ -0,0 +1,158 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SilicaTilesEditor
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void newItem_Click(object sender, EventArgs e)
{
}
private void loadItem_Click(object sender, EventArgs e)
{
OpenFileDialog loadFileDg = new OpenFileDialog();
loadFileDg.Filter = "Map Data Files|*.MAP";
loadFileDg.Title = "Select Map File";
if(loadFileDg.ShowDialog() == DialogResult.OK)
{
Map.OpenMap(loadFileDg.FileName);
tileList.UpdateScroll();
tileList.Invalidate();
}
}
private void MainForm_Load(object sender, EventArgs e)
{
Tileset.ReadTerrain();
Tileset.ReadOverlay();
Tileset.ReadExtOverlay();
layout.ColumnStyles[0].Width = (32*7) + SystemInformation.VerticalScrollBarWidth;
tileset0.Checked = true;
tileList.ExtOverlay = 0;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
}
private void overlayLayerOption_Click(object sender, EventArgs e)
{
tileList.DisplayOverlay = overlayLayerOption.Checked;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
tileList.Invalidate();
}
private void UncheckAll()
{
tileset0.Checked = false;
tileset1.Checked = false;
tileset2.Checked = false;
tileset3.Checked = false;
tileset4.Checked = false;
tileset5.Checked = false;
tileset6.Checked = false;
tileset7.Checked = false;
}
private void tileset0_Click(object sender, EventArgs e)
{
UncheckAll();
tileset0.Checked = true;
tileList.ExtOverlay = 0;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
tileList.Invalidate();
}
private void tileset1_Click(object sender, EventArgs e)
{
UncheckAll();
tileset1.Checked = true;
tileList.ExtOverlay = 1;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
tileList.Invalidate();
}
private void tileset2_Click(object sender, EventArgs e)
{
UncheckAll();
tileset2.Checked = true;
tileList.ExtOverlay = 2;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
tileList.Invalidate();
}
private void tileset3_Click(object sender, EventArgs e)
{
UncheckAll();
tileset3.Checked = true;
tileList.ExtOverlay = 3;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
tileList.Invalidate();
}
private void tileset4_Click(object sender, EventArgs e)
{
UncheckAll();
tileset4.Checked = true;
tileList.ExtOverlay = 4;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
tileList.Invalidate();
}
private void tileset5_Click(object sender, EventArgs e)
{
UncheckAll();
tileset5.Checked = true;
tileList.ExtOverlay = 5;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
tileList.Invalidate();
}
private void tileset6_Click(object sender, EventArgs e)
{
UncheckAll();
tileset6.Checked = true;
tileList.ExtOverlay = 6;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
tileList.Invalidate();
}
private void tileset7_Click(object sender, EventArgs e)
{
UncheckAll();
tileset7.Checked = true;
tileList.ExtOverlay = 7;
tileSelector.CalculateScroll();
tileSelector.Invalidate();
tileList.Invalidate();
}
}
}

View File

@ -0,0 +1,157 @@
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="layerMenu.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="tilesetMenu.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
</root>

79
SilicaTilesEditor/Map.cs Normal file
View File

@ -0,0 +1,79 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;
namespace SilicaTilesEditor
{
public static class Map
{
public static string LoadedMap = "";
public static bool MapLoaded = false;
public static int Width;
public static int Height;
public static byte[] MapData;
public static byte[] oMapData;
public static void SetTileId(int x, int y, bool overlay, int tileId)
{
int pos = ((x * Height) + y);
if (!MapLoaded)
return;
if ((pos <= 0 || pos >= oMapData.Length) && overlay)
return;
else if ((pos <= 0 || pos >= MapData.Length) && !overlay)
return;
else if (overlay)
oMapData[pos] = (byte)tileId;
else if (!overlay)
MapData[pos] = (byte)tileId;
else // Not sure how you could even get here.
return;
}
public static int GetTileId(int x, int y, bool overlay)
{
int pos = ((x * Height) + y);
if ((pos <= 0 || pos >= oMapData.Length) && overlay)
return 1;
else if ((pos <= 0 || pos >= MapData.Length) && !overlay)
return 1;
else if (overlay)
return oMapData[pos];
else if (!overlay)
return MapData[pos];
else // Not sure how you could even get here.
return 1;
}
public static void OpenMap(string MapFile)
{
byte[] worldMap = File.ReadAllBytes(MapFile);
Width = BitConverter.ToInt32(worldMap, 0);
Height = BitConverter.ToInt32(worldMap, 4);
MapData = new byte[Width * Height];
oMapData = new byte[Width * Height];
int ii = 8;
for (int i = 0; i < MapData.Length; i++)
{
oMapData[i] = worldMap[ii];
MapData[i] = worldMap[ii + 1];
ii += 2;
}
worldMap = null;
LoadedMap = MapFile;
MapLoaded = true;
}
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SilicaTilesEditor
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
///
public static MainForm form;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
form = new MainForm();
Application.Run(form);
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SilicaTilesEditor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SilicaTilesEditor")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("286be9d8-b723-43a5-a9ba-6769d4fd36db")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,163 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SilicaTilesEditor.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", "16.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("SilicaTilesEditor.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;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap OverlayTileset {
get {
object obj = ResourceManager.GetObject("OverlayTileset", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap TerrainTileset {
get {
object obj = ResourceManager.GetObject("TerrainTileset", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tileset0 {
get {
object obj = ResourceManager.GetObject("Tileset0", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tileset1 {
get {
object obj = ResourceManager.GetObject("Tileset1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tileset2 {
get {
object obj = ResourceManager.GetObject("Tileset2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tileset3 {
get {
object obj = ResourceManager.GetObject("Tileset3", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tileset4 {
get {
object obj = ResourceManager.GetObject("Tileset4", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tileset5 {
get {
object obj = ResourceManager.GetObject("Tileset5", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tileset6 {
get {
object obj = ResourceManager.GetObject("Tileset6", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tileset7 {
get {
object obj = ResourceManager.GetObject("Tileset7", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,151 @@
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="OverlayTileset" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\195_OVERLAY.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TerrainTileset" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\392_TERRAIN.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tileset0" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\405_EXTOVERLAY-NORM.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tileset1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\403_EXTOVERLAY-SNOW.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tileset2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\402_EXTOVERLAY-SAND.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tileset3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\404_EXTOVERLAY-PIRT.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tileset4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\431_EXTOVERLAY-FLWR.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tileset5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\450_EXTOVERLAY-JNGL.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tileset6" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\474_EXTOVERLAY-CLWD.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tileset7" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\473_EXTOVERLAY-VOLC.png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -0,0 +1,29 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SilicaTilesEditor.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?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>

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{286BE9D8-B723-43A5-A9BA-6769D4FD36DB}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>SilicaTilesEditor</RootNamespace>
<AssemblyName>SilicaTilesEditor</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Map.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TileMapEditorControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="TileSelectorControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Tileset.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</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>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="images\392_TERRAIN.png.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\195_OVERLAY.png.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\402_EXTOVERLAY-SAND.png.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\403_EXTOVERLAY-SNOW.png.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\404_EXTOVERLAY-PIRT.png.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\405_EXTOVERLAY-NORM.png.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\431_EXTOVERLAY-FLWR.png.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\450_EXTOVERLAY-JNGL.png.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\473_EXTOVERLAY-VOLC.png.png" />
</ItemGroup>
<ItemGroup>
<None Include="images\474_EXTOVERLAY-CLWD.png.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,155 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace SilicaTilesEditor
{
public class TileMapEditorControl : Panel
{
public bool DisplayOverlay = true;
public int ExtOverlay = 0;
public int SelTileX = 0;
public int SelTileY = 0;
private int selectedTileX = 0;
private int selectedTileY = 0;
public TileMapEditorControl()
{
this.DoubleBuffered = true;
this.VerticalScroll.SmallChange = 32;
this.HorizontalScroll.SmallChange = 32;
}
protected override void OnMouseMove(MouseEventArgs e)
{
int oldSelTileX = SelTileX;
int oldSelTileY = SelTileY;
int tinyOffsetX = (this.HorizontalScroll.Value % 32);
int tinyOffsetY = (this.VerticalScroll.Value % 32);
SelTileX = Convert.ToInt32(Math.Floor((float)(e.X + tinyOffsetX) / 32.0));
SelTileY = Convert.ToInt32(Math.Floor((float)(e.Y + tinyOffsetY) / 32.0));
selectedTileX = Convert.ToInt32(Math.Floor((float)HorizontalScroll.Value / 32.0)) + SelTileX;
selectedTileY = Convert.ToInt32(Math.Floor((float)VerticalScroll.Value / 32.0)) + SelTileY;
if (!(oldSelTileX == SelTileX && oldSelTileY == SelTileY))
{
if (e.Button == MouseButtons.Left)
OnMouseDown(e);
this.Invalidate();
if(Map.MapLoaded)
Program.form.lookingAt.Text = "Looking at: " + selectedTileX + "," + selectedTileY + "(" + Map.GetTileId(selectedTileX, selectedTileY, false) + ":" + Map.GetTileId(selectedTileX, selectedTileY, true) + ")";
}
}
public void UpdateScroll()
{
this.AutoScroll = true;
this.AutoScrollMinSize = new Size(Map.Width * 32, Map.Height * 32);
}
protected override void OnSizeChanged(EventArgs e)
{
this.Invalidate();
}
protected override void OnScroll(ScrollEventArgs se)
{
this.Invalidate();
}
protected override void OnMouseDown(MouseEventArgs e)
{
Map.SetTileId(selectedTileX, selectedTileY, DisplayOverlay, Program.form.tileSelector.SelectedTileid);
this.Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.Clear(Color.Blue);
int offsetX = (this.HorizontalScroll.Value / 32);
int offsetY = (this.VerticalScroll.Value / 32);
int tinyOffsetX = (this.HorizontalScroll.Value % 32);
int tinyOffsetY = (this.VerticalScroll.Value % 32);
int tlistHeight = (this.Size.Height / 32)+ 1;
int tlistWidth = (this.Size.Width / 32) + 1;
int rH = this.Size.Height;
int rW = this.Size.Width;
int relX;
int relY = 0;
if (Map.MapLoaded)
{
for (int y = offsetY; y < (tlistHeight + offsetY)+1; y++)
{
relX = -1;
for (int x = offsetX; x < (tlistWidth + offsetX)+1; x++)
{
relX++;
int tileId = Map.GetTileId(x, y, false) - 1;
Bitmap Tile = Tileset.TerrainList[tileId];
if (Tile == null)
continue;
g.DrawImageUnscaled(Tile, (relX * 32) - tinyOffsetX, (relY * 32) - tinyOffsetY);
}
relY++;
}
if (DisplayOverlay)
{
relX = 0;
relY = 0;
for (int y = offsetY; y < (tlistHeight + offsetY) + 1; y++)
{
relX = -1;
for (int x = offsetX; x < (tlistWidth + offsetX) + 1; x++)
{
relX++;
int tileId = Map.GetTileId(x, y, true) - 1;
Bitmap Tile = null;
if (tileId >= Tileset.OverlayList.Length)
{
tileId -= Tileset.OverlayList.Length;
Tile = Tileset.GetTileset(ExtOverlay)[tileId];
}
else
{
Tile = Tileset.OverlayList[tileId];
}
if (Tile == null)
continue;
g.DrawImageUnscaled(Tile, (relX * 32) - tinyOffsetX, (relY * 32) - tinyOffsetY);
}
relY++;
}
}
}
Pen p = new Pen(Color.Black);
Pen wp = new Pen(Color.Aqua,3);
for (int x = 0; x <= rW; x += 32)
g.DrawLine(p, (x - tinyOffsetX), 0, (x - tinyOffsetX), rH);
for (int y = 0; y <= rH; y += 32)
g.DrawLine(p, 0, (y - tinyOffsetY), rW, (y - tinyOffsetY));
// Highlight selected tile
int exactX = (SelTileX*32) - tinyOffsetX;
int exactY = (SelTileY*32) - tinyOffsetY;
if(!DisplayOverlay)
g.DrawRectangle(wp, exactX, exactY, 32, 32);
else
g.DrawRectangle(wp, exactX, exactY, 32, 48);
g.Flush();
}
}
}

View File

@ -0,0 +1,199 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace SilicaTilesEditor
{
public class TileSelectorControl : Panel
{
public TileSelectorControl()
{
this.DoubleBuffered = true;
}
int SelTileX = 0;
int SelTileY = 0;
public int SelectedTileid = 1;
protected override void OnMouseClick(MouseEventArgs e)
{
int rW = (this.Size.Width - SystemInformation.VerticalScrollBarWidth);
int maxX = (rW / 32)+1;
int oldSelTileX = SelTileX;
int oldSelTileY = SelTileY;
int tinyOffsetY = (this.VerticalScroll.Value % 32);
if (Program.form.tileList.DisplayOverlay)
tinyOffsetY = (this.VerticalScroll.Value % 48);
SelTileX = Convert.ToInt32(Math.Floor((float)e.X / 32.0));
if (!Program.form.tileList.DisplayOverlay)
SelTileY = Convert.ToInt32(Math.Floor((float)VerticalScroll.Value / 32.0)) + Convert.ToInt32(Math.Floor((float)(e.Y + tinyOffsetY) / 32.0));
else
SelTileY = Convert.ToInt32(Math.Floor((float)VerticalScroll.Value / 48.0)) + Convert.ToInt32(Math.Floor((float)(e.Y + tinyOffsetY) / 48.0));
SelectedTileid = ((SelTileY * maxX) + SelTileX) + 1;
if(SelectedTileid > 0xFF)
{
SelectedTileid = 0xFF;
SelTileX = (SelectedTileid % maxX) -1;
SelTileY = SelectedTileid / maxX;
}
if (!(oldSelTileX == SelTileX && oldSelTileY == SelTileY))
{
Program.form.selTileId.Text = "Seleted Tile ID: " + SelectedTileid;
this.Invalidate();
}
}
protected override void OnSizeChanged(EventArgs e)
{
this.Invalidate();
}
protected override void OnScroll(ScrollEventArgs se)
{
this.Invalidate();
}
public void CalculateScroll()
{
int rW = (this.Size.Width - SystemInformation.VerticalScrollBarWidth);
int x = 0;
int y = 0;
int maxX = rW / 32;
Bitmap[] tileset = Tileset.TerrainList;
if (Program.form.tileList.DisplayOverlay)
tileset = Tileset.JoinedTileset;
int addFinal = tileset.Length % maxX;
int tilewidth = 32;
int tileheight = 32;
if (Program.form.tileList.DisplayOverlay)
tileheight = 48;
for (int i = 0; i < tileset.Length; i++)
{
Bitmap tile = tileset[i];
if (tile != null)
{
tilewidth = tile.Width;
tileheight = tile.Height;
}
x += tilewidth;
if (x > (maxX * tilewidth))
{
x = 0;
y += tileheight;
}
}
if (addFinal != 0)
y += tileheight;
AutoScroll = false;
AutoScrollMinSize = new Size(0, y);
AutoScroll = true;
if (Program.form.tileList.DisplayOverlay)
VerticalScroll.SmallChange = 32;
else
VerticalScroll.SmallChange = 48;
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
if (!Program.form.tileList.DisplayOverlay)
g.Clear(Color.Blue);
else
g.Clear(Color.Magenta);
int rH = this.Size.Height;
int rW = (this.Size.Width - SystemInformation.VerticalScrollBarWidth);
int offsetY = (this.VerticalScroll.Value / 32);
int tinyOffsetY = (this.VerticalScroll.Value % 32);
if (Program.form.tileList.DisplayOverlay)
{
offsetY = (this.VerticalScroll.Value / 48);
tinyOffsetY = (this.VerticalScroll.Value % 48);
}
int x = 0;
int y = 0;
int maxX = rW / 32;
int window = (offsetY * (maxX + 1));
Bitmap[] tileset = Tileset.TerrainList;
if (Program.form.tileList.DisplayOverlay)
tileset = Tileset.JoinedTileset;
for (int i = window; i < tileset.Length; i++)
{
int tilewidth = 32;
int tileheight = 32;
if (Program.form.tileList.DisplayOverlay)
tileheight = 48;
Bitmap tile = tileset[i];
if(tile != null)
{
g.DrawImageUnscaled(tile, x, y - tinyOffsetY);
tilewidth = tile.Width;
tileheight = tile.Height;
}
x += tilewidth;
if(x > (maxX*tilewidth))
{
x = 0;
y+=tileheight;
}
}
Pen p = new Pen(Color.Black);
Pen wp = new Pen(Color.Aqua, 3);
for (x = 0; x <= rW; x += 32)
g.DrawLine(p, x, 0, x, rH);
if (!Program.form.tileList.DisplayOverlay)
{
for (y = 0; y <= rH; y += 32)
g.DrawLine(p, 0, (y - tinyOffsetY), rW, (y - tinyOffsetY));
}
else
{
for (y = 0; y <= rH; y += 48)
g.DrawLine(p, 0, (y - tinyOffsetY), rW, (y - tinyOffsetY));
}
// Highlight selected tile
int exactX = (SelTileX * 32);
int exactY = 0;
if (!Program.form.tileList.DisplayOverlay)
exactY = (SelTileY * 32) - VerticalScroll.Value;
else
exactY = (SelTileY * 48) - VerticalScroll.Value;
if (!Program.form.tileList.DisplayOverlay)
g.DrawRectangle(wp, exactX, exactY, 32, 32);
else
g.DrawRectangle(wp, exactX, exactY, 32, 48);
}
}
}

View File

@ -0,0 +1,144 @@
using SilicaTilesEditor.Properties;
using System;
using System.Drawing;
namespace SilicaTilesEditor
{
class Tileset
{
public static Bitmap[] TerrainList = new Bitmap[((Resources.TerrainTileset.Height / 32) * (Resources.TerrainTileset.Width / 32)) + 1];
public static Bitmap[] OverlayList = new Bitmap[193];
public static Bitmap[] ExtOverlays = new Bitmap[8] { Resources.Tileset0, Resources.Tileset1, Resources.Tileset2, Resources.Tileset3, Resources.Tileset4, Resources.Tileset5, Resources.Tileset6, Resources.Tileset7 };
public static Bitmap[] ExtNorm = new Bitmap[((Resources.Tileset0.Height / 48) * (Resources.Tileset0.Width / 32)) + 1];
public static Bitmap[] ExtSnow = new Bitmap[((Resources.Tileset1.Height / 48) * (Resources.Tileset1.Width / 32)) + 1];
public static Bitmap[] ExtSand = new Bitmap[((Resources.Tileset2.Height / 48) * (Resources.Tileset2.Width / 32)) + 1];
public static Bitmap[] ExtPirt = new Bitmap[((Resources.Tileset3.Height / 48) * (Resources.Tileset3.Width / 32)) + 1];
public static Bitmap[] ExtFlwr = new Bitmap[((Resources.Tileset4.Height / 48) * (Resources.Tileset4.Width / 32)) + 1];
public static Bitmap[] ExtJngl = new Bitmap[((Resources.Tileset5.Height / 48) * (Resources.Tileset5.Width / 32)) + 1];
public static Bitmap[] ExtClwd = new Bitmap[((Resources.Tileset6.Height / 48) * (Resources.Tileset6.Width / 32)) + 1];
public static Bitmap[] ExtVolc = new Bitmap[((Resources.Tileset7.Height / 48) * (Resources.Tileset7.Width / 32)) + 1];
public static Bitmap[] JoinedTileset
{
get
{
Bitmap[] ExtOverlaySet = GetTileset(Program.form.tileList.ExtOverlay);
int sz = OverlayList.Length + ExtOverlaySet.Length;
if (sz > 0xFF)
sz = 0xFF;
Bitmap[] arr = new Bitmap[sz];
int i = 0;
for(i = 0; i < OverlayList.Length; i++)
{
arr[i] = OverlayList[i];
}
for (int ii = 0; ii < ExtOverlaySet.Length; ii++)
{
arr[i] = ExtOverlaySet[ii];
i++;
if (i >= 0xFF)
break;
}
return arr;
}
}
public static Boolean ReadAllTerrain = false;
public static Boolean ReadAllOverlay = false;
public static void CopyRegionIntoImage(Bitmap srcBitmap, Rectangle srcRegion, Bitmap destBitmap, Rectangle destRegion)
{
using (Graphics grD = Graphics.FromImage(destBitmap))
{
grD.DrawImage(srcBitmap, destRegion, srcRegion, GraphicsUnit.Pixel);
}
}
public static Bitmap[] GetTileset(int numb)
{
switch(numb)
{
case 0:
return ExtNorm;
case 1:
return ExtSnow;
case 2:
return ExtSand;
case 3:
return ExtPirt;
case 4:
return ExtFlwr;
case 5:
return ExtJngl;
case 6:
return ExtClwd;
case 7:
return ExtVolc;
default:
return ExtNorm;
}
}
public static void ReadTerrain()
{
Console.WriteLine("Reading Terrain.png...");
int i = 0;
for (int y = 0; y < (Resources.TerrainTileset.Height/32); y++)
{
for (int x = 0; x < (Resources.TerrainTileset.Width / 32); x++)
{
i++;
TerrainList[i] = new Bitmap(32, 32);
int posx = x * 32;
int posy = y * 32;
CopyRegionIntoImage(Resources.TerrainTileset, new Rectangle(posx, posy, 32, 32), TerrainList[i], new Rectangle(0, 0, 32, 32));
}
}
ReadAllTerrain = true;
}
public static void ReadExtOverlay()
{
for(int picid = 0; picid <= 7; picid++)
{
Bitmap[] TilesetList = GetTileset(picid);
Bitmap Tileset = ExtOverlays[picid];
Console.WriteLine("Reading Overlay"+ picid.ToString()+".png...");
int i = 0;
for (int y = 0; y < (Tileset.Height / 48); y++)
{
for (int x = 0; x < (Tileset.Width / 32); x++)
{
i++;
TilesetList[i] = new Bitmap(32, 48);
int posx = x * 32;
int posy = y * 48;
CopyRegionIntoImage(Tileset, new Rectangle(posx, posy, 32, 48), TilesetList[i], new Rectangle(0, 0, 32, 48));
}
}
Console.WriteLine("Total Tiles Read: " + i.ToString());
}
}
public static void ReadOverlay()
{
Console.WriteLine("Reading Overlay.png...");
int i = 0;
int OVERLAY_SIZE = 24;
for (int y = 0; y < OVERLAY_SIZE; y++)
{
for (int x = 0; x < (Resources.OverlayTileset.Width / 32); x++)
{
i++;
OverlayList[i] = new Bitmap(32, 48);
int posx = x * 32;
int posy = y * 48;
CopyRegionIntoImage(Resources.OverlayTileset, new Rectangle(posx, posy, 32, 48), OverlayList[i], new Rectangle(0, 0, 32, 48));
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB