mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-15 09:24:48 +08:00
Added Edit Archetype button on Entity Editor, improved Archetype editing hash parsing
This commit is contained in:
+66
-52
@@ -81,16 +81,17 @@
|
||||
this.label94 = new System.Windows.Forms.Label();
|
||||
this.EntityPivotRotationTextBox = new System.Windows.Forms.TextBox();
|
||||
this.EntityMiloTabPage = new System.Windows.Forms.TabPage();
|
||||
this.MiloEntitySetsListBox = new System.Windows.Forms.CheckedListBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.MiloFlagsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.MiloNumExitPortalsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.MiloGroupIDTextBox = new System.Windows.Forms.TextBox();
|
||||
this.MiloFloorIDTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.MiloNumExitPortalsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.MiloFlagsTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.MiloEntitySetsListBox = new System.Windows.Forms.CheckedListBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.EntityEditArchetypeButton = new System.Windows.Forms.Button();
|
||||
this.EntityTabControl.SuspendLayout();
|
||||
this.EntityGeneralTabPage.SuspendLayout();
|
||||
this.EntityLodTabPage.SuspendLayout();
|
||||
@@ -117,6 +118,7 @@
|
||||
//
|
||||
// EntityGeneralTabPage
|
||||
//
|
||||
this.EntityGeneralTabPage.Controls.Add(this.EntityEditArchetypeButton);
|
||||
this.EntityGeneralTabPage.Controls.Add(this.EntityFlagsCheckedListBox);
|
||||
this.EntityGeneralTabPage.Controls.Add(this.label13);
|
||||
this.EntityGeneralTabPage.Controls.Add(this.label28);
|
||||
@@ -701,27 +703,39 @@
|
||||
this.EntityMiloTabPage.Text = "MLO Instance";
|
||||
this.EntityMiloTabPage.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// MiloEntitySetsListBox
|
||||
// MiloFlagsTextBox
|
||||
//
|
||||
this.MiloEntitySetsListBox.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.MiloEntitySetsListBox.CheckOnClick = true;
|
||||
this.MiloEntitySetsListBox.FormattingEnabled = true;
|
||||
this.MiloEntitySetsListBox.Location = new System.Drawing.Point(103, 128);
|
||||
this.MiloEntitySetsListBox.Name = "MiloEntitySetsListBox";
|
||||
this.MiloEntitySetsListBox.Size = new System.Drawing.Size(434, 319);
|
||||
this.MiloEntitySetsListBox.TabIndex = 4;
|
||||
this.MiloEntitySetsListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.MiloEntitySetsListBox_ItemCheck);
|
||||
this.MiloFlagsTextBox.Location = new System.Drawing.Point(101, 93);
|
||||
this.MiloFlagsTextBox.Name = "MiloFlagsTextBox";
|
||||
this.MiloFlagsTextBox.Size = new System.Drawing.Size(154, 20);
|
||||
this.MiloFlagsTextBox.TabIndex = 43;
|
||||
this.MiloFlagsTextBox.TextChanged += new System.EventHandler(this.MiloFlagsTextBox_TextChanged);
|
||||
//
|
||||
// label2
|
||||
// label6
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(3, 129);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(91, 13);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "DefaultEntitySets:";
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(5, 96);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(75, 13);
|
||||
this.label6.TabIndex = 42;
|
||||
this.label6.Text = "MLOInstFlags:";
|
||||
//
|
||||
// MiloNumExitPortalsTextBox
|
||||
//
|
||||
this.MiloNumExitPortalsTextBox.Location = new System.Drawing.Point(101, 67);
|
||||
this.MiloNumExitPortalsTextBox.Name = "MiloNumExitPortalsTextBox";
|
||||
this.MiloNumExitPortalsTextBox.Size = new System.Drawing.Size(154, 20);
|
||||
this.MiloNumExitPortalsTextBox.TabIndex = 41;
|
||||
this.MiloNumExitPortalsTextBox.TextChanged += new System.EventHandler(this.MiloNumExitPortalsTextBox_TextChanged);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(5, 70);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(81, 13);
|
||||
this.label5.TabIndex = 40;
|
||||
this.label5.Text = "NumExitPortals:";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
@@ -757,39 +771,38 @@
|
||||
this.label4.TabIndex = 38;
|
||||
this.label4.Text = "FloorID:";
|
||||
//
|
||||
// MiloNumExitPortalsTextBox
|
||||
// MiloEntitySetsListBox
|
||||
//
|
||||
this.MiloNumExitPortalsTextBox.Location = new System.Drawing.Point(101, 67);
|
||||
this.MiloNumExitPortalsTextBox.Name = "MiloNumExitPortalsTextBox";
|
||||
this.MiloNumExitPortalsTextBox.Size = new System.Drawing.Size(154, 20);
|
||||
this.MiloNumExitPortalsTextBox.TabIndex = 41;
|
||||
this.MiloNumExitPortalsTextBox.TextChanged += new System.EventHandler(this.MiloNumExitPortalsTextBox_TextChanged);
|
||||
this.MiloEntitySetsListBox.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.MiloEntitySetsListBox.CheckOnClick = true;
|
||||
this.MiloEntitySetsListBox.FormattingEnabled = true;
|
||||
this.MiloEntitySetsListBox.Location = new System.Drawing.Point(103, 128);
|
||||
this.MiloEntitySetsListBox.Name = "MiloEntitySetsListBox";
|
||||
this.MiloEntitySetsListBox.Size = new System.Drawing.Size(434, 319);
|
||||
this.MiloEntitySetsListBox.TabIndex = 4;
|
||||
this.MiloEntitySetsListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.MiloEntitySetsListBox_ItemCheck);
|
||||
//
|
||||
// label5
|
||||
// label2
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(5, 70);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(81, 13);
|
||||
this.label5.TabIndex = 40;
|
||||
this.label5.Text = "NumExitPortals:";
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(3, 129);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(91, 13);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "DefaultEntitySets:";
|
||||
//
|
||||
// MiloFlagsTextBox
|
||||
// EntityEditArchetypeButton
|
||||
//
|
||||
this.MiloFlagsTextBox.Location = new System.Drawing.Point(101, 93);
|
||||
this.MiloFlagsTextBox.Name = "MiloFlagsTextBox";
|
||||
this.MiloFlagsTextBox.Size = new System.Drawing.Size(154, 20);
|
||||
this.MiloFlagsTextBox.TabIndex = 43;
|
||||
this.MiloFlagsTextBox.TextChanged += new System.EventHandler(this.MiloFlagsTextBox_TextChanged);
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(5, 96);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(75, 13);
|
||||
this.label6.TabIndex = 42;
|
||||
this.label6.Text = "MLOInstFlags:";
|
||||
this.EntityEditArchetypeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.EntityEditArchetypeButton.Location = new System.Drawing.Point(454, 59);
|
||||
this.EntityEditArchetypeButton.Name = "EntityEditArchetypeButton";
|
||||
this.EntityEditArchetypeButton.Size = new System.Drawing.Size(95, 23);
|
||||
this.EntityEditArchetypeButton.TabIndex = 35;
|
||||
this.EntityEditArchetypeButton.Text = "Edit Archetype...";
|
||||
this.EntityEditArchetypeButton.UseVisualStyleBackColor = true;
|
||||
this.EntityEditArchetypeButton.Click += new System.EventHandler(this.EntityEditArchetypeButton_Click);
|
||||
//
|
||||
// EditYmapEntityPanel
|
||||
//
|
||||
@@ -879,5 +892,6 @@
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox MiloFlagsTextBox;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Button EntityEditArchetypeButton;
|
||||
}
|
||||
}
|
||||
@@ -801,5 +801,14 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
e.NewValue = CheckState.Unchecked;
|
||||
}
|
||||
|
||||
private void EntityEditArchetypeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ProjectForm != null)
|
||||
{
|
||||
ProjectForm.SetCurrentArchetype(CurrentEntity?.Archetype);
|
||||
ProjectForm.ShowEditArchetypePanel(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -338,9 +338,9 @@
|
||||
"536870912 - Unk30",
|
||||
"1073741824 - Unk31",
|
||||
"2147483648 - Unk32"});
|
||||
this.EntityFlagsCheckedListBox.Location = new System.Drawing.Point(422, 38);
|
||||
this.EntityFlagsCheckedListBox.Location = new System.Drawing.Point(441, 38);
|
||||
this.EntityFlagsCheckedListBox.Name = "EntityFlagsCheckedListBox";
|
||||
this.EntityFlagsCheckedListBox.Size = new System.Drawing.Size(201, 274);
|
||||
this.EntityFlagsCheckedListBox.Size = new System.Drawing.Size(182, 274);
|
||||
this.EntityFlagsCheckedListBox.TabIndex = 67;
|
||||
this.EntityFlagsCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.ArchetypeFlagsCheckedListBox_ItemCheck);
|
||||
//
|
||||
|
||||
@@ -162,7 +162,11 @@ namespace CodeWalker.Project.Panels
|
||||
return;
|
||||
}
|
||||
|
||||
var hash = JenkHash.GenHash(TextureDictTextBox.Text);
|
||||
var hash = 0u;
|
||||
if (!uint.TryParse(TextureDictTextBox.Text, out hash))//don't re-hash hashes
|
||||
{
|
||||
hash = JenkHash.GenHash(TextureDictTextBox.Text);
|
||||
}
|
||||
|
||||
if (CurrentArchetype._BaseArchetypeDef.textureDictionary != hash)
|
||||
{
|
||||
@@ -173,10 +177,10 @@ namespace CodeWalker.Project.Panels
|
||||
ProjectForm.SetYtypHasChanged(true);
|
||||
return;
|
||||
}
|
||||
TextureDictHashLabel.Text = "Hash: " + hash.ToString();
|
||||
CurrentArchetype._BaseArchetypeDef.textureDictionary = hash;
|
||||
ProjectForm.SetYtypHasChanged(true);
|
||||
}
|
||||
TextureDictHashLabel.Text = "Hash: " + hash.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +201,11 @@ namespace CodeWalker.Project.Panels
|
||||
return;
|
||||
}
|
||||
|
||||
var hash = JenkHash.GenHash(PhysicsDictionaryTextBox.Text);
|
||||
var hash = 0u;
|
||||
if (!uint.TryParse(PhysicsDictionaryTextBox.Text, out hash))//don't re-hash hashes
|
||||
{
|
||||
hash = JenkHash.GenHash(PhysicsDictionaryTextBox.Text);
|
||||
}
|
||||
|
||||
if (CurrentArchetype._BaseArchetypeDef.physicsDictionary != hash)
|
||||
{
|
||||
@@ -208,17 +216,20 @@ namespace CodeWalker.Project.Panels
|
||||
ProjectForm.SetYtypHasChanged(true);
|
||||
return;
|
||||
}
|
||||
PhysicsDictHashLabel.Text = "Hash: " + hash.ToString();
|
||||
|
||||
CurrentArchetype._BaseArchetypeDef.physicsDictionary = hash;
|
||||
ProjectForm.SetYtypHasChanged(true);
|
||||
}
|
||||
PhysicsDictHashLabel.Text = "Hash: " + hash.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void ArchetypeNameTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var hash = JenkHash.GenHash(ArchetypeNameTextBox.Text);
|
||||
var hash = 0u;
|
||||
if (!uint.TryParse(ArchetypeNameTextBox.Text, out hash))//don't re-hash hashes
|
||||
{
|
||||
hash = JenkHash.GenHash(ArchetypeNameTextBox.Text);
|
||||
}
|
||||
|
||||
if (CurrentArchetype._BaseArchetypeDef.name != hash)
|
||||
{
|
||||
@@ -235,7 +246,11 @@ namespace CodeWalker.Project.Panels
|
||||
|
||||
private void AssetNameTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var hash = JenkHash.GenHash(AssetNameTextBox.Text);
|
||||
var hash = 0u;
|
||||
if (!uint.TryParse(AssetNameTextBox.Text, out hash))//don't re-hash hashes
|
||||
{
|
||||
hash = JenkHash.GenHash(AssetNameTextBox.Text);
|
||||
}
|
||||
|
||||
if (CurrentArchetype._BaseArchetypeDef.assetName != hash)
|
||||
{
|
||||
@@ -246,7 +261,11 @@ namespace CodeWalker.Project.Panels
|
||||
|
||||
private void ClipDictionaryTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var hash = JenkHash.GenHash(ClipDictionaryTextBox.Text);
|
||||
var hash = 0u;
|
||||
if (!uint.TryParse(ClipDictionaryTextBox.Text, out hash))//don't re-hash hashes
|
||||
{
|
||||
hash = JenkHash.GenHash(ClipDictionaryTextBox.Text);
|
||||
}
|
||||
|
||||
if (CurrentArchetype._BaseArchetypeDef.clipDictionary != hash)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user