1
0
mirror of synced 2024-11-13 18:50:50 +01:00

Add more paths

This commit is contained in:
KillzXGaming 2019-04-06 21:30:25 -04:00
parent a0b28dc7ae
commit dd4f352082
16 changed files with 369 additions and 5 deletions

Binary file not shown.

View File

@ -160,6 +160,11 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
public List<LapPathGroup> LapPaths;
public List<EnemyPathGroup> EnemyPaths;
public List<ItemPathGroup> ItemPaths;
public List<GlidePathGroup> GlidePaths;
public List<SteerAssistPathGroup> SteerAssistPaths;
public CourseMuuntScene(dynamic rootNode)
{
@ -167,6 +172,9 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
LapPaths = new List<LapPathGroup>();
EnemyPaths = new List<EnemyPathGroup>();
GlidePaths = new List<GlidePathGroup>();
ItemPaths = new List<ItemPathGroup>();
SteerAssistPaths = new List<SteerAssistPathGroup>();
if (root.ContainsKey("Area")) {
foreach (var area in root["Area"])
@ -192,11 +200,21 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
foreach (var effectArea in root["EffectArea"])
{ }
}
if (root.ContainsKey("ItemPath")) {
foreach (var itemPath in root["ItemPath"]) {
ItemPaths.Add(new ItemPathGroup(itemPath));
}
}
if (root.ContainsKey("EnemyPath")) {
foreach (var enemyPath in root["EnemyPath"]) {
EnemyPaths.Add(new EnemyPathGroup(enemyPath));
}
}
if (root.ContainsKey("GlidePath")) {
foreach (var glidePath in root["GlidePath"]) {
GlidePaths.Add(new GlidePathGroup(glidePath));
}
}
if (root.ContainsKey("GravityPath")) {
foreach (var gravityPath in root["GravityPath"])
{ }
@ -238,6 +256,11 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
foreach (var soundObj in root["SoundObj"])
{ }
}
if (root.ContainsKey("SteerAssistPath")) {
foreach (var steerAssistPath in root["SteerAssistPath"]) {
SteerAssistPaths.Add(new SteerAssistPathGroup(steerAssistPath));
}
}
}

View File

@ -0,0 +1,119 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using GL_EditorFramework.EditorDrawables;
using GL_EditorFramework.GL_Core;
using GL_EditorFramework.Interfaces;
using OpenTK.Graphics.OpenGL;
using OpenTK;
using System.Drawing;
using Switch_Toolbox.Library;
namespace FirstPlugin.Turbo.CourseMuuntStructs
{
public class GlidePathGroup : PathGroup, IObject
{
public const string N_GlidePathGroup = "GlidePathGroup";
public const string N_UnitIdNum = "UnitIdNum";
public GlidePathGroup(dynamic bymlNode)
{
if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode;
else throw new Exception("Not a dictionary");
foreach (var point in this["PathPt"])
{
PathPoints.Add(new EnemyPathPoint(point));
}
ConnectGroups = false;
}
[Browsable(false)]
public Dictionary<string, dynamic> Prop { get; set; } = new Dictionary<string, dynamic>();
public int GlidePathGroupId
{
get { return this[N_GlidePathGroup]; }
set { this[N_GlidePathGroup] = value; }
}
public int UnitIdNum
{
get { return this[N_UnitIdNum]; }
set { this[N_UnitIdNum] = value; }
}
public dynamic this[string name]
{
get
{
if (Prop.ContainsKey(name)) return Prop[name];
else return null;
}
set
{
if (Prop.ContainsKey(name)) Prop[name] = value;
else Prop.Add(name, value);
}
}
}
public class GlidePathPoint : PathPoint
{
[Browsable(false)]
public override RenderablePathPoint RenderablePoint
{
get
{
var point = new RenderablePathPoint(ColorUtility.ToVector4(Color.FromArgb(252, 93, 11)), Translate, Rotate, new OpenTK.Vector3(30), this);
point.CanConnect = true;
return point;
}
}
[Category("Properties")]
public int GlideType
{
get { return this["GlideType"]; }
set { this["GlideType"] = value; }
}
[Category("Properties")]
public bool IsUp
{
get { return this["IsUp"]; }
set { this["IsUp"] = value; }
}
[Category("Properties")]
public int Ascend
{
get { return this["Ascend"]; }
set { this["Ascend"] = value; }
}
[Category("Properties")]
public bool Cannon
{
get { return this["Cannon"]; }
set { this["Cannon"] = value; }
}
public GlidePathPoint(dynamic bymlNode)
{
if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode;
else throw new Exception("Not a dictionary");
foreach (var point in this["NextPt"])
{
NextPoints.Add(new PointID(point));
}
foreach (var point in this["PrevPt"])
{
PrevPoints.Add(new PointID(point));
}
}
}
}

