More bug fixes
Fix bymls with path nodes from saving. Fix material list not loading when another object is selected. Fix skeletons not exporting Fix materials missing a name and not updating in the editor properly - Fix dds and bftex not showing on the filter for bntx/nutexb properly
This commit is contained in:
parent
5edb6d4174
commit
211326d253
BIN
.vs/Switch_Toolbox/DesignTimeBuild/.dtbcache
Normal file
BIN
.vs/Switch_Toolbox/DesignTimeBuild/.dtbcache
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -951,7 +951,7 @@ namespace Bfres.Structs
|
||||
mat.Material.Name = Utils.RenameDuplicateString(keyList, mat.Material.Name);
|
||||
keyList.Clear();
|
||||
|
||||
Text = mat.Material.Name;
|
||||
mat.Text = mat.Material.Name;
|
||||
|
||||
materials.Add(mat.Text, mat);
|
||||
Nodes["FmatFolder"].Nodes.Add(mat);
|
||||
|
@ -117,7 +117,10 @@ namespace Bfres.Structs
|
||||
|
||||
public override void Export(string FileName)
|
||||
{
|
||||
Skeleton.Export(FileName, ((FMDL)Parent).GetResFile());
|
||||
if (SkeletonU != null)
|
||||
SkeletonU.Export(FileName, ((FMDL)Parent).GetResFileU());
|
||||
else
|
||||
Skeleton.Export(FileName, ((FMDL)Parent).GetResFile());
|
||||
}
|
||||
|
||||
public override void Replace(string FileName)
|
||||
|
@ -69,7 +69,7 @@ namespace FirstPlugin
|
||||
|
||||
public ByamlEditor OpenForm()
|
||||
{
|
||||
ByamlEditor editor = new ByamlEditor(data.RootNode, data.SupportPaths, data.Version, data.byteOrder, IsDialog, FileName);
|
||||
ByamlEditor editor = new ByamlEditor(data.RootNode, data.SupportPaths, data.Version, data.byteOrder, IsDialog, this);
|
||||
editor.FileFormat = this;
|
||||
editor.Text = FileName;
|
||||
editor.Dock = DockStyle.Fill;
|
||||
@ -82,9 +82,7 @@ namespace FirstPlugin
|
||||
|
||||
IsDialog = IFileInfo != null && IFileInfo.InArchive;
|
||||
|
||||
Console.WriteLine($"IsDialog " + IsDialog);
|
||||
|
||||
data = ByamlFile.LoadN(stream, false);
|
||||
data = ByamlFile.LoadN(stream, true);
|
||||
}
|
||||
public void Unload()
|
||||
{
|
||||
|
@ -263,7 +263,7 @@ namespace FirstPlugin
|
||||
}
|
||||
}
|
||||
|
||||
KCLRendering Renderer;
|
||||
public KCLRendering Renderer;
|
||||
bool IsLoaded = false;
|
||||
public override void OnClick(TreeView treeView)
|
||||
{
|
||||
|
@ -599,7 +599,7 @@ namespace FirstPlugin
|
||||
// if (!mdl.Skeleton.bones[m.boneIndx].Visible)
|
||||
// m.Checked = false;
|
||||
|
||||
if (m.Checked && mdl.Skeleton.bones[m.BoneIndex].Visible)
|
||||
if (m.Checked && mdl.Skeleton.bones.Count > 0 && mdl.Skeleton.bones[m.BoneIndex].Visible)
|
||||
{
|
||||
shader.SetVector3("materialSelectColor", new Vector3(0));
|
||||
if (m.GetMaterial().IsSelected)
|
||||
|
@ -109,6 +109,7 @@
|
||||
this.textBoxShaderModel.Name = "textBoxShaderModel";
|
||||
this.textBoxShaderModel.Size = new System.Drawing.Size(257, 20);
|
||||
this.textBoxShaderModel.TabIndex = 41;
|
||||
this.textBoxShaderModel.TextChanged += new System.EventHandler(this.textBoxShaderModel_TextChanged);
|
||||
//
|
||||
// stTabControl1
|
||||
//
|
||||
@ -260,6 +261,7 @@
|
||||
this.textBoxShaderArchive.Name = "textBoxShaderArchive";
|
||||
this.textBoxShaderArchive.Size = new System.Drawing.Size(257, 20);
|
||||
this.textBoxShaderArchive.TabIndex = 39;
|
||||
this.textBoxShaderArchive.TextChanged += new System.EventHandler(this.textBoxShaderArchive_TextChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
@ -277,6 +279,7 @@
|
||||
this.textBoxMaterialName.Name = "textBoxMaterialName";
|
||||
this.textBoxMaterialName.Size = new System.Drawing.Size(257, 20);
|
||||
this.textBoxMaterialName.TabIndex = 37;
|
||||
this.textBoxMaterialName.TextChanged += new System.EventHandler(this.textBoxMaterialName_TextChanged);
|
||||
//
|
||||
// stLabel1
|
||||
//
|
||||
|
@ -302,5 +302,17 @@ namespace FirstPlugin.Forms
|
||||
material.shaderassign.attributes = editor.GetNewInputs();
|
||||
}
|
||||
}
|
||||
|
||||
private void textBoxMaterialName_TextChanged(object sender, EventArgs e){
|
||||
material.Text = textBoxMaterialName.Text;
|
||||
}
|
||||
|
||||
private void textBoxShaderArchive_TextChanged(object sender, EventArgs e) {
|
||||
material.shaderassign.ShaderArchive = textBoxShaderArchive.Text;
|
||||
}
|
||||
|
||||
private void textBoxShaderModel_TextChanged(object sender, EventArgs e) {
|
||||
material.shaderassign.ShaderModel = textBoxShaderModel.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,6 +109,7 @@ namespace FirstPlugin
|
||||
{
|
||||
IsLoaded = false;
|
||||
IsBoneListLoaded = false;
|
||||
IsMatListLoaded = false;
|
||||
lodDisplayCB.Items.Clear();
|
||||
lodListView.Items.Clear();
|
||||
bonesCB.Items.Clear();
|
||||
@ -157,7 +158,7 @@ namespace FirstPlugin
|
||||
if (!IsLoaded)
|
||||
return;
|
||||
|
||||
if (materialComboBox1.SelectedIndex >= 0 && IsLoaded)
|
||||
if (materialComboBox1.SelectedIndex >= 0 && IsMatListLoaded)
|
||||
{
|
||||
activeShape.MaterialIndex = materialComboBox1.SelectedIndex;
|
||||
materialIndexUD.Value = materialComboBox1.SelectedIndex;
|
||||
@ -213,7 +214,6 @@ namespace FirstPlugin
|
||||
}
|
||||
|
||||
private void materialComboBox1_Click(object sender, EventArgs e) {
|
||||
ReloadMaterialList();
|
||||
}
|
||||
|
||||
private void materialComboBox1_KeyDown(object sender, KeyEventArgs e) {
|
||||
|
@ -34,23 +34,14 @@ namespace FirstPlugin
|
||||
public string FileName = "";
|
||||
bool pathSupport;
|
||||
ushort bymlVer;
|
||||
public ByamlEditor(System.Collections.IEnumerable by, bool _pathSupport, ushort _ver, ByteOrder defaultOrder = ByteOrder.LittleEndian, bool IsSaveDialog = false, string name = "")
|
||||
|
||||
public ByamlEditor(System.Collections.IEnumerable by, bool _pathSupport, ushort _ver, ByteOrder defaultOrder = ByteOrder.LittleEndian, bool IsSaveDialog = false, BYAML byaml = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
treeView1.BackColor = FormThemes.BaseTheme.FormBackColor;
|
||||
treeView1.ForeColor = FormThemes.BaseTheme.FormForeColor;
|
||||
|
||||
if (name == "course_muunt.byaml")
|
||||
{
|
||||
Controls.Clear();
|
||||
|
||||
TurboMunntEditor editor = new TurboMunntEditor();
|
||||
editor.LoadCourseInfo();
|
||||
Controls.Add(editor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsSaveDialog)
|
||||
{
|
||||
stButton1.Visible = false;
|
||||
@ -58,8 +49,22 @@ namespace FirstPlugin
|
||||
stPanel1.Dock = DockStyle.Fill;
|
||||
}
|
||||
|
||||
/* if (byaml.FileName == "course_muunt.byaml")
|
||||
{
|
||||
pathSupport = true;
|
||||
|
||||
stPanel1.Controls.Remove(treeView1);
|
||||
|
||||
TurboMunntEditor editor = new TurboMunntEditor();
|
||||
editor.Dock = DockStyle.Fill;
|
||||
editor.LoadCourseInfo(by, byaml.FilePath);
|
||||
stPanel1.Controls.Add(editor);
|
||||
return;
|
||||
}*/
|
||||
|
||||
|
||||
byteOrder = defaultOrder;
|
||||
FileName = name;
|
||||
FileName = byaml.FileName;
|
||||
byml = by;
|
||||
pathSupport = _pathSupport;
|
||||
bymlVer = _ver;
|
||||
@ -91,7 +96,7 @@ namespace FirstPlugin
|
||||
}
|
||||
|
||||
Stream saveStream = null;
|
||||
public ByamlEditor(System.Collections.IEnumerable by, bool _pathSupport, Stream saveTo, ushort _ver, ByteOrder defaultOrder = ByteOrder.LittleEndian, bool IsSaveDialog = false, string name = "") : this(by, _pathSupport, _ver, defaultOrder, IsSaveDialog, name)
|
||||
public ByamlEditor(System.Collections.IEnumerable by, bool _pathSupport, Stream saveTo, ushort _ver, ByteOrder defaultOrder = ByteOrder.LittleEndian, bool IsSaveDialog = false, BYAML byaml = null) : this(by, _pathSupport, _ver, defaultOrder, IsSaveDialog, byaml)
|
||||
{
|
||||
|
||||
treeView1.BackColor = FormThemes.BaseTheme.FormBackColor;
|
||||
@ -257,7 +262,7 @@ namespace FirstPlugin
|
||||
opn.Filter = "byml file | *.byml";
|
||||
if (opn.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
OpenByml(opn.FileName);
|
||||
OpenByml(opn.FileName, new BYAML());
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,25 +271,25 @@ namespace FirstPlugin
|
||||
return MessageBox.Show("Does this game support paths ?", "", MessageBoxButtons.YesNo) == DialogResult.Yes;
|
||||
}
|
||||
|
||||
public static void OpenByml(string Filename) =>
|
||||
OpenByml(new FileStream(Filename, FileMode.Open), Filename);
|
||||
public static void OpenByml(string Filename, BYAML byaml) =>
|
||||
OpenByml(new FileStream(Filename, FileMode.Open), byaml, Filename);
|
||||
|
||||
public static void OpenByml(Stream file, string FileName = "") =>
|
||||
OpenByml(file, FileName, SupportPaths());
|
||||
public static void OpenByml(Stream file, BYAML byaml, string FileName = "") =>
|
||||
OpenByml(file, byaml, FileName, SupportPaths());
|
||||
|
||||
public static void OpenByml(Stream file, string FileName, bool paths) =>
|
||||
OpenByml(file, FileName, paths, null, false);
|
||||
public static void OpenByml(Stream file, BYAML byaml, string FileName, bool paths) =>
|
||||
OpenByml(file, byaml, FileName, paths, null, false);
|
||||
|
||||
public static void OpenByml(Stream file, string FileName, bool? paths, Stream saveStream, bool AsDialog)
|
||||
public static void OpenByml(Stream file, BYAML byaml, string FileName, bool? paths, Stream saveStream, bool AsDialog)
|
||||
{
|
||||
bool _paths = paths == null ? SupportPaths() : paths.Value;
|
||||
var byml = ByamlFile.LoadN(file, _paths);
|
||||
OpenByml(byml, FileName, saveStream, AsDialog);
|
||||
OpenByml(byml, byaml, saveStream, AsDialog);
|
||||
}
|
||||
|
||||
public static void OpenByml(BymlFileData data, string FileName, Stream saveStream = null, bool AsDialog = false)
|
||||
public static void OpenByml(BymlFileData data, BYAML byaml, Stream saveStream = null, bool AsDialog = false)
|
||||
{
|
||||
var form = new ByamlEditor(data.RootNode, data.SupportPaths, saveStream, data.Version, data.byteOrder, AsDialog, FileName);
|
||||
var form = new ByamlEditor(data.RootNode, data.SupportPaths, saveStream, data.Version, data.byteOrder, AsDialog, byaml);
|
||||
|
||||
if (saveStream != null && saveStream.CanWrite)
|
||||
{
|
||||
|
224
Switch_FileFormatsMain/GUI/Byaml/CourseMuuntStructs.cs
Normal file
224
Switch_FileFormatsMain/GUI/Byaml/CourseMuuntStructs.cs
Normal file
@ -0,0 +1,224 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenGl_EditorFramework;
|
||||
using OpenTK;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
public class CourseMuuntScene
|
||||
{
|
||||
private dynamic root;
|
||||
|
||||
[Description("The effect index used globally across the course.")]
|
||||
[Category("Scene")]
|
||||
[DisplayName("Effect Index")]
|
||||
public int EffectSW
|
||||
{
|
||||
get { return root["EffectSW"]; }
|
||||
set { root["EffectSW"] = value; }
|
||||
}
|
||||
|
||||
[Description("Enables or disables headlights for the course.")]
|
||||
[Category("Scene")]
|
||||
[DisplayName("HeadLight")]
|
||||
public bool HeadLight
|
||||
{
|
||||
get { return (root["HeadLight"] == 1) ? true : false; }
|
||||
set { root["HeadLight"] = value == true ? 1 : 0; }
|
||||
}
|
||||
|
||||
[Description("Determines if First Curve is left or right. This determines Latiku's direction.")]
|
||||
[Category("Scene")]
|
||||
[DisplayName("IsFirstLeft")]
|
||||
public bool IsFirstLeft
|
||||
{
|
||||
get
|
||||
{
|
||||
if (FirstCurve == "left")
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == true)
|
||||
FirstCurve = "left";
|
||||
else
|
||||
FirstCurve = "right";
|
||||
}
|
||||
}
|
||||
private string FirstCurve
|
||||
{
|
||||
get { return root["FirstCurve"]; }
|
||||
set { root["FirstCurve"] = value; }
|
||||
}
|
||||
|
||||
[Description("Unknown Value")]
|
||||
[Category("Scene")]
|
||||
[DisplayName("IsJugemAbove")]
|
||||
public bool IsJugemAbove
|
||||
{
|
||||
get { return root["IsJugemAbove"]; }
|
||||
set { root["IsJugemAbove"] = value; }
|
||||
}
|
||||
|
||||
[Description("Unknown Value")]
|
||||
[Category("Scene")]
|
||||
[DisplayName("JugemAbove")]
|
||||
public int JugemAbove
|
||||
{
|
||||
get { return root["JugemAbove"]; }
|
||||
set { root["JugemAbove"] = value; }
|
||||
}
|
||||
|
||||
[Description("Unknown Value")]
|
||||
[Category("Scene")]
|
||||
[DisplayName("LapJugemPos")]
|
||||
public int LapJugemPos
|
||||
{
|
||||
get { return root["LapJugemPos"]; }
|
||||
set { root["LapJugemPos"] = value; }
|
||||
}
|
||||
|
||||
[Description("The number of laps to be finished during the track.")]
|
||||
[Category("Scene")]
|
||||
[DisplayName("LapNumber")]
|
||||
public int LapNumber
|
||||
{
|
||||
get { return root["LapNumber"]; }
|
||||
set { root["LapNumber"] = value; }
|
||||
}
|
||||
|
||||
[Description("The number of pattern sets picked randomly at start.")]
|
||||
[Category("Scene")]
|
||||
[DisplayName("PatternNum")]
|
||||
public int PatternNum
|
||||
{
|
||||
get { return root["PatternNum"]; }
|
||||
set { root["PatternNum"] = value; }
|
||||
}
|
||||
|
||||
|
||||
[Category("Object Parameters")]
|
||||
public int OBJPrm1
|
||||
{
|
||||
get { return root["OBJPrm1"]; }
|
||||
set { root["OBJPrm1"] = value; }
|
||||
}
|
||||
|
||||
[Category("Object Parameters")]
|
||||
public int OBJPrm2
|
||||
{
|
||||
get { return root["OBJPrm2"]; }
|
||||
set { root["OBJPrm2"] = value; }
|
||||
}
|
||||
|
||||
[Category("Object Parameters")]
|
||||
public int OBJPrm3
|
||||
{
|
||||
get { return root["OBJPrm3"]; }
|
||||
set { root["OBJPrm3"] = value; }
|
||||
}
|
||||
|
||||
[Category("Object Parameters")]
|
||||
public int OBJPrm4
|
||||
{
|
||||
get { return root["OBJPrm4"]; }
|
||||
set { root["OBJPrm4"] = value; }
|
||||
}
|
||||
|
||||
[Category("Object Parameters")]
|
||||
public int OBJPrm5
|
||||
{
|
||||
get { return root["OBJPrm5"]; }
|
||||
set { root["OBJPrm5"] = value; }
|
||||
}
|
||||
|
||||
[Category("Object Parameters")]
|
||||
public int OBJPrm6
|
||||
{
|
||||
get { return root["OBJPrm6"]; }
|
||||
set { root["OBJPrm6"] = value; }
|
||||
}
|
||||
|
||||
[Category("Object Parameters")]
|
||||
public int OBJPrm7
|
||||
{
|
||||
get { return root["OBJPrm7"]; }
|
||||
set { root["OBJPrm7"] = value; }
|
||||
}
|
||||
|
||||
[Category("Object Parameters")]
|
||||
public int OBJPrm8
|
||||
{
|
||||
get { return root["OBJPrm8"]; }
|
||||
set { root["OBJPrm8"] = value; }
|
||||
}
|
||||
|
||||
public CourseMuuntScene(dynamic rootNode)
|
||||
{
|
||||
root = rootNode;
|
||||
}
|
||||
|
||||
public List<BFRES> BfresObjects = new List<BFRES>();
|
||||
public List<KCL> KclObjects = new List<KCL>();
|
||||
|
||||
public void AddRenderableKcl(string FilePath)
|
||||
{
|
||||
KCL kcl = (KCL)Switch_Toolbox.Library.IO.STFileLoader.OpenFileFormat(FilePath);
|
||||
KclObjects.Add(kcl);
|
||||
}
|
||||
|
||||
public void AddRenderableBfres(string FilePath)
|
||||
{
|
||||
BFRES bfres = (BFRES)Switch_Toolbox.Library.IO.STFileLoader.OpenFileFormat(FilePath);
|
||||
BfresObjects.Add(bfres);
|
||||
}
|
||||
}
|
||||
|
||||
public class Path
|
||||
{
|
||||
public List<object> Properties = new List<object>();
|
||||
|
||||
public List<PathPoint> PathPoints = new List<PathPoint>();
|
||||
}
|
||||
|
||||
public class PathPoint
|
||||
{
|
||||
public List<object> Properties = new List<object>();
|
||||
|
||||
public List<NextPoint> NextPoints = new List<NextPoint>();
|
||||
public List<PrevPoint> PrevPoints = new List<PrevPoint>();
|
||||
|
||||
public List<ControlPoint> ControlPoints = new List<ControlPoint>();
|
||||
|
||||
public Vector3 Rotate;
|
||||
public Vector3 Scale;
|
||||
public Vector3 Translate;
|
||||
}
|
||||
|
||||
public class PointId
|
||||
{
|
||||
public int PathID { get; set; } //For groups
|
||||
public int PtID { get; set; } //For points
|
||||
}
|
||||
|
||||
public class NextPoint : PointId { };
|
||||
public class PrevPoint : PointId { };
|
||||
|
||||
public class ControlPoint
|
||||
{
|
||||
public Vector3 Point1;
|
||||
public Vector3 Point2;
|
||||
}
|
||||
|
||||
public class ObjectNode
|
||||
{
|
||||
public Dictionary<string, dynamic> Properties { get; set; } = new Dictionary<string, dynamic>();
|
||||
|
||||
}
|
||||
}
|
@ -29,8 +29,21 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.stPanel1 = new Switch_Toolbox.Library.Forms.STPanel();
|
||||
this.splitter1 = new System.Windows.Forms.Splitter();
|
||||
this.stPanel2 = new Switch_Toolbox.Library.Forms.STPanel();
|
||||
this.stPropertyGrid1 = new Switch_Toolbox.Library.Forms.STPropertyGrid();
|
||||
this.stPanel3 = new Switch_Toolbox.Library.Forms.STPanel();
|
||||
this.listViewCustom1 = new Switch_Toolbox.Library.Forms.ListViewCustom();
|
||||
this.objectCB = new Switch_Toolbox.Library.Forms.STComboBox();
|
||||
this.stButton1 = new Switch_Toolbox.Library.Forms.STButton();
|
||||
this.stButton2 = new Switch_Toolbox.Library.Forms.STButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.stPanel1.SuspendLayout();
|
||||
this.stPanel2.SuspendLayout();
|
||||
this.stPanel3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
@ -38,10 +51,113 @@
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.stPanel2);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.splitter1);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.stPanel1);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(780, 492);
|
||||
this.splitContainer1.SplitterDistance = 170;
|
||||
this.splitContainer1.TabIndex = 1;
|
||||
//
|
||||
// stPanel1
|
||||
//
|
||||
this.stPanel1.Controls.Add(this.stButton2);
|
||||
this.stPanel1.Controls.Add(this.stButton1);
|
||||
this.stPanel1.Controls.Add(this.listViewCustom1);
|
||||
this.stPanel1.Controls.Add(this.stPanel3);
|
||||
this.stPanel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.stPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.stPanel1.Name = "stPanel1";
|
||||
this.stPanel1.Size = new System.Drawing.Size(170, 317);
|
||||
this.stPanel1.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;
|
||||
//
|
||||
// stPanel2
|
||||
//
|
||||
this.stPanel2.Controls.Add(this.stPropertyGrid1);
|
||||
this.stPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stPanel2.Location = new System.Drawing.Point(0, 320);
|
||||
this.stPanel2.Name = "stPanel2";
|
||||
this.stPanel2.Size = new System.Drawing.Size(170, 172);
|
||||
this.stPanel2.TabIndex = 2;
|
||||
//
|
||||
// stPropertyGrid1
|
||||
//
|
||||
this.stPropertyGrid1.AutoScroll = true;
|
||||
this.stPropertyGrid1.DisableHintDisplay = true;
|
||||
this.stPropertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stPropertyGrid1.Location = new System.Drawing.Point(0, 0);
|
||||
this.stPropertyGrid1.Name = "stPropertyGrid1";
|
||||
this.stPropertyGrid1.Size = new System.Drawing.Size(170, 172);
|
||||
this.stPropertyGrid1.TabIndex = 0;
|
||||
//
|
||||
// stPanel3
|
||||
//
|
||||
this.stPanel3.Controls.Add(this.objectCB);
|
||||
this.stPanel3.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.stPanel3.Location = new System.Drawing.Point(0, 0);
|
||||
this.stPanel3.Name = "stPanel3";
|
||||
this.stPanel3.Size = new System.Drawing.Size(170, 32);
|
||||
this.stPanel3.TabIndex = 0;
|
||||
//
|
||||
// listViewCustom1
|
||||
//
|
||||
this.listViewCustom1.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.listViewCustom1.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.listViewCustom1.Location = new System.Drawing.Point(3, 30);
|
||||
this.listViewCustom1.Name = "listViewCustom1";
|
||||
this.listViewCustom1.OwnerDraw = true;
|
||||
this.listViewCustom1.Size = new System.Drawing.Size(167, 250);
|
||||
this.listViewCustom1.TabIndex = 1;
|
||||
this.listViewCustom1.UseCompatibleStateImageBehavior = false;
|
||||
//
|
||||
// objectCB
|
||||
//
|
||||
this.objectCB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.objectCB.BorderColor = System.Drawing.Color.Empty;
|
||||
this.objectCB.BorderStyle = System.Windows.Forms.ButtonBorderStyle.Solid;
|
||||
this.objectCB.ButtonColor = System.Drawing.Color.Empty;
|
||||
this.objectCB.FormattingEnabled = true;
|
||||
this.objectCB.Location = new System.Drawing.Point(3, 3);
|
||||
this.objectCB.Name = "objectCB";
|
||||
this.objectCB.ReadOnly = true;
|
||||
this.objectCB.Size = new System.Drawing.Size(164, 21);
|
||||
this.objectCB.TabIndex = 0;
|
||||
this.objectCB.SelectedIndexChanged += new System.EventHandler(this.objectCB_SelectedIndexChanged);
|
||||
//
|
||||
// stButton1
|
||||
//
|
||||
this.stButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.stButton1.Location = new System.Drawing.Point(3, 288);
|
||||
this.stButton1.Name = "stButton1";
|
||||
this.stButton1.Size = new System.Drawing.Size(43, 23);
|
||||
this.stButton1.TabIndex = 1;
|
||||
this.stButton1.Text = "Add";
|
||||
this.stButton1.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// stButton2
|
||||
//
|
||||
this.stButton2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.stButton2.Location = new System.Drawing.Point(52, 288);
|
||||
this.stButton2.Name = "stButton2";
|
||||
this.stButton2.Size = new System.Drawing.Size(57, 23);
|
||||
this.stButton2.TabIndex = 2;
|
||||
this.stButton2.Text = "Remove";
|
||||
this.stButton2.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// TurboMunntEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@ -49,8 +165,12 @@
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "TurboMunntEditor";
|
||||
this.Size = new System.Drawing.Size(780, 492);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.stPanel1.ResumeLayout(false);
|
||||
this.stPanel2.ResumeLayout(false);
|
||||
this.stPanel3.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@ -58,5 +178,14 @@
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private Switch_Toolbox.Library.Forms.STPanel stPanel2;
|
||||
private Switch_Toolbox.Library.Forms.STPropertyGrid stPropertyGrid1;
|
||||
private System.Windows.Forms.Splitter splitter1;
|
||||
private Switch_Toolbox.Library.Forms.STPanel stPanel1;
|
||||
private Switch_Toolbox.Library.Forms.ListViewCustom listViewCustom1;
|
||||
private Switch_Toolbox.Library.Forms.STPanel stPanel3;
|
||||
private Switch_Toolbox.Library.Forms.STComboBox objectCB;
|
||||
private Switch_Toolbox.Library.Forms.STButton stButton2;
|
||||
private Switch_Toolbox.Library.Forms.STButton stButton1;
|
||||
}
|
||||
}
|
||||
|
@ -2,22 +2,74 @@
|
||||
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.IO;
|
||||
using Switch_Toolbox.Library.Forms;
|
||||
using Switch_Toolbox.Library;
|
||||
using System.Windows.Forms;
|
||||
using FirstPlugin.Turbo.CourseMuuntStructs;
|
||||
|
||||
namespace FirstPlugin.Forms
|
||||
{
|
||||
public partial class TurboMunntEditor : UserControl
|
||||
{
|
||||
Viewport viewport;
|
||||
|
||||
public TurboMunntEditor()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
viewport = new Viewport();
|
||||
viewport.Dock = DockStyle.Fill;
|
||||
splitContainer1.Panel2.Controls.Add(viewport);
|
||||
}
|
||||
|
||||
public void LoadCourseInfo()
|
||||
CourseMuuntScene scene;
|
||||
|
||||
public void LoadCourseInfo(System.Collections.IEnumerable by, string FilePath)
|
||||
{
|
||||
string CourseFolder = System.IO.Path.GetDirectoryName(FilePath);
|
||||
scene = new CourseMuuntScene(by);
|
||||
if (File.Exists($"{CourseFolder}/course_model.szs"))
|
||||
{
|
||||
// scene.AddRenderableBfres($"{CourseFolder}/course_model.szs");
|
||||
scene.AddRenderableKcl($"{CourseFolder}/course.kcl");
|
||||
|
||||
|
||||
foreach (var kcl in scene.KclObjects)
|
||||
{
|
||||
viewport.AddDrawable(kcl.Renderer);
|
||||
|
||||
kcl.Renderer.UpdateVertexData();
|
||||
}
|
||||
|
||||
/* foreach (var bfres in scene.BfresObjects)
|
||||
{
|
||||
viewport.AddDrawable(bfres.BFRESRender);
|
||||
|
||||
bfres.BFRESRender.UpdateVertexData();
|
||||
bfres.BFRESRender.UpdateTextureMaps();
|
||||
}*/
|
||||
viewport.LoadObjects();
|
||||
}
|
||||
|
||||
objectCB.Items.Add("Scene");
|
||||
objectCB.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void objectCB_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (objectCB.SelectedIndex <= 0)
|
||||
{
|
||||
string Text = objectCB.GetSelectedText();
|
||||
|
||||
if (Text == "Scene")
|
||||
{
|
||||
stPropertyGrid1.LoadProperty(scene, OnPropertyChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPropertyChanged()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -1,72 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenGl_EditorFramework;
|
||||
using OpenTK;
|
||||
|
||||
namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
public class Scene
|
||||
{
|
||||
public int EffectSW;
|
||||
public int HeadLight;
|
||||
public bool IsFirstLeft;
|
||||
public bool IsJugemAbove;
|
||||
public int JugemAbove;
|
||||
public int LapJugemPos;
|
||||
public int LapNumber;
|
||||
public int OBJPrm1;
|
||||
public int OBJPrm2;
|
||||
public int OBJPrm3;
|
||||
public int OBJPrm4;
|
||||
public int OBJPrm5;
|
||||
public int OBJPrm6;
|
||||
public int OBJPrm7;
|
||||
public int OBJPrm8;
|
||||
public int PatternNum;
|
||||
}
|
||||
|
||||
public class Path
|
||||
{
|
||||
public List<object> Properties = new List<object>();
|
||||
|
||||
public List<PathPoint> PathPoints = new List<PathPoint>();
|
||||
}
|
||||
|
||||
public class PathPoint
|
||||
{
|
||||
public List<object> Properties = new List<object>();
|
||||
|
||||
public List<NextPoint> NextPoints = new List<NextPoint>();
|
||||
public List<PrevPoint> PrevPoints = new List<PrevPoint>();
|
||||
|
||||
public List<ControlPoint> ControlPoints = new List<ControlPoint>();
|
||||
|
||||
public Vector3 Rotate;
|
||||
public Vector3 Scale;
|
||||
public Vector3 Translate;
|
||||
}
|
||||
|
||||
public class PointId
|
||||
{
|
||||
public int PathID { get; set; } //For groups
|
||||
public int PtID { get; set; } //For points
|
||||
}
|
||||
|
||||
public class NextPoint : PointId { };
|
||||
public class PrevPoint : PointId { };
|
||||
|
||||
public class ControlPoint
|
||||
{
|
||||
public Vector3 Point1;
|
||||
public Vector3 Point2;
|
||||
}
|
||||
|
||||
public class ObjectNode
|
||||
{
|
||||
public Dictionary<string, dynamic> Properties { get; set; } = new Dictionary<string, dynamic>();
|
||||
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ namespace FirstPlugin
|
||||
{
|
||||
public class FileFilters
|
||||
{
|
||||
public static string BNTX_TEX = GetFilter(".bftex, .dds",".astc", ".png", ".tga", ".jpg", ".tiff", ".gif");
|
||||
public static string BNTX_TEX = GetFilter(".bftex", ".dds",".astc", ".png", ".tga", ".jpg", ".tiff", ".gif");
|
||||
public static string FTEX = GetFilter(".bftex", ".dds", ".dds2", ".png", ".tga", ".jpg", ".tiff", ".gif");
|
||||
public static string FMDL = GetFilter(".bfmdl", ".dae", ".fbx", ".obj", ".csv");
|
||||
public static string FSKL = GetFilter(".bfskl");
|
||||
|
@ -323,6 +323,7 @@
|
||||
<Compile Include="GUI\BFRES\TexturePattern\TexPatternMaterialEditor.Designer.cs">
|
||||
<DependentUpon>TexPatternMaterialEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUI\Byaml\CourseMuuntStructs.cs" />
|
||||
<Compile Include="GUI\Byaml\TurboMunntEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@ -620,7 +621,6 @@
|
||||
<Compile Include="GUI\AttributeEditor.Designer.cs">
|
||||
<DependentUpon>AttributeEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUI\Editors\MK8TrackEditor\CourseMuuntStructs.cs" />
|
||||
<Compile Include="GUI\Editors\MK8TrackEditor\MK8MapCameraEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
b0fa789a3d02cd4abf3a1440541170110c30bf41
|
||||
eda986637e7a0ae6cb9b445f44e721c49da4aade
|
||||
|
Binary file not shown.
Binary file not shown.
BIN
Toolbox/Lib/Syroot.NintenTools.MarioKart8.pdb
Normal file
BIN
Toolbox/Lib/Syroot.NintenTools.MarioKart8.pdb
Normal file
Binary file not shown.
3361
Toolbox/Lib/Syroot.NintenTools.MarioKart8.xml
Normal file
3361
Toolbox/Lib/Syroot.NintenTools.MarioKart8.xml
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user