Updated BehaviourEditor

This commit is contained in:
MattNL
2023-03-03 04:25:58 -05:00
parent 87138f9853
commit f7d0180951
2 changed files with 30 additions and 13 deletions

View File

@@ -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);
@@ -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);

View File

@@ -1,12 +1,15 @@
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
{
@@ -23,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)
@@ -30,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);
@@ -49,7 +67,6 @@ namespace PckStudio.Forms.Editor
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();
}