View File

@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using GL_EditorFramework.EditorDrawables;
using GL_EditorFramework.GL_Core;
using GL_EditorFramework.Interfaces;
using OpenTK.Graphics.OpenGL;
using OpenTK;
using System.Drawing;
namespace FirstPlugin.Turbo.CourseMuuntStructs
{
public class ItemPathGroup : PathGroup, IObject
{
public const string N_EnemyPathGroup = "ItemPathGroup";
public const string N_UnitIdNum = "UnitIdNum";
public ItemPathGroup(dynamic bymlNode)
{
if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode;
else throw new Exception("Not a dictionary");
foreach (var point in this["PathPt"])
{
PathPoints.Add(new EnemyPathPoint(point));
}
}
[Browsable(false)]
public Dictionary<string, dynamic> Prop { get; set; } = new Dictionary<string, dynamic>();
public int EnemyPathGroupId
{
get { return this[N_EnemyPathGroup]; }
set { this[N_EnemyPathGroup] = value; }
}
public int UnitIdNum
{
get { return this[N_UnitIdNum]; }
set { this[N_UnitIdNum] = value; }
}
public dynamic this[string name]
{
get
{
if (Prop.ContainsKey(name)) return Prop[name];
else return null;
}
set
{
if (Prop.ContainsKey(name)) Prop[name] = value;
else Prop.Add(name, value);
}
}
}
public class ItemPathPoint : PathPoint
{
[Browsable(false)]
public override RenderablePathPoint RenderablePoint
{
get
{
var point = new RenderablePathPoint(new Vector4(1f, 0f, 0f, 1f), Translate, Rotate, new OpenTK.Vector3(30), this);
point.CanConnect = true;
return point;
}
}
[Category("Properties")]
public int Hover
{
get { return this["Hover"]; }
set { this["Hover"] = value; }
}
[Category("Properties")]
public int ItemPriority
{
get { return this["ItemPriority"]; }
set { this["ItemPriority"] = value; }
}
[Category("Properties")]
public int SearchArea
{
get { return this["SearchArea"]; }
set { this["SearchArea"] = value; }
}
public ItemPathPoint(dynamic bymlNode)
{
if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode;
else throw new Exception("Not a dictionary");
foreach (var point in this["NextPt"])
{
NextPoints.Add(new PointID(point));
}
foreach (var point in this["PrevPt"])
{
PrevPoints.Add(new PointID(point));
}
}
}
}

View File

