diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 69ec8eff..a50a856d 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 03a5055b..e390f76b 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index 91888c0e..3bce7f58 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/CourseMuuntStructs.cs b/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/CourseMuuntStructs.cs index ce9bc90d..4105999c 100644 --- a/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/CourseMuuntStructs.cs +++ b/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/CourseMuuntStructs.cs @@ -287,7 +287,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs else throw new Exception("Not a dictionary"); foreach (var point in this["PathPt"]) { - PathPoints.Add(new PathPoint(point)); + PathPoints.Add(new LapPatPoint(point)); } foreach (var point in this["ReturnPoints"]) { @@ -331,6 +331,56 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs } } + public class LapPatPoint: PathPoint + { + [Category("Properties")] + public int CheckPoint + { + get { return this["CheckPoint"]; } + set { this["CheckPoint"] = value;} + } + + [Category("Properties")] + public int ClipIdx + { + get { return this["ClipIdx"]; } + set { this["ClipIdx"] = value; } + } + + [Category("Properties")] + public bool HeadLightSW + { + get { return this["HeadLightSW"]; } + set { this["HeadLightSW"] = value; } + } + + [Category("Properties")] + public int LapCheck + { + get { return this["LapCheck"]; } + set { this["LapCheck"] = value; } + } + + [Category("Properties")] + public int MapCameraFovy + { + get { return this["MapCameraFovy"]; } + set { this["MapCameraFovy"] = value; } + } + + [Category("Properties")] + public int MapCameraY + { + get { return this["MapCameraY"]; } + set { this["MapCameraY"] = value; } + } + + public LapPatPoint(dynamic bymlNode) + { + if (bymlNode is Dictionary) Prop = (Dictionary)bymlNode; + else throw new Exception("Not a dictionary"); + } + } public class PointID : IObject { diff --git a/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/PathPoint.cs b/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/PathPoint.cs index 84ad56e9..1f3a579c 100644 --- a/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/PathPoint.cs +++ b/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/PathPoint.cs @@ -8,11 +8,13 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs { public class PathPoint : IObject { + [Browsable(false)] public RenderablePathPoint RenderablePoint { get { - return new RenderablePathPoint(Translate, Rotate, Scale); + var point = new RenderablePathPoint(Translate, Rotate, Scale, this); + return point; } } @@ -22,12 +24,6 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs public const string N_Id = "UnitIdNum"; public const string N_ObjectID = "ObjId"; - public PathPoint(dynamic bymlNode) - { - if (bymlNode is Dictionary) Prop = (Dictionary)bymlNode; - else throw new Exception("Not a dictionary"); - } - [Browsable(false)] public Dictionary Prop { get; set; } = new Dictionary(); @@ -52,7 +48,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs public List ControlPoints = new List(); - [Category("Rotate")] + [Category("Transform")] public Vector3 Rotate { get { return new Vector3(this[N_Rotate]["X"], this[N_Rotate]["Y"], this[N_Rotate]["Z"]); ; } @@ -64,7 +60,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs } } - [Category("Scale")] + [Category("Transform")] public Vector3 Scale { get { return new Vector3(this[N_Scale]["X"], this[N_Scale]["Y"], this[N_Scale]["Z"]); ; } @@ -76,7 +72,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs } } - [Category("Translate")] + [Category("Transform")] public Vector3 Translate { get { return new Vector3(this[N_Translate]["X"], this[N_Translate]["Y"], this[N_Translate]["Z"]); ; } diff --git a/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/RenderablePathPoint.cs b/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/RenderablePathPoint.cs index 01b4ac01..2491df2f 100644 --- a/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/RenderablePathPoint.cs +++ b/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/RenderablePathPoint.cs @@ -9,6 +9,8 @@ namespace GL_EditorFramework.EditorDrawables { public class RenderablePathPoint : EditableObject { + public object NodeObject; + public bool IsNormalTanTransform = false; protected Vector3 position = new Vector3(0, 0, 0); @@ -26,7 +28,8 @@ namespace GL_EditorFramework.EditorDrawables protected static Vector4 Color = new Vector4(0f, 0.25f, 1f, 1f); - public RenderablePathPoint(Vector3 pos, Vector3 rot, Vector3 sca) { + public RenderablePathPoint(Vector3 pos, Vector3 rot, Vector3 sca, object nodeObject) { + NodeObject = nodeObject; UpdateTransform(pos, rot, sca); } diff --git a/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/TurboMunntEditor.cs b/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/TurboMunntEditor.cs index fb86405f..9032e291 100644 --- a/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/TurboMunntEditor.cs +++ b/Switch_FileFormatsMain/GUI/Byaml/CourseMuunt/TurboMunntEditor.cs @@ -7,6 +7,7 @@ using Switch_Toolbox.Library.Forms; using Switch_Toolbox.Library; using System.Windows.Forms; using FirstPlugin.Turbo.CourseMuuntStructs; +using GL_EditorFramework.EditorDrawables; namespace FirstPlugin.Forms { @@ -20,6 +21,7 @@ namespace FirstPlugin.Forms viewport = new Viewport(); viewport.Dock = DockStyle.Fill; + viewport.scene.SelectionChanged += Scene_SelectionChanged; splitContainer1.Panel2.Controls.Add(viewport); } @@ -76,6 +78,18 @@ namespace FirstPlugin.Forms } } + private void Scene_SelectionChanged(object sender, EventArgs e) + { + foreach (EditableObject o in viewport.scene.objects) + { + if (o.IsSelected() && o is RenderablePathPoint) + { + stPropertyGrid1.LoadProperty(((RenderablePathPoint)o).NodeObject, OnPropertyChanged); + } + } + } + + private void objectCB_SelectedIndexChanged(object sender, EventArgs e) { if (objectCB.SelectedIndex <= 0) diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index 469ffa4a..14536a00 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Switch_FileFormatsMain/obj/Release/FirstPlugin.Plg.dll b/Switch_FileFormatsMain/obj/Release/FirstPlugin.Plg.dll index f5bd3075..a4a58128 100644 Binary files a/Switch_FileFormatsMain/obj/Release/FirstPlugin.Plg.dll and b/Switch_FileFormatsMain/obj/Release/FirstPlugin.Plg.dll differ diff --git a/Switch_FileFormatsMain/obj/Release/FirstPlugin.Plg.pdb b/Switch_FileFormatsMain/obj/Release/FirstPlugin.Plg.pdb index b3c39c42..198edcf0 100644 Binary files a/Switch_FileFormatsMain/obj/Release/FirstPlugin.Plg.pdb and b/Switch_FileFormatsMain/obj/Release/FirstPlugin.Plg.pdb differ