2019-03-25 21:50:05 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using OpenTK;
|
|
|
|
|
using System.ComponentModel;
|
2019-07-16 23:35:21 +02:00
|
|
|
|
using Toolbox.Library;
|
2019-03-25 21:50:05 +01:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return (root["EffectSW"] != null) ? root["EffectSW"] : -255; }
|
|
|
|
|
set { if (value != -255) root["EffectSW"] = value; }
|
2019-03-25 21:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[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
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return (root["FirstCurve"] != null) ? root["FirstCurve"] : "left"; }
|
2019-03-25 21:50:05 +01:00
|
|
|
|
set { root["FirstCurve"] = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Description("Unknown Value")]
|
|
|
|
|
[Category("Scene")]
|
|
|
|
|
[DisplayName("IsJugemAbove")]
|
|
|
|
|
public bool IsJugemAbove
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return (root["IsJugemAbove"] != null) ? root["IsJugemAbove"] : false; }
|
2019-03-25 21:50:05 +01:00
|
|
|
|
set { root["IsJugemAbove"] = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Description("Unknown Value")]
|
|
|
|
|
[Category("Scene")]
|
|
|
|
|
[DisplayName("JugemAbove")]
|
|
|
|
|
public int JugemAbove
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return (root["JugemAbove"] != null) ? root["JugemAbove"] : -1; }
|
|
|
|
|
set { if (value != -1) root["JugemAbove"] = value; }
|
2019-03-25 21:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Description("Unknown Value")]
|
|
|
|
|
[Category("Scene")]
|
|
|
|
|
[DisplayName("LapJugemPos")]
|
|
|
|
|
public int LapJugemPos
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return (root["LapJugemPos"] != null) ? root["LapJugemPos"] : -1; }
|
|
|
|
|
set { if (value != -1) root["LapJugemPos"] = value; }
|
2019-03-25 21:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Description("The number of laps to be finished during the track.")]
|
|
|
|
|
[Category("Scene")]
|
|
|
|
|
[DisplayName("LapNumber")]
|
|
|
|
|
public int LapNumber
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return (root["LapNumber"] != null) ? root["LapNumber"] : -1; }
|
|
|
|
|
set { if (value != -1) root["LapNumber"] = value; }
|
2019-03-25 21:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Description("The number of pattern sets picked randomly at start.")]
|
|
|
|
|
[Category("Scene")]
|
|
|
|
|
[DisplayName("PatternNum")]
|
|
|
|
|
public int PatternNum
|
|
|
|
|
{
|
2019-04-08 23:01:31 +02:00
|
|
|
|
get { return (root["PatternNum"] != null) ? root["PatternNum"] : -1; }
|
|
|
|
|
set { if (value != -1) root["PatternNum"] = value; }
|
2019-03-25 21:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[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; }
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-06 01:47:21 +02:00
|
|
|
|
public List<LapPathGroup> LapPaths;
|
2019-04-06 21:13:55 +02:00
|
|
|
|
public List<EnemyPathGroup> EnemyPaths;
|
2019-04-07 03:30:25 +02:00
|
|
|
|
public List<ItemPathGroup> ItemPaths;
|
|
|
|
|
public List<GlidePathGroup> GlidePaths;
|
|
|
|
|
public List<SteerAssistPathGroup> SteerAssistPaths;
|
2019-04-08 03:14:39 +02:00
|
|
|
|
public List<GravityPathGroup> GravityPaths;
|
|
|
|
|
public List<PullPathGroup> PullPaths;
|
|
|
|
|
public List<PathGroup> Paths;
|
|
|
|
|
public List<ObjPathGroup> ObjPaths;
|
|
|
|
|
public List<JugemPathGroup> JugemPaths;
|
|
|
|
|
public List<IntroCamera> IntroCameras;
|
|
|
|
|
|
|
|
|
|
public List<int> MapObjIdList;
|
|
|
|
|
public List<string> MapObjResList;
|
|
|
|
|
|
2019-04-17 00:24:10 +02:00
|
|
|
|
public IFileFormat MapCamera;
|
|
|
|
|
|
2019-03-25 21:50:05 +01:00
|
|
|
|
public CourseMuuntScene(dynamic rootNode)
|
|
|
|
|
{
|
|
|
|
|
root = rootNode;
|
2019-04-06 01:47:21 +02:00
|
|
|
|
|
|
|
|
|
LapPaths = new List<LapPathGroup>();
|
2019-04-06 21:13:55 +02:00
|
|
|
|
EnemyPaths = new List<EnemyPathGroup>();
|
2019-04-07 03:30:25 +02:00
|
|
|
|
GlidePaths = new List<GlidePathGroup>();
|
|
|
|
|
ItemPaths = new List<ItemPathGroup>();
|
|
|
|
|
SteerAssistPaths = new List<SteerAssistPathGroup>();
|
2019-04-08 03:14:39 +02:00
|
|
|
|
GravityPaths = new List<GravityPathGroup>();
|
|
|
|
|
PullPaths = new List<PullPathGroup>();
|
|
|
|
|
Paths = new List<PathGroup>();
|
|
|
|
|
ObjPaths = new List<ObjPathGroup>();
|
|
|
|
|
JugemPaths = new List<JugemPathGroup>();
|
|
|
|
|
IntroCameras = new List<IntroCamera>();
|
|
|
|
|
|
|
|
|
|
MapObjIdList = new List<int>();
|
|
|
|
|
MapObjResList = new List<string>();
|
2019-04-06 01:47:21 +02:00
|
|
|
|
|
|
|
|
|
if (root.ContainsKey("Area")) {
|
|
|
|
|
foreach (var area in root["Area"])
|
|
|
|
|
{ }
|
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("Clip")) {
|
|
|
|
|
foreach (var clip in root["Clip"])
|
|
|
|
|
{ }
|
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("ClipArea")) {
|
|
|
|
|
foreach (var clipArea in root["ClipArea"])
|
|
|
|
|
{ }
|
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("ClipPattern")) {
|
|
|
|
|
foreach (var clipPattern in root["ClipPattern"])
|
|
|
|
|
{ }
|
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("CurrentArea")) {
|
|
|
|
|
foreach (var currentArea in root["CurrentArea"])
|
|
|
|
|
{ }
|
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("EffectArea")) {
|
|
|
|
|
foreach (var effectArea in root["EffectArea"])
|
|
|
|
|
{ }
|
|
|
|
|
}
|
2019-04-07 03:30:25 +02:00
|
|
|
|
if (root.ContainsKey("ItemPath")) {
|
|
|
|
|
foreach (var itemPath in root["ItemPath"]) {
|
|
|
|
|
ItemPaths.Add(new ItemPathGroup(itemPath));
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-06 01:47:21 +02:00
|
|
|
|
if (root.ContainsKey("EnemyPath")) {
|
2019-04-06 21:13:55 +02:00
|
|
|
|
foreach (var enemyPath in root["EnemyPath"]) {
|
|
|
|
|
EnemyPaths.Add(new EnemyPathGroup(enemyPath));
|
|
|
|
|
}
|
2019-04-06 01:47:21 +02:00
|
|
|
|
}
|
2019-04-07 03:30:25 +02:00
|
|
|
|
if (root.ContainsKey("GlidePath")) {
|
|
|
|
|
foreach (var glidePath in root["GlidePath"]) {
|
|
|
|
|
GlidePaths.Add(new GlidePathGroup(glidePath));
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-06 01:47:21 +02:00
|
|
|
|
if (root.ContainsKey("GravityPath")) {
|
2019-04-08 03:14:39 +02:00
|
|
|
|
foreach (var gravityPath in root["GravityPath"]) {
|
|
|
|
|
GravityPaths.Add(new GravityPathGroup(gravityPath));
|
|
|
|
|
}
|
2019-04-06 01:47:21 +02:00
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("IntroCamera")) {
|
2019-04-08 03:14:39 +02:00
|
|
|
|
foreach (var introCamera in root["IntroCamera"]) {
|
|
|
|
|
IntroCameras.Add(new IntroCamera(introCamera));
|
|
|
|
|
}
|
2019-04-06 01:47:21 +02:00
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("JugemPath")) {
|
2019-04-08 03:14:39 +02:00
|
|
|
|
foreach (var jugemPath in root["JugemPath"]) {
|
|
|
|
|
JugemPaths.Add(new JugemPathGroup(jugemPath));
|
|
|
|
|
}
|
2019-04-06 01:47:21 +02:00
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("LapPath")) {
|
|
|
|
|
foreach (var lapPath in root["LapPath"]) {
|
|
|
|
|
LapPaths.Add(new LapPathGroup(lapPath));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("MapObjIdList")) {
|
2019-04-08 03:14:39 +02:00
|
|
|
|
foreach (var mapObjIdList in root["MapObjIdList"]) {
|
|
|
|
|
MapObjIdList.Add(mapObjIdList);
|
|
|
|
|
}
|
2019-04-06 01:47:21 +02:00
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("MapObjResList")) {
|
2019-04-08 03:14:39 +02:00
|
|
|
|
foreach (var mapObjResList in root["MapObjResList"]) {
|
|
|
|
|
MapObjResList.Add(mapObjResList);
|
|
|
|
|
}
|
2019-04-06 01:47:21 +02:00
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("Obj")) {
|
2019-04-08 03:14:39 +02:00
|
|
|
|
foreach (var objPath in root["Obj"]) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("ObjPath")) {
|
|
|
|
|
foreach (var objPath in root["ObjPath"]) {
|
|
|
|
|
// ObjPaths.Add(new ObjPathGroup(objPath));
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-13 01:32:38 +02:00
|
|
|
|
/* if (root.ContainsKey("PullPath")) {
|
2019-04-08 03:14:39 +02:00
|
|
|
|
foreach (var pullPath in root["PullPath"])
|
|
|
|
|
PullPaths.Add(new PullPathGroup(pullPath));
|
2019-04-06 01:47:21 +02:00
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("Path")) {
|
2019-04-08 03:14:39 +02:00
|
|
|
|
foreach (var path in root["Path"]) {
|
|
|
|
|
Paths.Add(new PathGroup(path));
|
|
|
|
|
}
|
2019-04-06 01:47:21 +02:00
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("ReplayCamera")) {
|
|
|
|
|
foreach (var replayCamera in root["ReplayCamera"])
|
|
|
|
|
{ }
|
|
|
|
|
}
|
|
|
|
|
if (root.ContainsKey("SoundObj")) {
|
|
|
|
|
foreach (var soundObj in root["SoundObj"])
|
|
|
|
|
{ }
|
|
|
|
|
}
|
2019-04-07 03:30:25 +02:00
|
|
|
|
if (root.ContainsKey("SteerAssistPath")) {
|
|
|
|
|
foreach (var steerAssistPath in root["SteerAssistPath"]) {
|
|
|
|
|
SteerAssistPaths.Add(new SteerAssistPathGroup(steerAssistPath));
|
|
|
|
|
}
|
2019-04-13 01:32:38 +02:00
|
|
|
|
}*/
|
2019-03-25 21:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-04 03:57:34 +02:00
|
|
|
|
|
2019-03-25 21:50:05 +01:00
|
|
|
|
public List<BFRES> BfresObjects = new List<BFRES>();
|
|
|
|
|
public List<KCL> KclObjects = new List<KCL>();
|
2019-04-10 01:43:24 +02:00
|
|
|
|
public List<AAMP> ParameterArchives = new List<AAMP>();
|
2019-03-25 21:50:05 +01:00
|
|
|
|
|
|
|
|
|
public void AddRenderableKcl(string FilePath)
|
|
|
|
|
{
|
2019-04-06 01:47:21 +02:00
|
|
|
|
if (!System.IO.File.Exists(FilePath))
|
|
|
|
|
return;
|
|
|
|
|
|
2019-07-16 23:35:21 +02:00
|
|
|
|
KCL kcl = (KCL)Toolbox.Library.IO.STFileLoader.OpenFileFormat(FilePath);
|
2019-04-08 23:01:31 +02:00
|
|
|
|
|
|
|
|
|
if (kcl != null)
|
|
|
|
|
KclObjects.Add(kcl);
|
2019-03-25 21:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddRenderableBfres(string FilePath)
|
|
|
|
|
{
|
2019-04-06 01:47:21 +02:00
|
|
|
|
if (!System.IO.File.Exists(FilePath))
|
|
|
|
|
return;
|
|
|
|
|
|
2019-07-16 23:35:21 +02:00
|
|
|
|
BFRES bfres = (BFRES)Toolbox.Library.IO.STFileLoader.OpenFileFormat(FilePath);
|
2019-04-08 23:01:31 +02:00
|
|
|
|
|
|
|
|
|
if (bfres != null)
|
|
|
|
|
BfresObjects.Add(bfres);
|
2019-03-25 21:50:05 +01:00
|
|
|
|
}
|
2019-04-10 01:43:24 +02:00
|
|
|
|
|
|
|
|
|
public void AddParameterArchive(string FilePath)
|
|
|
|
|
{
|
|
|
|
|
if (!System.IO.File.Exists(FilePath))
|
|
|
|
|
return;
|
|
|
|
|
|
2019-07-16 23:35:21 +02:00
|
|
|
|
AAMP aamp = (AAMP)Toolbox.Library.IO.STFileLoader.OpenFileFormat(FilePath);
|
2019-04-10 01:43:24 +02:00
|
|
|
|
|
|
|
|
|
if (aamp != null)
|
|
|
|
|
ParameterArchives.Add(aamp);
|
|
|
|
|
}
|
2019-03-25 21:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
}
|