@ -70,7 +70,6 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
public class LapPathPoint : PathPoint
{
[Browsable(false)]
public override RenderablePathPoint RenderablePoint
{

View File

@ -4,6 +4,8 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
{
public class PathGroup
{
public bool ConnectGroups = true;
public List<PathPoint> PathPoints = new List<PathPoint>();
}
}

View File

@ -5,6 +5,7 @@ using GL_EditorFramework.Interfaces;
using OpenTK.Graphics.OpenGL;
using OpenTK;
using System.Drawing;
using Switch_Toolbox.Library;
namespace FirstPlugin.Turbo.CourseMuuntStructs
{
@ -40,9 +41,11 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
public override void Prepare(GL_ControlModern control)
{
var defaultFrag = new FragmentShader(
@"#version 330
@"#version 330
vec4 LineColor;
void main(){
gl_FragColor = vec4(0,1,0,1);
gl_FragColor = LineColor;
}");
var defaultVert = new VertexShader(
@ -92,6 +95,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
public override void Draw(GL_ControlModern control, Pass pass)
{
control.CurrentShader = defaultShaderProgram;
defaultShaderProgram.SetVector4("LineColor", ColorUtility.ToVector4(LineColor));
foreach (var group in PathGroups)
{

View File

@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using GL_EditorFramework.EditorDrawables;
using GL_EditorFramework.GL_Core;
using GL_EditorFramework.Interfaces;
using OpenTK.Graphics.OpenGL;
using OpenTK;
using System.Drawing;
namespace FirstPlugin.Turbo.CourseMuuntStructs
{
public class SteerAssistPathGroup : PathGroup, IObject
{
public const string N_SteerAssistPathGroup = "SteerAssistPathGroup";
public const string N_UnitIdNum = "UnitIdNum";
public SteerAssistPathGroup(dynamic bymlNode)
{
if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode;
else throw new Exception("Not a dictionary");
foreach (var point in this["PathPt"])
{
PathPoints.Add(new EnemyPathPoint(point));
}
}
[Browsable(false)]
public Dictionary<string, dynamic> Prop { get; set; } = new Dictionary<string, dynamic>();
public int SteerAssistPathGroupId
{
get { return this[N_SteerAssistPathGroup]; }
set { this[N_SteerAssistPathGroup] = value; }
}
public int UnitIdNum
{
get { return this[N_UnitIdNum]; }
set { this[N_UnitIdNum] = value; }
}
public dynamic this[string name]
{
get
{
if (Prop.ContainsKey(name)) return Prop[name];
else return null;
}
set
{
if (Prop.ContainsKey(name)) Prop[name] = value;
else Prop.Add(name, value);
}
}
}
public class SteerAssistPathPoint : PathPoint
{
[Browsable(false)]
public override RenderablePathPoint RenderablePoint
{
get
{
var point = new RenderablePathPoint(new Vector4(0f, 1f, 0f, 1f), Translate, Rotate, new OpenTK.Vector3(30), this);
point.CanConnect = true;
return point;
}
}
[Category("Properties")]
public int Priority
{
get { return this["Priority"]; }
set { this["Priority"] = value; }
}
public SteerAssistPathPoint(dynamic bymlNode)
{
if (bymlNode is Dictionary<string, dynamic>) Prop = (Dictionary<string, dynamic>)bymlNode;
else throw new Exception("Not a dictionary");
foreach (var point in this["NextPt"])
{
NextPoints.Add(new PointID(point));
}
foreach (var point in this["PrevPt"])
{
PrevPoints.Add(new PointID(point));
}
}
}
}

View File

@ -75,9 +75,19 @@ namespace FirstPlugin.Forms
if (scene.EnemyPaths.Count > 0) {
AddPathDrawable("Enemy Path", scene.EnemyPaths, Color.Red);
}
if (scene.EnemyPaths.Count > 0) {
if (scene.LapPaths.Count > 0) {
AddPathDrawable("Lap Path", scene.LapPaths,Color.Blue, false);
}
if (scene.GlidePaths.Count > 0) {
AddPathDrawable("Glide Path", scene.GlidePaths, Color.Orange);
}
if (scene.ItemPaths.Count > 0) {
AddPathDrawable("Item Path", scene.ItemPaths, Color.Yellow);
}
if (scene.SteerAssistPaths.Count > 0) {
AddPathDrawable("Steer Assist Path", scene.SteerAssistPaths, Color.Green);
}
IsLoaded = true;
}

View File

@ -330,13 +330,16 @@
</Compile>
<Compile Include="GUI\Byaml\CourseMuunt\CourseMuuntStructs.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\IObject.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Paths\ItemPaths.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Paths\EnemyPaths.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Paths\GliderPaths.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Paths\LapPaths.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\Base\PathPoint.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\Paths\SteerAssistPath.cs" />
<Compile Include="GUI\Byaml\CourseMuunt\TurboMunntEditor.cs">
<SubType>UserControl</SubType>
</Compile>

View File

@ -1 +1 @@
16568860ef0401f7dec5cb2a9e482b7e36fd023f
886ac18f42578b4e9040873174f8c65faeae1a88