1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Cleanup muunt editor

This commit is contained in:
KillzXGaming 2019-04-06 19:11:59 -04:00
parent 5e6fb187d5
commit f4189a9e39
18 changed files with 206 additions and 122 deletions

Binary file not shown.

View File

@ -92,7 +92,6 @@
this.chkTransformCuRotateTrnaslateZero = new Switch_Toolbox.Library.Forms.STCheckBox(); this.chkTransformCuRotateTrnaslateZero = new Switch_Toolbox.Library.Forms.STCheckBox();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.userDataEditor1 = new UserDataEditor(); this.userDataEditor1 = new UserDataEditor();
this.stTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.stFlowLayoutPanel1.SuspendLayout(); this.stFlowLayoutPanel1.SuspendLayout();
this.stDropDownPanel1.SuspendLayout(); this.stDropDownPanel1.SuspendLayout();
@ -124,8 +123,6 @@
// //
// stTabControl1 // stTabControl1
// //
this.stTabControl1.Controls.Add(this.tabPage1);
this.stTabControl1.Controls.Add(this.tabPage2);
this.stTabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.stTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stTabControl1.Location = new System.Drawing.Point(0, 0); this.stTabControl1.Location = new System.Drawing.Point(0, 0);
this.stTabControl1.myBackColor = System.Drawing.Color.Empty; this.stTabControl1.myBackColor = System.Drawing.Color.Empty;
@ -1015,7 +1012,6 @@
this.Controls.Add(this.stTabControl1); this.Controls.Add(this.stTabControl1);
this.Name = "BfresBoneEditor"; this.Name = "BfresBoneEditor";
this.Size = new System.Drawing.Size(647, 831); this.Size = new System.Drawing.Size(647, 831);
this.stTabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
this.stFlowLayoutPanel1.ResumeLayout(false); this.stFlowLayoutPanel1.ResumeLayout(false);
this.stDropDownPanel1.ResumeLayout(false); this.stDropDownPanel1.ResumeLayout(false);

View File

