mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-25 06:27:28 +00:00
Added AddBehvaiour to BehaviourEditor
This commit is contained in:
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);
|
||||
//
|
||||
// treeViewBlocks
|
||||
//
|
||||
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 = "treeViewBlocks";
|
||||
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 acceptBtn;
|
||||
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;
|
||||
}
|
||||
}
|
||||
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>
|
||||
@@ -12,10 +12,9 @@ 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()
|
||||
{
|
||||
@@ -48,6 +47,10 @@ 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.ImageSize = new Size(32, 32);
|
||||
treeView1.ImageList.ColorDepth = ColorDepth.Depth32Bit;
|
||||
SetUpTree();
|
||||
}
|
||||
|
||||
@@ -163,15 +166,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)
|
||||
|
||||
@@ -18,44 +18,41 @@
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<Target Name="GetGitHash" BeforeTargets="WriteGitHash" Condition="'$(BuildHash)' == ''">
|
||||
<PropertyGroup>
|
||||
<!-- temp file for the git version (lives in "obj" folder)-->
|
||||
<VerFile>$(IntermediateOutputPath)gitver</VerFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- write the hash to the temp file.-->
|
||||
<Exec Command="git -C $(ProjectDir) describe --always > $(VerFile)" />
|
||||
|
||||
<!-- read the version into the GitVersion itemGroup-->
|
||||
<ReadLinesFromFile File="$(VerFile)">
|
||||
<Output TaskParameter="Lines" ItemName="GitVersion" />
|
||||
</ReadLinesFromFile>
|
||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
||||
<PropertyGroup>
|
||||
<BuildHash>@(GitVersion)</BuildHash>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="WriteGitHash" BeforeTargets="CoreCompile">
|
||||
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
||||
<PropertyGroup>
|
||||
<CustomAssemblyInfoFile>$(IntermediateOutputPath)GitHashAssemblyInfo.cs</CustomAssemblyInfoFile>
|
||||
</PropertyGroup>
|
||||
<!-- includes the CustomAssemblyInfo for compilation into your project -->
|
||||
<ItemGroup>
|
||||
<Compile Include="$(CustomAssemblyInfoFile)" />
|
||||
</ItemGroup>
|
||||
<!-- defines the AssemblyMetadata attribute that will be written -->
|
||||
<ItemGroup>
|
||||
<AssemblyAttributes Include="AssemblyMetadata">
|
||||
<_Parameter1>GitHash</_Parameter1>
|
||||
<_Parameter2>$(BuildHash)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
</ItemGroup>
|
||||
<!-- writes the attribute to the customAssemblyInfo file -->
|
||||
<WriteCodeFragment Language="C#" OutputFile="$(CustomAssemblyInfoFile)" AssemblyAttributes="@(AssemblyAttributes)" />
|
||||
</Target>
|
||||
<Target Name="GetGitHash" BeforeTargets="WriteGitHash" Condition="'$(BuildHash)' == ''">
|
||||
<PropertyGroup>
|
||||
<!-- temp file for the git version (lives in "obj" folder)-->
|
||||
<VerFile>$(IntermediateOutputPath)gitver</VerFile>
|
||||
</PropertyGroup>
|
||||
<!-- write the hash to the temp file.-->
|
||||
<Exec Command="git -C $(ProjectDir) describe --always > $(VerFile)" />
|
||||
<!-- read the version into the GitVersion itemGroup-->
|
||||
<ReadLinesFromFile File="$(VerFile)">
|
||||
<Output TaskParameter="Lines" ItemName="GitVersion" />
|
||||
</ReadLinesFromFile>
|
||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
||||
<PropertyGroup>
|
||||
<BuildHash>@(GitVersion)</BuildHash>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="WriteGitHash" BeforeTargets="CoreCompile">
|
||||
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
||||
<PropertyGroup>
|
||||
<CustomAssemblyInfoFile>$(IntermediateOutputPath)GitHashAssemblyInfo.cs</CustomAssemblyInfoFile>
|
||||
</PropertyGroup>
|
||||
<!-- includes the CustomAssemblyInfo for compilation into your project -->
|
||||
<ItemGroup>
|
||||
<Compile Include="$(CustomAssemblyInfoFile)" />
|
||||
</ItemGroup>
|
||||
<!-- defines the AssemblyMetadata attribute that will be written -->
|
||||
<ItemGroup>
|
||||
<AssemblyAttributes Include="AssemblyMetadata">
|
||||
<_Parameter1>GitHash</_Parameter1>
|
||||
<_Parameter2>$(BuildHash)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
</ItemGroup>
|
||||
<!-- writes the attribute to the customAssemblyInfo file -->
|
||||
<WriteCodeFragment Language="C#" OutputFile="$(CustomAssemblyInfoFile)" AssemblyAttributes="@(AssemblyAttributes)" />
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -200,6 +197,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 +240,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 +366,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 +496,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 +697,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 +759,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" />
|
||||
|
||||
Reference in New Issue
Block a user