From 6216f98d4859f1cf764f2d73ac3c7c4be6043786 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Tue, 28 Jan 2020 19:55:16 -0500 Subject: [PATCH] BCH/BCRES : Add user data tab for skeletal animations. --- .../H3DSkeletalAnimWrapper.cs | 12 ++ .../File_Format_Library.csproj | 18 +++ .../GUI/BCH/BCHAnimationEditor.Designer.cs | 100 ++++++++++++ .../GUI/BCH/BCHAnimationEditor.cs | 28 ++++ .../GUI/BCH/BCHAnimationEditor.resx | 120 ++++++++++++++ .../GUI/Byaml/ByamlNodeSearch.Designer.cs | 148 ++++++++++++++++++ .../GUI/Byaml/ByamlNodeSearch.cs | 20 +++ .../GUI/Byaml/ByamlNodeSearch.resx | 120 ++++++++++++++ 8 files changed, 566 insertions(+) create mode 100644 File_Format_Library/GUI/BCH/BCHAnimationEditor.Designer.cs create mode 100644 File_Format_Library/GUI/BCH/BCHAnimationEditor.cs create mode 100644 File_Format_Library/GUI/BCH/BCHAnimationEditor.resx create mode 100644 File_Format_Library/GUI/Byaml/ByamlNodeSearch.Designer.cs create mode 100644 File_Format_Library/GUI/Byaml/ByamlNodeSearch.cs create mode 100644 File_Format_Library/GUI/Byaml/ByamlNodeSearch.resx diff --git a/File_Format_Library/FileFormats/BCH/Wrappers/SkeletalAnimation/H3DSkeletalAnimWrapper.cs b/File_Format_Library/FileFormats/BCH/Wrappers/SkeletalAnimation/H3DSkeletalAnimWrapper.cs index ba5e8d78..5f1d5954 100644 --- a/File_Format_Library/FileFormats/BCH/Wrappers/SkeletalAnimation/H3DSkeletalAnimWrapper.cs +++ b/File_Format_Library/FileFormats/BCH/Wrappers/SkeletalAnimation/H3DSkeletalAnimWrapper.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using Toolbox.Library.NodeWrappers; using Toolbox.Library.Animations; using SPICA.Formats.CtrH3D.Animation; +using FirstPlugin.CtrLibrary.Forms; +using System.Windows.Forms; namespace FirstPlugin.CtrLibrary { @@ -15,6 +17,14 @@ namespace FirstPlugin.CtrLibrary public H3DAnimationController Animation = new H3DAnimationController(); + private H3DAnimation H3DAnimation; + + public override void OnClick(TreeView treeview) + { + var editor = BCHParent.LoadEditor(); + editor.LoadAnimation(H3DAnimation); + } + public H3DSkeletalAnimWrapper(H3DAnimation h3dAnim, BCH bch) { ImageKey = "anim"; @@ -22,6 +32,8 @@ namespace FirstPlugin.CtrLibrary BCHParent = bch; Text = h3dAnim.Name; + + H3DAnimation = h3dAnim; Animation.FrameCount = h3dAnim.FramesCount; Animation.Name = h3dAnim.Name; Animation.Loop = h3dAnim.AnimationFlags.HasFlag(H3DAnimationFlags.IsLooping); diff --git a/File_Format_Library/File_Format_Library.csproj b/File_Format_Library/File_Format_Library.csproj index b4e2cc21..91e951c0 100644 --- a/File_Format_Library/File_Format_Library.csproj +++ b/File_Format_Library/File_Format_Library.csproj @@ -412,6 +412,12 @@ + + UserControl + + + BCHAnimationEditor.cs + UserControl @@ -504,6 +510,12 @@ TexSrtPanel2D.cs + + Form + + + ByamlNodeSearch.cs + UserControl @@ -1553,6 +1565,9 @@ AttributeEditor.cs + + BCHAnimationEditor.cs + BCHMeshEditor.cs @@ -1598,6 +1613,9 @@ TexSrtPanel2D.cs + + ByamlNodeSearch.cs + GFLXMaterialEditor.cs diff --git a/File_Format_Library/GUI/BCH/BCHAnimationEditor.Designer.cs b/File_Format_Library/GUI/BCH/BCHAnimationEditor.Designer.cs new file mode 100644 index 00000000..eb85ee76 --- /dev/null +++ b/File_Format_Library/GUI/BCH/BCHAnimationEditor.Designer.cs @@ -0,0 +1,100 @@ +namespace FirstPlugin.CtrLibrary.Forms +{ + partial class BCHAnimationEditor + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.stTabControl1 = new Toolbox.Library.Forms.STTabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.bchUserDataEditor1 = new CtrLibrary.Forms.BCHUserDataEditor(); + this.stTabControl1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.SuspendLayout(); + // + // stTabControl1 + // + this.stTabControl1.Controls.Add(this.tabPage1); + this.stTabControl1.Controls.Add(this.tabPage2); + this.stTabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.stTabControl1.Location = new System.Drawing.Point(0, 0); + this.stTabControl1.myBackColor = System.Drawing.Color.Empty; + this.stTabControl1.Name = "stTabControl1"; + this.stTabControl1.SelectedIndex = 0; + this.stTabControl1.Size = new System.Drawing.Size(386, 427); + this.stTabControl1.TabIndex = 0; + // + // tabPage1 + // + this.tabPage1.Location = new System.Drawing.Point(4, 25); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(378, 398); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Animation"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.bchUserDataEditor1); + this.tabPage2.Location = new System.Drawing.Point(4, 25); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(378, 398); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "User Data"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // bchUserDataEditor1 + // + this.bchUserDataEditor1.Dock = System.Windows.Forms.DockStyle.Fill; + this.bchUserDataEditor1.Location = new System.Drawing.Point(3, 3); + this.bchUserDataEditor1.Name = "bchUserDataEditor1"; + this.bchUserDataEditor1.Size = new System.Drawing.Size(372, 392); + this.bchUserDataEditor1.TabIndex = 1; + // + // BCHAnimationEditor + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.stTabControl1); + this.Name = "BCHAnimationEditor"; + this.Size = new System.Drawing.Size(386, 427); + this.stTabControl1.ResumeLayout(false); + this.tabPage2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private Toolbox.Library.Forms.STTabControl stTabControl1; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TabPage tabPage2; + private CtrLibrary.Forms.BCHUserDataEditor bchUserDataEditor1; + } +} diff --git a/File_Format_Library/GUI/BCH/BCHAnimationEditor.cs b/File_Format_Library/GUI/BCH/BCHAnimationEditor.cs new file mode 100644 index 00000000..0967a2e2 --- /dev/null +++ b/File_Format_Library/GUI/BCH/BCHAnimationEditor.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using SPICA.Formats.CtrH3D.Animation; +using Toolbox.Library.Forms; + +namespace FirstPlugin.CtrLibrary.Forms +{ + public partial class BCHAnimationEditor : UserControl + { + public BCHAnimationEditor() + { + InitializeComponent(); + + stTabControl1.myBackColor = FormThemes.BaseTheme.FormBackColor; + } + + public void LoadAnimation(H3DAnimation animation) { + bchUserDataEditor1.LoadUserData(animation.MetaData); + } + } +} diff --git a/File_Format_Library/GUI/BCH/BCHAnimationEditor.resx b/File_Format_Library/GUI/BCH/BCHAnimationEditor.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/File_Format_Library/GUI/BCH/BCHAnimationEditor.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/File_Format_Library/GUI/Byaml/ByamlNodeSearch.Designer.cs b/File_Format_Library/GUI/Byaml/ByamlNodeSearch.Designer.cs new file mode 100644 index 00000000..0f2375a0 --- /dev/null +++ b/File_Format_Library/GUI/Byaml/ByamlNodeSearch.Designer.cs @@ -0,0 +1,148 @@ +namespace FirstPlugin.GUI.Byaml +{ + partial class ByamlNodeSearch + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.stLabel1 = new Toolbox.Library.Forms.STLabel(); + this.stCheckBox1 = new Toolbox.Library.Forms.STCheckBox(); + this.stTextBox1 = new Toolbox.Library.Forms.STTextBox(); + this.stTextBox2 = new Toolbox.Library.Forms.STTextBox(); + this.stLabel2 = new Toolbox.Library.Forms.STLabel(); + this.stComboBox1 = new Toolbox.Library.Forms.STComboBox(); + this.stLabel3 = new Toolbox.Library.Forms.STLabel(); + this.stButton1 = new Toolbox.Library.Forms.STButton(); + this.SuspendLayout(); + // + // stLabel1 + // + this.stLabel1.AutoSize = true; + this.stLabel1.Location = new System.Drawing.Point(44, 112); + this.stLabel1.Name = "stLabel1"; + this.stLabel1.Size = new System.Drawing.Size(70, 13); + this.stLabel1.TabIndex = 0; + this.stLabel1.Text = "Batch Folder:"; + // + // stCheckBox1 + // + this.stCheckBox1.AutoSize = true; + this.stCheckBox1.Location = new System.Drawing.Point(15, 81); + this.stCheckBox1.Name = "stCheckBox1"; + this.stCheckBox1.Size = new System.Drawing.Size(146, 17); + this.stCheckBox1.TabIndex = 1; + this.stCheckBox1.Text = "Batch Search Byaml Files"; + this.stCheckBox1.UseVisualStyleBackColor = true; + // + // stTextBox1 + // + this.stTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.stTextBox1.Location = new System.Drawing.Point(120, 110); + this.stTextBox1.Name = "stTextBox1"; + this.stTextBox1.Size = new System.Drawing.Size(233, 20); + this.stTextBox1.TabIndex = 2; + // + // stTextBox2 + // + this.stTextBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.stTextBox2.Location = new System.Drawing.Point(74, 12); + this.stTextBox2.Name = "stTextBox2"; + this.stTextBox2.Size = new System.Drawing.Size(279, 20); + this.stTextBox2.TabIndex = 3; + // + // stLabel2 + // + this.stLabel2.AutoSize = true; + this.stLabel2.Location = new System.Drawing.Point(12, 14); + this.stLabel2.Name = "stLabel2"; + this.stLabel2.Size = new System.Drawing.Size(44, 13); + this.stLabel2.TabIndex = 4; + this.stLabel2.Text = "Search:"; + // + // stComboBox1 + // + this.stComboBox1.BorderColor = System.Drawing.Color.Empty; + this.stComboBox1.BorderStyle = System.Windows.Forms.ButtonBorderStyle.Solid; + this.stComboBox1.ButtonColor = System.Drawing.Color.Empty; + this.stComboBox1.FormattingEnabled = true; + this.stComboBox1.IsReadOnly = false; + this.stComboBox1.Location = new System.Drawing.Point(74, 39); + this.stComboBox1.Name = "stComboBox1"; + this.stComboBox1.Size = new System.Drawing.Size(279, 21); + this.stComboBox1.TabIndex = 5; + // + // stLabel3 + // + this.stLabel3.AutoSize = true; + this.stLabel3.Location = new System.Drawing.Point(12, 42); + this.stLabel3.Name = "stLabel3"; + this.stLabel3.Size = new System.Drawing.Size(60, 13); + this.stLabel3.TabIndex = 6; + this.stLabel3.Text = "Data Type:"; + // + // stButton1 + // + this.stButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.stButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.stButton1.Location = new System.Drawing.Point(278, 137); + this.stButton1.Name = "stButton1"; + this.stButton1.Size = new System.Drawing.Size(75, 23); + this.stButton1.TabIndex = 7; + this.stButton1.Text = "Ok"; + this.stButton1.UseVisualStyleBackColor = false; + // + // ByamlNodeSearch + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(365, 172); + this.Controls.Add(this.stButton1); + this.Controls.Add(this.stLabel3); + this.Controls.Add(this.stComboBox1); + this.Controls.Add(this.stLabel2); + this.Controls.Add(this.stTextBox2); + this.Controls.Add(this.stTextBox1); + this.Controls.Add(this.stCheckBox1); + this.Controls.Add(this.stLabel1); + this.Name = "ByamlNodeSearch"; + this.Text = "Node Search"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Toolbox.Library.Forms.STLabel stLabel1; + private Toolbox.Library.Forms.STCheckBox stCheckBox1; + private Toolbox.Library.Forms.STTextBox stTextBox1; + private Toolbox.Library.Forms.STTextBox stTextBox2; + private Toolbox.Library.Forms.STLabel stLabel2; + private Toolbox.Library.Forms.STComboBox stComboBox1; + private Toolbox.Library.Forms.STLabel stLabel3; + private Toolbox.Library.Forms.STButton stButton1; + } +} \ No newline at end of file diff --git a/File_Format_Library/GUI/Byaml/ByamlNodeSearch.cs b/File_Format_Library/GUI/Byaml/ByamlNodeSearch.cs new file mode 100644 index 00000000..21581bc7 --- /dev/null +++ b/File_Format_Library/GUI/Byaml/ByamlNodeSearch.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FirstPlugin.GUI.Byaml +{ + public partial class ByamlNodeSearch : Form + { + public ByamlNodeSearch() + { + InitializeComponent(); + } + } +} diff --git a/File_Format_Library/GUI/Byaml/ByamlNodeSearch.resx b/File_Format_Library/GUI/Byaml/ByamlNodeSearch.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/File_Format_Library/GUI/Byaml/ByamlNodeSearch.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file