@ -11,102 +11,11 @@ using System.Drawing;
namespace FirstPlugin.Turbo.CourseMuuntStructs namespace FirstPlugin.Turbo.CourseMuuntStructs
{ {
public class RenderablePaths : AbstractGlDrawable public class EnemyPathGroup : PathGroup, IObject
{
private static ShaderProgram defaultShaderProgram;
public List<EnemyPathGroup> PathGroups = new List<EnemyPathGroup>();
public override void Prepare(GL_ControlLegacy control)
{
}
public override void Prepare(GL_ControlModern control)
{
var defaultFrag = new FragmentShader(
@"#version 330
void main(){
gl_FragColor = vec4(0,1,0,1);
}");
var defaultVert = new VertexShader(
@"#version 330
in vec4 position;
uniform mat4 mtxCam;
uniform mat4 mtxMdl;
void main(){
gl_Position = mtxCam * mtxMdl * vec4(position.xyz, 1);
}");
defaultShaderProgram = new ShaderProgram(defaultFrag, defaultVert);
}
public override void Draw(GL_ControlLegacy control, Pass pass)
{
foreach (var group in PathGroups)
{
foreach (var path in group.PathPoints)
{
GL.LineWidth(2f);
foreach (var nextPt in path.NextPoints)
{
GL.Color3(Color.Blue);
GL.Begin(PrimitiveType.Lines);
GL.Vertex3(path.Translate);
GL.Vertex3(PathGroups[nextPt.PathID].PathPoints[nextPt.PtID].Translate);
GL.End();
}
foreach (var prevPt in path.PrevPoints)
{
GL.Color3(Color.Blue);
GL.Begin(PrimitiveType.Lines);
GL.Vertex3(path.Translate);
GL.Vertex3(PathGroups[prevPt.PathID].PathPoints[prevPt.PtID].Translate);
GL.End();
}
}
}
}
public override void Draw(GL_ControlModern control, Pass pass)
{
control.CurrentShader = defaultShaderProgram;
foreach (var group in PathGroups)
{
foreach (var path in group.PathPoints)
{
GL.LineWidth(2f);
foreach (var nextPt in path.NextPoints)
{
GL.Color3(Color.Blue);
GL.Begin(PrimitiveType.Lines);
GL.Vertex3(path.Translate);
GL.Vertex3(PathGroups[nextPt.PathID].PathPoints[nextPt.PtID].Translate);
GL.End();
}
foreach (var prevPt in path.PrevPoints)
{
GL.Color3(Color.Blue);
GL.Begin(PrimitiveType.Lines);
GL.Vertex3(path.Translate);
GL.Vertex3(PathGroups[prevPt.PathID].PathPoints[prevPt.PtID].Translate);
GL.End();
}
}
}
}
}
public class EnemyPathGroup : IObject
{ {
public const string N_EnemyPathGroup = "EnemyPathGroup"; public const string N_EnemyPathGroup = "EnemyPathGroup";
public const string N_UnitIdNum = "UnitIdNum"; public const string N_UnitIdNum = "UnitIdNum";
public List<PathPoint> PathPoints = new List<PathPoint>();
public EnemyPathGroup(dynamic bymlNode) public EnemyPathGroup(dynamic bymlNode)
{ {
if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode; if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode;

View File

@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace FirstPlugin.Turbo.CourseMuuntStructs
{
public class PathGroup
{
public List<PathPoint> PathPoints = new List<PathPoint>();
}
}

View File

@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using GL_EditorFramework.GL_Core;
using GL_EditorFramework.Interfaces;
using OpenTK.Graphics.OpenGL;
using OpenTK;
using System.Drawing;
namespace FirstPlugin.Turbo.CourseMuuntStructs
{
public class RenderableConnectedPaths : AbstractGlDrawable
{
private static ShaderProgram defaultShaderProgram;
public List<PathGroup> PathGroups = new List<PathGroup>();
public void AddGroup(PathGroup group)
{
PathGroups.Add(new PathGroup()
{
PathPoints = group.PathPoints,
});
}
public override void Prepare(GL_ControlLegacy control)
{
}
public override void Prepare(GL_ControlModern control)
{
var defaultFrag = new FragmentShader(
@"#version 330
void main(){
gl_FragColor = vec4(0,1,0,1);
}");
var defaultVert = new VertexShader(
@"#version 330
in vec4 position;
uniform mat4 mtxCam;
uniform mat4 mtxMdl;
void main(){
gl_Position = mtxCam * mtxMdl * vec4(position.xyz, 1);
}");
defaultShaderProgram = new ShaderProgram(defaultFrag, defaultVert);
}
public override void Draw(GL_ControlLegacy control, Pass pass)
{
foreach (var group in PathGroups)
{
foreach (var path in group.PathPoints)
{
GL.LineWidth(2f);
foreach (var nextPt in path.NextPoints)
{
GL.Color3(Color.Blue);
GL.Begin(PrimitiveType.Lines);
GL.Vertex3(path.Translate);
GL.Vertex3(PathGroups[nextPt.PathID].PathPoints[nextPt.PtID].Translate);
GL.End();
}
foreach (var prevPt in path.PrevPoints)
{
GL.Color3(Color.Blue);
GL.Begin(PrimitiveType.Lines);
GL.Vertex3(path.Translate);
GL.Vertex3(PathGroups[prevPt.PathID].PathPoints[prevPt.PtID].Translate);
GL.End();
}
}
}
}
public override void Draw(GL_ControlModern control, Pass pass)
{
control.CurrentShader = defaultShaderProgram;
foreach (var group in PathGroups)
{
foreach (var path in group.PathPoints)
{
GL.LineWidth(2f);
foreach (var nextPt in path.NextPoints)
{
GL.Color3(Color.Blue);
GL.Begin(PrimitiveType.Lines);
GL.Vertex3(path.Translate);
GL.Vertex3(PathGroups[nextPt.PathID].PathPoints[nextPt.PtID].Translate);
GL.End();
}
foreach (var prevPt in path.PrevPoints)
{
GL.Color3(Color.Blue);
GL.Begin(PrimitiveType.Lines);
GL.Vertex3(path.Translate);
GL.Vertex3(PathGroups[prevPt.PathID].PathPoints[prevPt.PtID].Translate);
GL.End();
}
}
}
}
}
}

View File

@ -30,17 +30,21 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitter1 = new System.Windows.Forms.Splitter();
this.stPanel2 = new Switch_Toolbox.Library.Forms.STPanel(); this.stPanel2 = new Switch_Toolbox.Library.Forms.STPanel();
this.stPropertyGrid1 = new Switch_Toolbox.Library.Forms.STPropertyGrid(); this.stPropertyGrid1 = new Switch_Toolbox.Library.Forms.STPropertyGrid();
this.splitter1 = new System.Windows.Forms.Splitter();
this.stPanel1 = new Switch_Toolbox.Library.Forms.STPanel(); this.stPanel1 = new Switch_Toolbox.Library.Forms.STPanel();
this.treeViewCustom1 = new Switch_Toolbox.Library.TreeViewCustom();
this.stButton2 = new Switch_Toolbox.Library.Forms.STButton(); this.stButton2 = new Switch_Toolbox.Library.Forms.STButton();
this.stButton1 = new Switch_Toolbox.Library.Forms.STButton(); this.stButton1 = new Switch_Toolbox.Library.Forms.STButton();
this.stPanel3 = new Switch_Toolbox.Library.Forms.STPanel(); this.stPanel3 = new Switch_Toolbox.Library.Forms.STPanel();
this.objectCB = new Switch_Toolbox.Library.Forms.STComboBox(); this.objectCB = new Switch_Toolbox.Library.Forms.STComboBox();
this.stTabControl1 = new Switch_Toolbox.Library.Forms.STTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.stMenuStrip1 = new Switch_Toolbox.Library.Forms.STMenuStrip(); this.stMenuStrip1 = new Switch_Toolbox.Library.Forms.STMenuStrip();
this.viewIntroCameraToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewIntroCameraToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.treeViewCustom1 = new Switch_Toolbox.Library.TreeViewCustom(); this.stPanel4 = new Switch_Toolbox.Library.Forms.STPanel();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
@ -48,6 +52,8 @@
this.stPanel2.SuspendLayout(); this.stPanel2.SuspendLayout();
this.stPanel1.SuspendLayout(); this.stPanel1.SuspendLayout();
this.stPanel3.SuspendLayout(); this.stPanel3.SuspendLayout();
this.stTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.stMenuStrip1.SuspendLayout(); this.stMenuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -65,11 +71,21 @@
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
this.splitContainer1.Panel2.Controls.Add(this.stTabControl1);
this.splitContainer1.Panel2.Controls.Add(this.stMenuStrip1); this.splitContainer1.Panel2.Controls.Add(this.stMenuStrip1);
this.splitContainer1.Size = new System.Drawing.Size(780, 492); this.splitContainer1.Size = new System.Drawing.Size(780, 492);
this.splitContainer1.SplitterDistance = 170; this.splitContainer1.SplitterDistance = 170;
this.splitContainer1.TabIndex = 1; this.splitContainer1.TabIndex = 1;
// //
// splitter1
//
this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter1.Location = new System.Drawing.Point(0, 317);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(170, 3);
this.splitter1.TabIndex = 1;
this.splitter1.TabStop = false;
//
// stPanel2 // stPanel2
// //
this.stPanel2.Controls.Add(this.stPropertyGrid1); this.stPanel2.Controls.Add(this.stPropertyGrid1);
@ -89,15 +105,6 @@
this.stPropertyGrid1.Size = new System.Drawing.Size(170, 172); this.stPropertyGrid1.Size = new System.Drawing.Size(170, 172);
this.stPropertyGrid1.TabIndex = 0; this.stPropertyGrid1.TabIndex = 0;
// //
// splitter1
//
this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter1.Location = new System.Drawing.Point(0, 317);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(170, 3);
this.splitter1.TabIndex = 1;
this.splitter1.TabStop = false;
//
// stPanel1 // stPanel1
// //
this.stPanel1.Controls.Add(this.treeViewCustom1); this.stPanel1.Controls.Add(this.treeViewCustom1);
@ -110,6 +117,18 @@
this.stPanel1.Size = new System.Drawing.Size(170, 317); this.stPanel1.Size = new System.Drawing.Size(170, 317);
this.stPanel1.TabIndex = 0; this.stPanel1.TabIndex = 0;
// //
// treeViewCustom1
//
this.treeViewCustom1.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.treeViewCustom1.ImageIndex = 0;
this.treeViewCustom1.Location = new System.Drawing.Point(3, 30);
this.treeViewCustom1.Name = "treeViewCustom1";
this.treeViewCustom1.SelectedImageIndex = 0;
this.treeViewCustom1.Size = new System.Drawing.Size(167, 252);
this.treeViewCustom1.TabIndex = 3;
//
// stButton2 // stButton2
// //
this.stButton2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.stButton2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
@ -154,6 +173,41 @@
this.objectCB.TabIndex = 0; this.objectCB.TabIndex = 0;
this.objectCB.SelectedIndexChanged += new System.EventHandler(this.objectCB_SelectedIndexChanged); this.objectCB.SelectedIndexChanged += new System.EventHandler(this.objectCB_SelectedIndexChanged);
// //
// stTabControl1
//
this.stTabControl1.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.stTabControl1.Controls.Add(this.tabPage1);
this.stTabControl1.Controls.Add(this.tabPage2);
this.stTabControl1.Location = new System.Drawing.Point(3, 27);
this.stTabControl1.myBackColor = System.Drawing.Color.Empty;
this.stTabControl1.Name = "stTabControl1";
this.stTabControl1.SelectedIndex = 0;
this.stTabControl1.Size = new System.Drawing.Size(600, 462);
this.stTabControl1.TabIndex = 1;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.stPanel4);
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(592, 433);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "3D View";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
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(592, 433);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "2D View";
this.tabPage2.UseVisualStyleBackColor = true;
//
// stMenuStrip1 // stMenuStrip1
// //
this.stMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.stMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -171,17 +225,13 @@
this.viewIntroCameraToolStripMenuItem.Text = "View Intro Camera"; this.viewIntroCameraToolStripMenuItem.Text = "View Intro Camera";
this.viewIntroCameraToolStripMenuItem.Click += new System.EventHandler(this.viewIntroCameraToolStripMenuItem_Click); this.viewIntroCameraToolStripMenuItem.Click += new System.EventHandler(this.viewIntroCameraToolStripMenuItem_Click);
// //
// treeViewCustom1 // stPanel4
// //
this.treeViewCustom1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.stPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
| System.Windows.Forms.AnchorStyles.Left) this.stPanel4.Location = new System.Drawing.Point(3, 3);
| System.Windows.Forms.AnchorStyles.Right))); this.stPanel4.Name = "stPanel4";
this.treeViewCustom1.ImageIndex = 0; this.stPanel4.Size = new System.Drawing.Size(586, 427);
this.treeViewCustom1.Location = new System.Drawing.Point(3, 30); this.stPanel4.TabIndex = 0;
this.treeViewCustom1.Name = "treeViewCustom1";
this.treeViewCustom1.SelectedImageIndex = 0;
this.treeViewCustom1.Size = new System.Drawing.Size(167, 252);
this.treeViewCustom1.TabIndex = 3;
// //
// TurboMunntEditor // TurboMunntEditor
// //
@ -198,6 +248,8 @@
this.stPanel2.ResumeLayout(false); this.stPanel2.ResumeLayout(false);
this.stPanel1.ResumeLayout(false); this.stPanel1.ResumeLayout(false);
this.stPanel3.ResumeLayout(false); this.stPanel3.ResumeLayout(false);
this.stTabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.stMenuStrip1.ResumeLayout(false); this.stMenuStrip1.ResumeLayout(false);
this.stMenuStrip1.PerformLayout(); this.stMenuStrip1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
@ -218,5 +270,9 @@
private Switch_Toolbox.Library.Forms.STMenuStrip stMenuStrip1; private Switch_Toolbox.Library.Forms.STMenuStrip stMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem viewIntroCameraToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem viewIntroCameraToolStripMenuItem;
private Switch_Toolbox.Library.TreeViewCustom treeViewCustom1; private Switch_Toolbox.Library.TreeViewCustom treeViewCustom1;
private Switch_Toolbox.Library.Forms.STTabControl stTabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private Switch_Toolbox.Library.Forms.STPanel stPanel4;
} }
} }

View File

@ -21,10 +21,12 @@ namespace FirstPlugin.Forms
{ {
InitializeComponent(); InitializeComponent();
stTabControl1.myBackColor = FormThemes.BaseTheme.FormBackColor;
viewport = new Viewport(); viewport = new Viewport();
viewport.Dock = DockStyle.Fill; viewport.Dock = DockStyle.Fill;
viewport.scene.SelectionChanged += Scene_SelectionChanged; viewport.scene.SelectionChanged += Scene_SelectionChanged;
splitContainer1.Panel2.Controls.Add(viewport); stPanel4.Controls.Add(viewport);
} }
CourseMuuntScene scene; CourseMuuntScene scene;
@ -83,8 +85,10 @@ namespace FirstPlugin.Forms
if (scene.EnemyPaths.Count > 0) if (scene.EnemyPaths.Count > 0)
{ {
objectCB.Items.Add("Enemy Paths"); objectCB.Items.Add("Enemy Paths");
var renderablePath = new RenderablePaths(); var renderablePath = new RenderableConnectedPaths();
renderablePath.PathGroups = scene.EnemyPaths; foreach (var group in scene.EnemyPaths)
renderablePath.AddGroup(group);
viewport.AddDrawable(renderablePath); viewport.AddDrawable(renderablePath);
foreach (var group in scene.EnemyPaths) foreach (var group in scene.EnemyPaths)

View File

@ -333,6 +333,8 @@
<Compile Include="GUI\Byaml\CourseMuunt\Paths\EnemyPaths.cs" /> <Compile Include="GUI\Byaml\CourseMuunt\Paths\EnemyPaths.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Paths\LapPaths.cs" /> <Compile Include="GUI\Byaml\CourseMuunt\Paths\LapPaths.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Base\RenderablePathPoint.cs" /> <Compile Include="GUI\Byaml\CourseMuunt\Base\RenderablePathPoint.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Paths\PathGroup.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Paths\RenderableConnectedPaths.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Paths\ReturnPoint.cs" /> <Compile Include="GUI\Byaml\CourseMuunt\Paths\ReturnPoint.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Base\PathPoint.cs" /> <Compile Include="GUI\Byaml\CourseMuunt\Base\PathPoint.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\TurboMunntEditor.cs"> <Compile Include="GUI\Byaml\CourseMuunt\TurboMunntEditor.cs">

View File

@ -1 +1 @@
5ef390c546d41f6a25da61da1f96e06785e1a7a0 b129ff847d9889dfce2afb4b6ab46e829b814157

View File

@ -580,7 +580,7 @@
<Compile Include="STToolStipMenuItem.cs"> <Compile Include="STToolStipMenuItem.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="Swizzling\GTX.cs" /> <Compile Include="Swizzling\GX2.cs" />
<Compile Include="Swizzling\TegraX1Swizzle.cs" /> <Compile Include="Swizzling\TegraX1Swizzle.cs" />
<Compile Include="ThemeConfig.cs" /> <Compile Include="ThemeConfig.cs" />
<Compile Include="UpdateProgram.cs" /> <Compile Include="UpdateProgram.cs" />