mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-05 01:27:18 +00:00
Merge 'main' into https://github.com/PhoenixARC/-PCK-Studio/tree/main
This commit is contained in:
34
PCK-Studio/Classes/Utils/ImageUtils.cs
Normal file
34
PCK-Studio/Classes/Utils/ImageUtils.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace PckStudio.Classes.Utils
|
||||
{
|
||||
internal class ImageUtils
|
||||
{
|
||||
public static IEnumerable<Image> CreateImageList(Image source, int size)
|
||||
{
|
||||
int img_row_count = source.Width / size;
|
||||
int img_column_count = source.Height / size;
|
||||
Debug.WriteLine($"{source.Width} {source.Height} {size} {size} {img_column_count} {img_row_count}");
|
||||
for (int i = 0; i < img_column_count * img_row_count; i++)
|
||||
{
|
||||
int row = i / img_row_count;
|
||||
int column = i % img_row_count;
|
||||
Rectangle tileArea = new Rectangle(new Point(column * size, row * size), new Size(size, size));
|
||||
Bitmap tileImage = new Bitmap(size, size);
|
||||
using (Graphics gfx = Graphics.FromImage(tileImage))
|
||||
{
|
||||
gfx.SmoothingMode = SmoothingMode.None;
|
||||
gfx.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
gfx.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
|
||||
gfx.DrawImage(source, new Rectangle(0, 0, size, size), tileArea, GraphicsUnit.Pixel);
|
||||
}
|
||||
yield return tileImage;
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
185
PCK-Studio/Forms/Additional-Popups/Behaviours/AddBehaviour.Designer.cs
generated
Normal file
185
PCK-Studio/Forms/Additional-Popups/Behaviours/AddBehaviour.Designer.cs
generated
Normal file
@@ -0,0 +1,185 @@
|
||||
namespace PckStudio.Forms.Additional_Popups.Behaviours
|
||||
{
|
||||
partial class AddBehaviour
|
||||
{
|
||||
/// <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.acceptBtn = new System.Windows.Forms.Button();
|
||||
this.CancelBtn = new System.Windows.Forms.Button();
|
||||
this.treeViewEntity = new System.Windows.Forms.TreeView();
|
||||
this.metroLabel2 = new MetroFramework.Controls.MetroLabel();
|
||||
this.metroTextBox1 = new MetroFramework.Controls.MetroTextBox();
|
||||
this.metroTabControl1 = new MetroFramework.Controls.MetroTabControl();
|
||||
this.Blocks = new System.Windows.Forms.TabPage();
|
||||
this.metroTabControl1.SuspendLayout();
|
||||
this.Blocks.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// acceptBtn
|
||||
//
|
||||
this.acceptBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.acceptBtn.ForeColor = System.Drawing.Color.White;
|
||||
this.acceptBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.acceptBtn.Location = new System.Drawing.Point(92, 196);
|
||||
this.acceptBtn.Name = "acceptBtn";
|
||||
this.acceptBtn.Size = new System.Drawing.Size(75, 23);
|
||||
this.acceptBtn.TabIndex = 7;
|
||||
this.acceptBtn.Text = "Add";
|
||||
this.acceptBtn.UseVisualStyleBackColor = true;
|
||||
this.acceptBtn.Click += new System.EventHandler(this.AcceptBtn_Click);
|
||||
//
|
||||
// CancelBtn
|
||||
//
|
||||
this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.CancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.CancelBtn.ForeColor = System.Drawing.Color.White;
|
||||
this.CancelBtn.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.CancelBtn.Location = new System.Drawing.Point(172, 196);
|
||||
this.CancelBtn.Name = "CancelBtn";
|
||||
this.CancelBtn.Size = new System.Drawing.Size(75, 23);
|
||||
this.CancelBtn.TabIndex = 13;
|
||||
this.CancelBtn.Text = "Cancel";
|
||||
this.CancelBtn.UseVisualStyleBackColor = true;
|
||||
this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click);
|
||||
//
|
||||
// treeViewEntity
|
||||
//
|
||||
this.treeViewEntity.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.treeViewEntity.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.treeViewEntity.ForeColor = System.Drawing.Color.White;
|
||||
this.treeViewEntity.Location = new System.Drawing.Point(0, 0);
|
||||
this.treeViewEntity.Name = "treeViewEntity";
|
||||
this.treeViewEntity.Size = new System.Drawing.Size(318, 142);
|
||||
this.treeViewEntity.TabIndex = 14;
|
||||
this.treeViewEntity.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViews_AfterSelect);
|
||||
//
|
||||
// metroLabel2
|
||||
//
|
||||
this.metroLabel2.AutoSize = true;
|
||||
this.metroLabel2.Location = new System.Drawing.Point(133, 19);
|
||||
this.metroLabel2.Name = "metroLabel2";
|
||||
this.metroLabel2.Size = new System.Drawing.Size(46, 19);
|
||||
this.metroLabel2.TabIndex = 16;
|
||||
this.metroLabel2.Text = "Filter: ";
|
||||
this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// metroTextBox1
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
this.metroTextBox1.CustomButton.Image = null;
|
||||
this.metroTextBox1.CustomButton.Location = new System.Drawing.Point(134, 1);
|
||||
this.metroTextBox1.CustomButton.Name = "";
|
||||
this.metroTextBox1.CustomButton.Size = new System.Drawing.Size(21, 21);
|
||||
this.metroTextBox1.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
|
||||
this.metroTextBox1.CustomButton.TabIndex = 1;
|
||||
this.metroTextBox1.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
|
||||
this.metroTextBox1.CustomButton.UseSelectable = true;
|
||||
this.metroTextBox1.CustomButton.Visible = false;
|
||||
this.metroTextBox1.Lines = new string[0];
|
||||
this.metroTextBox1.Location = new System.Drawing.Point(173, 18);
|
||||
this.metroTextBox1.MaxLength = 32767;
|
||||
this.metroTextBox1.Name = "metroTextBox1";
|
||||
this.metroTextBox1.PasswordChar = '\0';
|
||||
this.metroTextBox1.ScrollBars = System.Windows.Forms.ScrollBars.None;
|
||||
this.metroTextBox1.SelectedText = "";
|
||||
this.metroTextBox1.SelectionLength = 0;
|
||||
this.metroTextBox1.SelectionStart = 0;
|
||||
this.metroTextBox1.ShortcutsEnabled = true;
|
||||
this.metroTextBox1.Size = new System.Drawing.Size(156, 23);
|
||||
this.metroTextBox1.TabIndex = 17;
|
||||
this.metroTextBox1.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.metroTextBox1.UseSelectable = true;
|
||||
this.metroTextBox1.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
|
||||
this.metroTextBox1.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
|
||||
this.metroTextBox1.TextChanged += new System.EventHandler(this.filter_TextChanged);
|
||||
//
|
||||
// metroTabControl1
|
||||
//
|
||||
this.metroTabControl1.Controls.Add(this.Blocks);
|
||||
this.metroTabControl1.Location = new System.Drawing.Point(6, 8);
|
||||
this.metroTabControl1.Name = "metroTabControl1";
|
||||
this.metroTabControl1.SelectedIndex = 0;
|
||||
this.metroTabControl1.Size = new System.Drawing.Size(326, 184);
|
||||
this.metroTabControl1.Style = MetroFramework.MetroColorStyle.White;
|
||||
this.metroTabControl1.TabIndex = 18;
|
||||
this.metroTabControl1.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.metroTabControl1.UseSelectable = true;
|
||||
//
|
||||
// Blocks
|
||||
//
|
||||
this.Blocks.BackColor = System.Drawing.SystemColors.WindowFrame;
|
||||
this.Blocks.Controls.Add(this.treeViewEntity);
|
||||
this.Blocks.Location = new System.Drawing.Point(4, 38);
|
||||
this.Blocks.Name = "Blocks";
|
||||
this.Blocks.Size = new System.Drawing.Size(318, 142);
|
||||
this.Blocks.TabIndex = 0;
|
||||
this.Blocks.Text = "Entities";
|
||||
//
|
||||
// AddBehaviour
|
||||
//
|
||||
this.AcceptButton = this.acceptBtn;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.CancelBtn;
|
||||
this.ClientSize = new System.Drawing.Size(338, 228);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.metroTextBox1);
|
||||
this.Controls.Add(this.metroLabel2);
|
||||
this.Controls.Add(this.metroTabControl1);
|
||||
this.Controls.Add(this.CancelBtn);
|
||||
this.Controls.Add(this.acceptBtn);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "AddBehaviour";
|
||||
this.Resizable = false;
|
||||
this.Style = MetroFramework.MetroColorStyle.Silver;
|
||||
this.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.metroTabControl1.ResumeLayout(false);
|
||||
this.Blocks.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
private void MetroTextBox1_TextChanged(object sender, System.EventArgs e)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Button CancelBtn;
|
||||
private System.Windows.Forms.TreeView treeViewEntity;
|
||||
private MetroFramework.Controls.MetroLabel metroLabel2;
|
||||
private MetroFramework.Controls.MetroTextBox metroTextBox1;
|
||||
private MetroFramework.Controls.MetroTabControl metroTabControl1;
|
||||
private System.Windows.Forms.TabPage Blocks;
|
||||
public System.Windows.Forms.Button acceptBtn;
|
||||
}
|
||||
}
|
||||
112
PCK-Studio/Forms/Additional-Popups/Behaviours/AddBehaviour.cs
Normal file
112
PCK-Studio/Forms/Additional-Popups/Behaviours/AddBehaviour.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using MetroFramework.Forms;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PckStudio.Forms.Utilities;
|
||||
|
||||
namespace PckStudio.Forms.Additional_Popups.Behaviours
|
||||
{
|
||||
public partial class AddBehaviour : MetroForm
|
||||
{
|
||||
string selectedEntity = "";
|
||||
|
||||
public string SelectedEntity => selectedEntity;
|
||||
|
||||
List<TreeNode> treeViewEntityCache = new List<TreeNode>();
|
||||
|
||||
public AddBehaviour()
|
||||
{
|
||||
InitializeComponent();
|
||||
ImageList entities = new ImageList();
|
||||
entities.ColorDepth = ColorDepth.Depth32Bit;
|
||||
entities.ImageSize = new System.Drawing.Size(32, 32);
|
||||
entities.Images.AddRange(BehaviourUtil.entityImages);
|
||||
treeViewEntity.ImageList = entities;
|
||||
|
||||
try
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (BehaviourUtil.entityData["entities"] != null)
|
||||
{
|
||||
foreach (JObject content in BehaviourUtil.entityData["entities"].Children())
|
||||
{
|
||||
foreach (JProperty prop in content.Properties())
|
||||
{
|
||||
if (!string.IsNullOrEmpty((string)prop.Value))
|
||||
{
|
||||
TreeNode entityNode = new TreeNode((string)prop.Value)
|
||||
{
|
||||
Tag = prop.Name,
|
||||
ImageIndex = i,
|
||||
SelectedImageIndex = i,
|
||||
};
|
||||
treeViewEntity.Nodes.Add(entityNode);
|
||||
treeViewEntityCache.Add(entityNode);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Newtonsoft.Json.JsonException j_ex)
|
||||
{
|
||||
MessageBox.Show(j_ex.Message, "Error");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void treeViews_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
if (e.Node.Tag is string entityData)
|
||||
{
|
||||
selectedEntity = entityData;
|
||||
Console.WriteLine(selectedEntity);
|
||||
}
|
||||
}
|
||||
|
||||
void filter_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
// Some code in this function is modified code from this StackOverflow answer - MattNL
|
||||
//https://stackoverflow.com/questions/8260322/filter-a-treeview-with-a-textbox-in-a-c-sharp-winforms-app
|
||||
|
||||
//blocks repainting tree until all objects loaded
|
||||
treeViewEntity.BeginUpdate();
|
||||
treeViewEntity.Nodes.Clear();
|
||||
if (!string.IsNullOrEmpty(metroTextBox1.Text))
|
||||
{
|
||||
foreach (TreeNode _node in treeViewEntityCache)
|
||||
{
|
||||
if (_node.Text.ToLower().Contains(metroTextBox1.Text.ToLower()) ||
|
||||
(_node.Tag as string).ToLower().Contains(metroTextBox1.Text.ToLower()))
|
||||
{
|
||||
treeViewEntity.Nodes.Add((TreeNode)_node.Clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (TreeNode _node in treeViewEntityCache)
|
||||
{
|
||||
treeViewEntity.Nodes.Add((TreeNode)_node.Clone());
|
||||
}
|
||||
}
|
||||
//enables redrawing tree after all objects have been added
|
||||
treeViewEntity.EndUpdate();
|
||||
}
|
||||
|
||||
private void CancelBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void AcceptBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(selectedEntity)) CancelBtn_Click(sender, e);
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
PCK-Studio/Forms/Additional-Popups/Behaviours/AddBehaviour.resx
Normal file
120
PCK-Studio/Forms/Additional-Popups/Behaviours/AddBehaviour.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
</root>
|
||||
36
PCK-Studio/Forms/Editor/BehaviourEditor.Designer.cs
generated
36
PCK-Studio/Forms/Editor/BehaviourEditor.Designer.cs
generated
@@ -66,7 +66,7 @@
|
||||
this.treeView1.Location = new System.Drawing.Point(20, 84);
|
||||
this.treeView1.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.treeView1.Name = "treeView1";
|
||||
this.treeView1.Size = new System.Drawing.Size(128, 176);
|
||||
this.treeView1.Size = new System.Drawing.Size(186, 176);
|
||||
this.treeView1.TabIndex = 13;
|
||||
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
|
||||
this.treeView1.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick);
|
||||
@@ -80,7 +80,7 @@
|
||||
this.renameToolStripMenuItem,
|
||||
this.removeToolStripMenuItem});
|
||||
this.metroContextMenu1.Name = "metroContextMenu1";
|
||||
this.metroContextMenu1.Size = new System.Drawing.Size(118, 70);
|
||||
this.metroContextMenu1.Size = new System.Drawing.Size(181, 92);
|
||||
//
|
||||
// addToolStripMenuItem
|
||||
//
|
||||
@@ -88,7 +88,7 @@
|
||||
this.addNewEntryToolStripMenuItem,
|
||||
this.addNewPositionOverrideToolStripMenuItem});
|
||||
this.addToolStripMenuItem.Name = "addToolStripMenuItem";
|
||||
this.addToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
|
||||
this.addToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.addToolStripMenuItem.Text = "Add";
|
||||
//
|
||||
// addNewEntryToolStripMenuItem
|
||||
@@ -108,14 +108,14 @@
|
||||
// renameToolStripMenuItem
|
||||
//
|
||||
this.renameToolStripMenuItem.Name = "renameToolStripMenuItem";
|
||||
this.renameToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
|
||||
this.renameToolStripMenuItem.Text = "Rename";
|
||||
this.renameToolStripMenuItem.Click += new System.EventHandler(this.renameToolStripMenuItem_Click);
|
||||
this.renameToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.renameToolStripMenuItem.Text = "Change";
|
||||
this.renameToolStripMenuItem.Click += new System.EventHandler(this.changeToolStripMenuItem_Click);
|
||||
//
|
||||
// removeToolStripMenuItem
|
||||
//
|
||||
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
|
||||
this.removeToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
|
||||
this.removeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.removeToolStripMenuItem.Text = "Remove";
|
||||
this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);
|
||||
//
|
||||
@@ -128,7 +128,7 @@
|
||||
this.helpToolStripMenuItem});
|
||||
this.menuStrip.Location = new System.Drawing.Point(20, 60);
|
||||
this.menuStrip.Name = "menuStrip";
|
||||
this.menuStrip.Size = new System.Drawing.Size(274, 24);
|
||||
this.menuStrip.Size = new System.Drawing.Size(309, 24);
|
||||
this.menuStrip.TabIndex = 14;
|
||||
this.menuStrip.Text = "menuStrip1";
|
||||
//
|
||||
@@ -145,7 +145,7 @@
|
||||
//
|
||||
this.saveToolStripMenuItem1.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem1.Image")));
|
||||
this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1";
|
||||
this.saveToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
|
||||
this.saveToolStripMenuItem1.Size = new System.Drawing.Size(98, 22);
|
||||
this.saveToolStripMenuItem1.Text = "Save";
|
||||
this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click);
|
||||
//
|
||||
@@ -160,7 +160,7 @@
|
||||
//
|
||||
this.flag1Checkbox.AutoSize = true;
|
||||
this.flag1Checkbox.Enabled = false;
|
||||
this.flag1Checkbox.Location = new System.Drawing.Point(174, 109);
|
||||
this.flag1Checkbox.Location = new System.Drawing.Point(221, 104);
|
||||
this.flag1Checkbox.Name = "flag1Checkbox";
|
||||
this.flag1Checkbox.Size = new System.Drawing.Size(96, 15);
|
||||
this.flag1Checkbox.TabIndex = 22;
|
||||
@@ -173,7 +173,7 @@
|
||||
//
|
||||
this.flag2Checkbox.AutoSize = true;
|
||||
this.flag2Checkbox.Enabled = false;
|
||||
this.flag2Checkbox.Location = new System.Drawing.Point(174, 141);
|
||||
this.flag2Checkbox.Location = new System.Drawing.Point(221, 136);
|
||||
this.flag2Checkbox.Name = "flag2Checkbox";
|
||||
this.flag2Checkbox.Size = new System.Drawing.Size(106, 15);
|
||||
this.flag2Checkbox.TabIndex = 23;
|
||||
@@ -188,7 +188,7 @@
|
||||
this.zUpDown.DecimalPlaces = 3;
|
||||
this.zUpDown.Enabled = false;
|
||||
this.zUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
|
||||
this.zUpDown.Location = new System.Drawing.Point(207, 225);
|
||||
this.zUpDown.Location = new System.Drawing.Point(254, 220);
|
||||
this.zUpDown.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
@@ -205,7 +205,7 @@
|
||||
this.yUpDown.DecimalPlaces = 3;
|
||||
this.yUpDown.Enabled = false;
|
||||
this.yUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
|
||||
this.yUpDown.Location = new System.Drawing.Point(207, 199);
|
||||
this.yUpDown.Location = new System.Drawing.Point(254, 194);
|
||||
this.yUpDown.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
@@ -219,7 +219,7 @@
|
||||
// zLabel
|
||||
//
|
||||
this.zLabel.AutoSize = true;
|
||||
this.zLabel.Location = new System.Drawing.Point(174, 225);
|
||||
this.zLabel.Location = new System.Drawing.Point(221, 220);
|
||||
this.zLabel.Name = "zLabel";
|
||||
this.zLabel.Size = new System.Drawing.Size(20, 19);
|
||||
this.zLabel.TabIndex = 25;
|
||||
@@ -229,7 +229,7 @@
|
||||
// yLabel
|
||||
//
|
||||
this.yLabel.AutoSize = true;
|
||||
this.yLabel.Location = new System.Drawing.Point(175, 199);
|
||||
this.yLabel.Location = new System.Drawing.Point(222, 194);
|
||||
this.yLabel.Name = "yLabel";
|
||||
this.yLabel.Size = new System.Drawing.Size(20, 19);
|
||||
this.yLabel.TabIndex = 24;
|
||||
@@ -242,7 +242,7 @@
|
||||
this.xUpDown.DecimalPlaces = 3;
|
||||
this.xUpDown.Enabled = false;
|
||||
this.xUpDown.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
|
||||
this.xUpDown.Location = new System.Drawing.Point(207, 173);
|
||||
this.xUpDown.Location = new System.Drawing.Point(254, 168);
|
||||
this.xUpDown.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
@@ -256,7 +256,7 @@
|
||||
// xLabel
|
||||
//
|
||||
this.xLabel.AutoSize = true;
|
||||
this.xLabel.Location = new System.Drawing.Point(175, 173);
|
||||
this.xLabel.Location = new System.Drawing.Point(222, 168);
|
||||
this.xLabel.Name = "xLabel";
|
||||
this.xLabel.Size = new System.Drawing.Size(20, 19);
|
||||
this.xLabel.TabIndex = 30;
|
||||
@@ -267,7 +267,7 @@
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(314, 280);
|
||||
this.ClientSize = new System.Drawing.Size(349, 280);
|
||||
this.Controls.Add(this.xUpDown);
|
||||
this.Controls.Add(this.xLabel);
|
||||
this.Controls.Add(this.zUpDown);
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using MetroFramework.Forms;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using PckStudio.Classes.IO.Behaviour;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
public partial class BehaviourEditor : MetroForm
|
||||
{
|
||||
// Behaviours File Format research by Miku
|
||||
// Behaviours File Format research by Miku and MattNL
|
||||
private readonly PCKFile.FileData _file;
|
||||
BehaviourFile behaviourFile;
|
||||
bool _isLittleEndian = false;
|
||||
|
||||
void SetUpTree()
|
||||
{
|
||||
@@ -24,6 +26,19 @@ namespace PckStudio.Forms.Editor
|
||||
foreach (var entry in behaviourFile.entries)
|
||||
{
|
||||
TreeNode EntryNode = new TreeNode(entry.name);
|
||||
|
||||
foreach (JObject content in Utilities.BehaviourUtil.entityData["entities"].Children())
|
||||
{
|
||||
var prop = content.Properties().FirstOrDefault(prop => prop.Name == entry.name);
|
||||
if (prop is JProperty)
|
||||
{
|
||||
EntryNode.Text = (string)prop.Value;
|
||||
EntryNode.ImageIndex = Utilities.BehaviourUtil.entityData["entities"].Children().ToList().IndexOf(content);
|
||||
EntryNode.SelectedImageIndex = EntryNode.ImageIndex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
EntryNode.Tag = entry;
|
||||
|
||||
foreach (var posOverride in entry.overrides)
|
||||
@@ -31,6 +46,8 @@ namespace PckStudio.Forms.Editor
|
||||
TreeNode OverrideNode = new TreeNode("Position Override");
|
||||
OverrideNode.Tag = posOverride;
|
||||
EntryNode.Nodes.Add(OverrideNode);
|
||||
OverrideNode.ImageIndex = 103;
|
||||
OverrideNode.SelectedImageIndex = OverrideNode.ImageIndex;
|
||||
}
|
||||
|
||||
treeView1.Nodes.Add(EntryNode);
|
||||
@@ -48,6 +65,9 @@ namespace PckStudio.Forms.Editor
|
||||
behaviourFile = BehavioursReader.Read(stream);
|
||||
}
|
||||
|
||||
treeView1.ImageList = new ImageList();
|
||||
Utilities.BehaviourUtil.entityImages.ToList().ForEach(img => treeView1.ImageList.Images.Add(img));
|
||||
treeView1.ImageList.ColorDepth = ColorDepth.Depth32Bit;
|
||||
SetUpTree();
|
||||
}
|
||||
|
||||
@@ -127,16 +147,37 @@ namespace PckStudio.Forms.Editor
|
||||
}
|
||||
}
|
||||
|
||||
private void renameToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
private void changeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (treeView1.SelectedNode == null) return;
|
||||
if (!(treeView1.SelectedNode.Tag is BehaviourFile.RiderPositionOverride entry)) return;
|
||||
|
||||
using RenamePrompt diag = new RenamePrompt(entry.name);
|
||||
if (diag.ShowDialog(this) == DialogResult.OK)
|
||||
var diag = new Additional_Popups.Behaviours.AddBehaviour();
|
||||
diag.acceptBtn.Text = "Save";
|
||||
|
||||
if (diag.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
entry.name = diag.NewText;
|
||||
if (String.IsNullOrEmpty(diag.SelectedEntity)) return;
|
||||
if (behaviourFile.entries.FindAll(behaviour => behaviour.name == diag.SelectedEntity).Count() > 0)
|
||||
{
|
||||
MessageBox.Show(this, "You cannot have two entries for one entity. Please use the \"Add New Position Override\" tool to add multiple overrides for entities", "Error", MessageBoxButtons.OK);
|
||||
return;
|
||||
}
|
||||
|
||||
entry.name = diag.SelectedEntity;
|
||||
treeView1.SelectedNode.Tag = entry;
|
||||
treeView1.SelectedNode.Text = diag.NewText;
|
||||
|
||||
foreach (JObject content in Utilities.BehaviourUtil.entityData["entities"].Children())
|
||||
{
|
||||
var prop = content.Properties().FirstOrDefault(prop => prop.Name == entry.name);
|
||||
if (prop is JProperty)
|
||||
{
|
||||
treeView1.SelectedNode.Text = (string)prop.Value;
|
||||
treeView1.SelectedNode.ImageIndex = Utilities.BehaviourUtil.entityData["entities"].Children().ToList().IndexOf(content);
|
||||
treeView1.SelectedNode.SelectedImageIndex = treeView1.SelectedNode.ImageIndex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,15 +204,26 @@ namespace PckStudio.Forms.Editor
|
||||
|
||||
private void addNewEntryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
BehaviourFile.RiderPositionOverride NewOverride = new BehaviourFile.RiderPositionOverride("NewRiderOverride");
|
||||
var diag = new Additional_Popups.Behaviours.AddBehaviour();
|
||||
|
||||
TreeNode NewOverrideNode = new TreeNode(NewOverride.name);
|
||||
NewOverrideNode.Tag = NewOverride;
|
||||
treeView1.Nodes.Add(NewOverrideNode);
|
||||
if(diag.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (String.IsNullOrEmpty(diag.SelectedEntity)) return;
|
||||
if (behaviourFile.entries.FindAll(behaviour => behaviour.name == diag.SelectedEntity).Count() > 0)
|
||||
{
|
||||
MessageBox.Show(this, "You cannot have two entries for one entity. Please use the \"Add New Position Override\" tool to add multiple overrides for entities", "Error", MessageBoxButtons.OK);
|
||||
return;
|
||||
}
|
||||
BehaviourFile.RiderPositionOverride NewOverride = new BehaviourFile.RiderPositionOverride(diag.SelectedEntity);
|
||||
|
||||
treeView1.SelectedNode = NewOverrideNode;
|
||||
TreeNode NewOverrideNode = new TreeNode(NewOverride.name);
|
||||
NewOverrideNode.Tag = NewOverride;
|
||||
treeView1.Nodes.Add(NewOverrideNode);
|
||||
|
||||
addNewPositionOverrideToolStripMenuItem_Click(sender, e); // adds a Position Override to the new Override
|
||||
treeView1.SelectedNode = NewOverrideNode;
|
||||
|
||||
addNewPositionOverrideToolStripMenuItem_Click(sender, e); // adds a Position Override to the new Override
|
||||
}
|
||||
}
|
||||
|
||||
private void treeView1_KeyDown(object sender, KeyEventArgs e)
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Linq;
|
||||
using PckStudio.Properties;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using System.Drawing.Imaging;
|
||||
using PckStudio.Classes.Utils;
|
||||
using System.IO;
|
||||
|
||||
namespace PckStudio.Forms.Utilities
|
||||
@@ -21,7 +22,7 @@ namespace PckStudio.Forms.Utilities
|
||||
{
|
||||
get {
|
||||
if (_tileImages == null)
|
||||
_tileImages = CreateImageList(Resources.terrain_sheet, 16, 16).Concat(CreateImageList(Resources.items_sheet, 16, 16)).ToArray();
|
||||
_tileImages = ImageUtils.CreateImageList(Resources.terrain_sheet, 16).Concat(ImageUtils.CreateImageList(Resources.items_sheet, 16)).ToArray();
|
||||
return _tileImages;
|
||||
}
|
||||
}
|
||||
@@ -36,30 +37,5 @@ namespace PckStudio.Forms.Utilities
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
private static IEnumerable<Image> CreateImageList(Image source, int width, int height)
|
||||
{
|
||||
int img_row_count = source.Width / width;
|
||||
int img_column_count = source.Height / height;
|
||||
for (int i = 0; i < img_column_count * img_row_count; i++)
|
||||
{
|
||||
int row = i / width;
|
||||
int column = i % height;
|
||||
Rectangle tileArea = new Rectangle(new Point(column * width, row * height), new Size(width, height));
|
||||
Bitmap tileImage = new Bitmap(width, height);
|
||||
using (Graphics gfx = Graphics.FromImage(tileImage))
|
||||
{
|
||||
gfx.SmoothingMode = SmoothingMode.None;
|
||||
gfx.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
gfx.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
|
||||
gfx.DrawImage(source, new Rectangle(0, 0, width, height), tileArea, GraphicsUnit.Pixel);
|
||||
}
|
||||
yield return tileImage;
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
42
PCK-Studio/Forms/Utilities/BehaviourUtil.cs
Normal file
42
PCK-Studio/Forms/Utilities/BehaviourUtil.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
using PckStudio.Properties;
|
||||
using PckStudio.Classes.FileTypes;
|
||||
using PckStudio.Classes.IO.Behaviour;
|
||||
using PckStudio.Classes.Utils;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
|
||||
namespace PckStudio.Forms.Utilities
|
||||
{
|
||||
public static class BehaviourUtil
|
||||
{
|
||||
public static readonly JObject entityData = JObject.Parse(Resources.entityBehaviourData);
|
||||
private static Image[] _entityImages;
|
||||
public static Image[] entityImages
|
||||
{
|
||||
get {
|
||||
if (_entityImages == null)
|
||||
_entityImages = ImageUtils.CreateImageList(Resources.entities_sheet, 32).ToArray();
|
||||
return _entityImages;
|
||||
}
|
||||
}
|
||||
public static PCKFile.FileData CreateNewBehaviourFile()
|
||||
{
|
||||
PCKFile.FileData file = new PCKFile.FileData($"behaviours.bin", PCKFile.FileData.FileType.BehavioursFile);
|
||||
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
BehavioursWriter.Write(stream, new BehaviourFile());
|
||||
file.SetData(stream.ToArray());
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
}
|
||||
}
|
||||
45
PCK-Studio/MainForm.Designer.cs
generated
45
PCK-Studio/MainForm.Designer.cs
generated
@@ -124,6 +124,7 @@
|
||||
this.labelVersion = new MetroFramework.Controls.MetroLabel();
|
||||
this.ChangelogRichTextBox = new System.Windows.Forms.RichTextBox();
|
||||
this.editorTab = new MetroFramework.Controls.MetroTabPage();
|
||||
this.metroLabel3 = new MetroFramework.Controls.MetroLabel();
|
||||
this.labelImageSize = new MetroFramework.Controls.MetroLabel();
|
||||
this.fileEntryCountLabel = new MetroFramework.Controls.MetroLabel();
|
||||
this.PropertiesTabControl = new MetroFramework.Controls.MetroTabControl();
|
||||
@@ -137,9 +138,9 @@
|
||||
this.label11 = new MetroFramework.Controls.MetroLabel();
|
||||
this.treeViewMain = new System.Windows.Forms.TreeView();
|
||||
this.imageList = new System.Windows.Forms.ImageList(this.components);
|
||||
this.LittleEndianCheckBox = new MetroFramework.Controls.MetroCheckBox();
|
||||
this.metroLabel3 = new MetroFramework.Controls.MetroLabel();
|
||||
this.pictureBoxImagePreview = new PckStudio.PictureBoxWithInterpolationMode();
|
||||
this.LittleEndianCheckBox = new MetroFramework.Controls.MetroCheckBox();
|
||||
this.behavioursbinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.contextMenuPCKEntries.SuspendLayout();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.contextMenuMetaTree.SuspendLayout();
|
||||
@@ -177,7 +178,8 @@
|
||||
this.createAnimatedTextureToolStripMenuItem,
|
||||
this.audiopckToolStripMenuItem,
|
||||
this.colourscolToolStripMenuItem,
|
||||
this.CreateSkinsPCKToolStripMenuItem1});
|
||||
this.CreateSkinsPCKToolStripMenuItem1,
|
||||
this.behavioursbinToolStripMenuItem});
|
||||
resources.ApplyResources(this.createToolStripMenuItem, "createToolStripMenuItem");
|
||||
this.createToolStripMenuItem.Name = "createToolStripMenuItem";
|
||||
//
|
||||
@@ -201,18 +203,21 @@
|
||||
//
|
||||
// audiopckToolStripMenuItem
|
||||
//
|
||||
resources.ApplyResources(this.audiopckToolStripMenuItem, "audiopckToolStripMenuItem");
|
||||
this.audiopckToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BINKA_ICON;
|
||||
this.audiopckToolStripMenuItem.Name = "audiopckToolStripMenuItem";
|
||||
resources.ApplyResources(this.audiopckToolStripMenuItem, "audiopckToolStripMenuItem");
|
||||
this.audiopckToolStripMenuItem.Click += new System.EventHandler(this.audiopckToolStripMenuItem_Click);
|
||||
//
|
||||
// colourscolToolStripMenuItem
|
||||
//
|
||||
this.colourscolToolStripMenuItem.Image = global::PckStudio.Properties.Resources.COL_ICON;
|
||||
this.colourscolToolStripMenuItem.Name = "colourscolToolStripMenuItem";
|
||||
resources.ApplyResources(this.colourscolToolStripMenuItem, "colourscolToolStripMenuItem");
|
||||
this.colourscolToolStripMenuItem.Click += new System.EventHandler(this.colourscolToolStripMenuItem_Click);
|
||||
//
|
||||
// CreateSkinsPCKToolStripMenuItem1
|
||||
//
|
||||
this.CreateSkinsPCKToolStripMenuItem1.Image = global::PckStudio.Properties.Resources.SKINS_ICON;
|
||||
this.CreateSkinsPCKToolStripMenuItem1.Name = "CreateSkinsPCKToolStripMenuItem1";
|
||||
resources.ApplyResources(this.CreateSkinsPCKToolStripMenuItem1, "CreateSkinsPCKToolStripMenuItem1");
|
||||
this.CreateSkinsPCKToolStripMenuItem1.Click += new System.EventHandler(this.CreateSkinsPCKToolStripMenuItem1_Click);
|
||||
@@ -848,6 +853,12 @@
|
||||
this.editorTab.VerticalScrollbarHighlightOnWheel = false;
|
||||
this.editorTab.VerticalScrollbarSize = 0;
|
||||
//
|
||||
// metroLabel3
|
||||
//
|
||||
resources.ApplyResources(this.metroLabel3, "metroLabel3");
|
||||
this.metroLabel3.Name = "metroLabel3";
|
||||
this.metroLabel3.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// labelImageSize
|
||||
//
|
||||
resources.ApplyResources(this.labelImageSize, "labelImageSize");
|
||||
@@ -1010,6 +1021,14 @@
|
||||
resources.ApplyResources(this.imageList, "imageList");
|
||||
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
|
||||
//
|
||||
// pictureBoxImagePreview
|
||||
//
|
||||
resources.ApplyResources(this.pictureBoxImagePreview, "pictureBoxImagePreview");
|
||||
this.pictureBoxImagePreview.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pictureBoxImagePreview.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
|
||||
this.pictureBoxImagePreview.Name = "pictureBoxImagePreview";
|
||||
this.pictureBoxImagePreview.TabStop = false;
|
||||
//
|
||||
// LittleEndianCheckBox
|
||||
//
|
||||
resources.ApplyResources(this.LittleEndianCheckBox, "LittleEndianCheckBox");
|
||||
@@ -1019,19 +1038,12 @@
|
||||
this.LittleEndianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.LittleEndianCheckBox.UseSelectable = true;
|
||||
//
|
||||
// metroLabel3
|
||||
// behavioursbinToolStripMenuItem
|
||||
//
|
||||
resources.ApplyResources(this.metroLabel3, "metroLabel3");
|
||||
this.metroLabel3.Name = "metroLabel3";
|
||||
this.metroLabel3.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
//
|
||||
// pictureBoxImagePreview
|
||||
//
|
||||
resources.ApplyResources(this.pictureBoxImagePreview, "pictureBoxImagePreview");
|
||||
this.pictureBoxImagePreview.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pictureBoxImagePreview.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
|
||||
this.pictureBoxImagePreview.Name = "pictureBoxImagePreview";
|
||||
this.pictureBoxImagePreview.TabStop = false;
|
||||
this.behavioursbinToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BEHAVIOURS_ICON;
|
||||
this.behavioursbinToolStripMenuItem.Name = "behavioursbinToolStripMenuItem";
|
||||
resources.ApplyResources(this.behavioursbinToolStripMenuItem, "behavioursbinToolStripMenuItem");
|
||||
this.behavioursbinToolStripMenuItem.Click += new System.EventHandler(this.behavioursbinToolStripMenuItem_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
@@ -1182,6 +1194,7 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem editAllEntriesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem addFileToolStripMenuItem;
|
||||
private MetroFramework.Controls.MetroLabel metroLabel3;
|
||||
private System.Windows.Forms.ToolStripMenuItem behavioursbinToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -817,7 +817,7 @@ namespace PckStudio
|
||||
|
||||
TrySetLocFile(locFile);
|
||||
saved = false;
|
||||
//BuildMainTreeView();
|
||||
BuildMainTreeView();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2243,6 +2243,19 @@ namespace PckStudio
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private void behavioursbinToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
PCKFile.FileData NewBehaviourFile;
|
||||
if (currentPCK.TryGetFile("behaviours.bin", PCKFile.FileData.FileType.BehavioursFile, out NewBehaviourFile))
|
||||
{
|
||||
MessageBox.Show("A behaviours file already exists in this PCK and a new one cannot be created.", "Operation aborted");
|
||||
return;
|
||||
}
|
||||
NewBehaviourFile = BehaviourUtil.CreateNewBehaviourFile();
|
||||
currentPCK.Files.Add(NewBehaviourFile);
|
||||
BuildMainTreeView();
|
||||
}
|
||||
}
|
||||
|
||||
public class PckNodeSorter : System.Collections.IComparer
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -200,6 +200,7 @@
|
||||
<Compile Include="Classes\Models\DefaultModels\Steve64x64Model.cs" />
|
||||
<Compile Include="Classes\Utils\3DS\3DSUtil.cs" />
|
||||
<Compile Include="Classes\Utils\ARC\ARCUtil.cs" />
|
||||
<Compile Include="Classes\Utils\ImageUtils.cs" />
|
||||
<Compile Include="Classes\Utils\SkinANIM.cs" />
|
||||
<Compile Include="Classes\FileTypes\PCKProperties.cs" />
|
||||
<Compile Include="Classes\FileTypes\PCKFile.cs" />
|
||||
@@ -242,6 +243,12 @@
|
||||
<Compile Include="Classes\Networking\Update.cs" />
|
||||
<Compile Include="Classes\Utils\GRF\CRC32.cs" />
|
||||
<Compile Include="Classes\Utils\RLE.cs" />
|
||||
<Compile Include="Forms\Additional-Popups\Behaviours\AddBehaviour.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Additional-Popups\Behaviours\AddBehaviour.Designer.cs">
|
||||
<DependentUpon>AddBehaviour.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Additional-Popups\Loc\AddLanguage.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -362,6 +369,7 @@
|
||||
<Compile Include="Forms\Additional-Popups\Audio\pleaseWait.Designer.cs">
|
||||
<DependentUpon>pleaseWait.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Utilities\BehaviourUtil.cs" />
|
||||
<Compile Include="Forms\Utilities\AnimationUtil.cs" />
|
||||
<Compile Include="Forms\Utilities\Skins\BoxEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -491,6 +499,9 @@
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Classes\Utils\3DS\TextureCodec.cs" />
|
||||
<EmbeddedResource Include="Forms\Additional-Popups\Behaviours\AddBehaviour.resx">
|
||||
<DependentUpon>AddBehaviour.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Additional-Popups\Loc\AddLanguage.resx">
|
||||
<DependentUpon>AddLanguage.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -689,6 +700,7 @@
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\entityBehaviourData.json" />
|
||||
<None Include="Resources\TexturePackIcon.png" />
|
||||
<None Include="Resources\apps.zip" />
|
||||
<None Include="Resources\binka\binkawin.asi" />
|
||||
@@ -750,6 +762,7 @@
|
||||
<None Include="Resources\Comparison.png" />
|
||||
<None Include="Resources\iconImageList\ENTITY MATERIALS ICON.png" />
|
||||
<None Include="Resources\iconImageList\blank.png" />
|
||||
<None Include="Resources\entities.png" />
|
||||
<Content Include="Resources\PCK-Studio_Logo.ico" />
|
||||
<None Include="Resources\bg1.png" />
|
||||
<Content Include="Resources\NoImageFound.png" />
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace PckStudio
|
||||
{
|
||||
// this is to specify which build release this is. This is manually updated for now
|
||||
// TODO: add different chars for different configurations
|
||||
private const string BuildType = "a";
|
||||
private const string BuildType = "b";
|
||||
private System.Globalization.Calendar BuildCalendar = new System.Globalization.CultureInfo("en-US").Calendar;
|
||||
private DateTime date = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
|
||||
|
||||
|
||||
33
PCK-Studio/Properties/Resources.Designer.cs
generated
33
PCK-Studio/Properties/Resources.Designer.cs
generated
@@ -262,6 +262,16 @@ namespace PckStudio.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap entities_sheet {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("entities_sheet", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -272,6 +282,29 @@ namespace PckStudio.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {
|
||||
/// "COMMENT": "Entity data research by NessieHax (Miku-666) and MattNL",
|
||||
/// "entities": [
|
||||
/// { "area_effect_cloud": "Area Effect Cloud / Particle" },
|
||||
/// { "armor_stand": "Armor Stand" },
|
||||
/// { "arrow": "Arrow" },
|
||||
/// { "blaze": "Blaze" },
|
||||
/// { "boat": "Boat" },
|
||||
/// { "cat": "Cat (PS4 EXCLUSIVE)" },
|
||||
/// { "cave_spider": "Cave Spider (PS4 EXCLUSIVE)" },
|
||||
/// { "chest_minecart": "Chest Minecart" },
|
||||
/// { "chicken": "Chicken" },
|
||||
/// { "cod": "Cod" },
|
||||
/// { "commandblock_minecart": "Command Block Minecart" },
|
||||
/// { "cow": [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
public static string entityBehaviourData {
|
||||
get {
|
||||
return ResourceManager.GetString("entityBehaviourData", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
||||
@@ -328,4 +328,10 @@
|
||||
<data name="blank" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\iconImageList\blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="entities_sheet" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\entities.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="entityBehaviourData" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\entityBehaviourData.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
PCK-Studio/Resources/entities.png
Normal file
BIN
PCK-Studio/Resources/entities.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
109
PCK-Studio/Resources/entityBehaviourData.json
Normal file
109
PCK-Studio/Resources/entityBehaviourData.json
Normal file
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"COMMENT": "Entity data research by NessieHax (Miku-666) and MattNL",
|
||||
"entities": [
|
||||
{ "area_effect_cloud": "Area Effect Cloud / Particle" },
|
||||
{ "armor_stand": "Armor Stand" },
|
||||
{ "arrow": "Arrow" },
|
||||
{ "bat": "Bat" },
|
||||
{ "blaze": "Blaze" },
|
||||
{ "boat": "Boat" },
|
||||
{ "cat": "Cat (PS4 EXCLUSIVE)" },
|
||||
{ "cave_spider": "Cave Spider" },
|
||||
{ "chest_minecart": "Chest Minecart" },
|
||||
{ "chicken": "Chicken" },
|
||||
{ "cod": "Cod" },
|
||||
{ "commandblock_minecart": "Command Block Minecart" },
|
||||
{ "cow": "Cow" },
|
||||
{ "creeper": "Creeper" },
|
||||
{ "dolphin": "Dolphin" },
|
||||
{ "donkey": "Donkey" },
|
||||
{ "dragon_fireball": "Dragon Fireball" },
|
||||
{ "drowned": "Drowned" },
|
||||
{ "egg": "Thrown Egg" },
|
||||
{ "elder_guardian": "Elder Guardian" },
|
||||
{ "ender_crystal": "End Crystal" },
|
||||
{ "ender_dragon": "Ender Dragon" },
|
||||
{ "ender_pearl": "Thrown Ender Pearl" },
|
||||
{ "enderman": "Enderman" },
|
||||
{ "endermite": "Endermite" },
|
||||
{ "evocation_illager": "Evoker" },
|
||||
{ "evocation_fangs": "Evoker Fangs" },
|
||||
{ "xp_bottle": "Thrown Experience Bottle" },
|
||||
{ "xp_orb": "Experience Orb" },
|
||||
{ "eye_of_ender_signal": "Thrown Eye of Ender" },
|
||||
{ "falling_block": "Falling Block" },
|
||||
{ "fireball": "Fireball" },
|
||||
{ "fireworks_rocket": "Firework Rocket" },
|
||||
{ "furnace_minecart": "Furnace Minecart" },
|
||||
{ "ghast": "Ghast" },
|
||||
{ "giant": "Giant" },
|
||||
{ "guardian": "Guardian" },
|
||||
{ "hopper_minecart": "Hopper Minecart" },
|
||||
{ "horse": "Horse" },
|
||||
{ "husk": "Husk" },
|
||||
{ "villager_golem": "Iron Golem" },
|
||||
{ "item": "Dropped Item" },
|
||||
{ "item_frame": "Item Frame" },
|
||||
{ "leash_knot": "Lead Knot" },
|
||||
{ "llama": "Llama" },
|
||||
{ "llama_spit": "Llama Spit" },
|
||||
{ "magma_cube": "Magma Cube" },
|
||||
{ "minecart": "Minecart" },
|
||||
{ "mooshroom": "Mooshroom" },
|
||||
{ "mule": "Mule" },
|
||||
{ "ocelot": "Ocelot" },
|
||||
{ "painting": "Painting" },
|
||||
{ "panda": "Panda (PS4 EXCLUSIVE)" },
|
||||
{ "parrot": "Parrot" },
|
||||
{ "phantom": "Phantom" },
|
||||
{ "pig": "Pig" },
|
||||
{ "pillager": "Pillager (PS4 EXCLUSIVE)" },
|
||||
{ "polar_bear": "Polar Bear" },
|
||||
{ "potion": "Thrown Potion" },
|
||||
{ "pufferfish": "Pufferfish" },
|
||||
{ "rabbit": "Rabbit" },
|
||||
{ "ravager": "Ravager (PS4 EXCLUSIVE)" },
|
||||
{ "salmon": "Salmon" },
|
||||
{ "sheep": "Sheep" },
|
||||
{ "shulker": "Shulker" },
|
||||
{ "shulker_bullet": "Shulker Bullet" },
|
||||
{ "silverfish": "Silverfish" },
|
||||
{ "skeleton": "Skeleton" },
|
||||
{ "skeleton_horse": "Skeleton Horse" },
|
||||
{ "slime": "Slime" },
|
||||
{ "small_fireball": "Small Fireball" },
|
||||
{ "snowman": "Snow Golem" },
|
||||
{ "snowball": "Thrown Snowball" },
|
||||
{ "spawner_minecart": "Spawner Minecart" },
|
||||
{ "spectral_arrow": "Spectral Arrow" },
|
||||
{ "spider": "Spider" },
|
||||
{ "squid": "Squid" },
|
||||
{ "stray": "Stray" },
|
||||
{ "tnt": "Primed TNT" },
|
||||
{ "tnt_minecart": "TNT Minecart" },
|
||||
{ "trident": "Thrown Trident" },
|
||||
{ "tropical_fish": "Tropical Fish" },
|
||||
{ "turtle": "Turtle" },
|
||||
{ "vex": "Vex" },
|
||||
{ "villager": "Villager" },
|
||||
{ "vindication_illager": "Vindicator" },
|
||||
{ "wandering_trader": "Wandering Trader (PS4 Exclusive)" },
|
||||
{ "witch": "Witch" },
|
||||
{ "wither": "Wither" },
|
||||
{ "wither_skeleton": "Wither Skeleton" },
|
||||
{ "wither_skull": "Wither Skull" },
|
||||
{ "wolf": "Wolf" },
|
||||
{ "zombie": "Zombie" },
|
||||
{ "zombie_horse": "Zombie Horse" },
|
||||
{ "zombie_pigman": "Zombie Pigman" },
|
||||
{ "zombie_villager": "Zombie Villager" },
|
||||
{ "": "" },
|
||||
{ "": "" },
|
||||
{ "": "" },
|
||||
{ "": "" },
|
||||
{ "": "" },
|
||||
{ "": "" },
|
||||
{ "": "" },
|
||||
{ "": "" }
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user