Add proper hash matching for GFPAK
Also add latest turbo muunt editor files
This commit is contained in:
parent
717d9744e8
commit
f0c3fc5465
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
.vs/
|
||||
bin/
|
||||
obj/
|
||||
*Google.FlatBuffers
|
||||
*NodeEditorWinforms-master
|
||||
*GL_EditorFramework-master
|
||||
*SuperBMD-master
|
||||
|
@ -176,11 +176,16 @@ namespace FirstPlugin
|
||||
ulong FolderArrayOffset = reader.ReadUInt64();
|
||||
|
||||
reader.Seek((long)FolderArrayOffset, SeekOrigin.Begin);
|
||||
|
||||
List<HashIndex> FolderFiles = new List<HashIndex>();
|
||||
for (int i = 0; i < FolderCount; i++)
|
||||
{
|
||||
Folder folder = new Folder();
|
||||
folder.Read(reader);
|
||||
folders.Add(folder);
|
||||
|
||||
foreach (var hash in folder.hashes)
|
||||
FolderFiles.Add(hash);
|
||||
}
|
||||
|
||||
reader.Seek((long)hashArrayPathsOffset, SeekOrigin.Begin);
|
||||
@ -195,47 +200,121 @@ namespace FirstPlugin
|
||||
{
|
||||
FileEntry fileEntry = new FileEntry(this);
|
||||
fileEntry.Read(reader);
|
||||
fileEntry.FolderHash = FolderFiles[i];
|
||||
fileEntry.FileName = GetString(hashes[i], fileEntry.FileData);
|
||||
|
||||
string suffix = hashes[i].ToString("X").GetLast(6);
|
||||
ulong suffix64 = Convert.ToUInt64(suffix, 16);
|
||||
|
||||
if (HashList.ContainsKey(suffix64))
|
||||
{
|
||||
fileEntry.FileName = HashList[suffix64];
|
||||
}
|
||||
|
||||
string baseName = Path.GetFileName(fileEntry.FileName.Replace("\r", ""));
|
||||
|
||||
switch (Utils.GetExtension(fileEntry.FileName))
|
||||
{
|
||||
case ".gfbanm":
|
||||
fileEntry.FileName = $"Animations/{fileEntry.FileName}";
|
||||
fileEntry.FileName = $"Animations/{baseName}";
|
||||
break;
|
||||
case ".gfbanmcfg":
|
||||
fileEntry.FileName = $"AnimationConfigs/{fileEntry.FileName}";
|
||||
fileEntry.FileName = $"AnimationConfigs/{baseName}";
|
||||
break;
|
||||
case ".gfbmdl":
|
||||
fileEntry.FileName = $"Models/{fileEntry.FileName}";
|
||||
fileEntry.FileName = $"Models/{baseName}";
|
||||
break;
|
||||
case ".gfbpokecfg":
|
||||
fileEntry.FileName = $"PokeConfigs/{fileEntry.FileName}";
|
||||
fileEntry.FileName = $"PokeConfigs/{baseName}";
|
||||
break;
|
||||
case ".bntx":
|
||||
fileEntry.FileName = $"Textures/{fileEntry.FileName}";
|
||||
fileEntry.FileName = $"Textures/{baseName}";
|
||||
break;
|
||||
case ".bnsh":
|
||||
fileEntry.FileName = $"Shaders/{fileEntry.FileName}";
|
||||
fileEntry.FileName = $"Shaders/{baseName}";
|
||||
break;
|
||||
case ".ptcl":
|
||||
fileEntry.FileName = $"Effects/{fileEntry.FileName}";
|
||||
fileEntry.FileName = $"Effects/{baseName}";
|
||||
break;
|
||||
default:
|
||||
fileEntry.FileName = $"OtherFiles/{fileEntry.FileName}";
|
||||
fileEntry.FileName = $"OtherFiles/{baseName}";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Console.WriteLine($"{fileEntry.FileName} {fileEntry.FolderHash.hash.ToString("X")} {suffix64.ToString("X")}");
|
||||
|
||||
files.Add(fileEntry);
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<ulong, string> hashList;
|
||||
public Dictionary<ulong, string> HashList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (hashList == null) {
|
||||
hashList = new Dictionary<ulong, string>();
|
||||
GenerateHashList();
|
||||
}
|
||||
return hashList;
|
||||
}
|
||||
}
|
||||
|
||||
private void GenerateHashList()
|
||||
{
|
||||
foreach (string hashStr in Properties.Resources.Pkmn.Split('\n'))
|
||||
{
|
||||
string HashString = hashStr.TrimEnd();
|
||||
|
||||
ulong hash = FNV64A1.CalculateSuffix(HashString);
|
||||
if (!hashList.ContainsKey(hash))
|
||||
hashList.Add(hash, HashString);
|
||||
|
||||
if (HashString.Contains("pm0000"))
|
||||
GeneratePokeStrings(HashString);
|
||||
|
||||
string[] hashPaths = HashString.Split('/');
|
||||
for (int i = 0; i < hashPaths?.Length; i++)
|
||||
{
|
||||
hash = FNV64A1.CalculateSuffix(hashPaths[i]);
|
||||
if (!hashList.ContainsKey(hash))
|
||||
hashList.Add(hash, HashString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void GeneratePokeStrings(string hashStr)
|
||||
{
|
||||
//Also check file name just in case
|
||||
if (FileName.Contains("pm"))
|
||||
{
|
||||
string baseName = Path.GetFileNameWithoutExtension(FileName);
|
||||
string pokeStrFile = hashStr.Replace("pm0000_00", baseName);
|
||||
|
||||
ulong hash = FNV64A1.CalculateSuffix(pokeStrFile);
|
||||
if (!hashList.ContainsKey(hash))
|
||||
hashList.Add(hash, pokeStrFile);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
string pokeStr = hashStr.Replace("pm0000", $"pm{i.ToString("D4")}");
|
||||
|
||||
ulong hash = FNV64A1.CalculateSuffix(pokeStr);
|
||||
if (!hashList.ContainsKey(hash))
|
||||
hashList.Add(hash, pokeStr);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetString(ulong Hash, byte[] Data)
|
||||
{
|
||||
string ext = FindMatch(Data);
|
||||
if (ext == ".bntx" || ext == ".bfres" || ext == ".bnsh" || ext == ".bfsha")
|
||||
return GetBinaryHeaderName(Data) + ext;
|
||||
else
|
||||
return $"{Hash}{ext}";
|
||||
return $"{Hash.ToString("X")}{ext}";
|
||||
}
|
||||
|
||||
public void Write(FileWriter writer)
|
||||
@ -304,7 +383,7 @@ namespace FirstPlugin
|
||||
for (int f = 0; f < FileCount; f++)
|
||||
{
|
||||
HashIndex hash = new HashIndex();
|
||||
hash.Read(reader);
|
||||
hash.Read(reader, this);
|
||||
hashes.Add(hash);
|
||||
}
|
||||
}
|
||||
@ -325,8 +404,11 @@ namespace FirstPlugin
|
||||
public int Index;
|
||||
public uint unknown;
|
||||
|
||||
public void Read(FileReader reader)
|
||||
public Folder Parent { get; set; }
|
||||
|
||||
public void Read(FileReader reader, Folder parent)
|
||||
{
|
||||
Parent = parent;
|
||||
hash = reader.ReadUInt64();
|
||||
Index = reader.ReadInt32();
|
||||
unknown = reader.ReadUInt32(); //Always 0xCC?
|
||||
@ -340,6 +422,8 @@ namespace FirstPlugin
|
||||
}
|
||||
public class FileEntry : ArchiveFileInfo
|
||||
{
|
||||
public HashIndex FolderHash;
|
||||
|
||||
public uint unkown;
|
||||
public uint CompressionType;
|
||||
private long DataOffset;
|
||||
|
@ -8,6 +8,6 @@ namespace FirstPlugin.MuuntEditor
|
||||
{
|
||||
public interface I2DDrawableContainer
|
||||
{
|
||||
IDrawableObject Drawable { get; }
|
||||
List<IDrawableObject> Drawables { get; }
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,10 @@ namespace FirstPlugin.MuuntEditor
|
||||
private void RenderGroupChildren(PropertyObject propertyObject)
|
||||
{
|
||||
if (propertyObject is I2DDrawableContainer)
|
||||
((I2DDrawableContainer)propertyObject).Drawable?.Draw(Camera.ModelViewMatrix);
|
||||
{
|
||||
foreach (var drawable in ((I2DDrawableContainer)propertyObject).Drawables)
|
||||
drawable.Draw(Camera.ModelViewMatrix);
|
||||
}
|
||||
|
||||
foreach (var subProperty in propertyObject.SubObjects)
|
||||
RenderGroupChildren(subProperty);
|
||||
|
@ -28,15 +28,17 @@ namespace FirstPlugin.MuuntEditor
|
||||
}
|
||||
}
|
||||
|
||||
private IDrawableObject drawable;
|
||||
public IDrawableObject Drawable
|
||||
private List<IDrawableObject> drawables;
|
||||
public List<IDrawableObject> Drawables
|
||||
{
|
||||
get
|
||||
{
|
||||
if (drawable == null)
|
||||
drawable = new RenderableDoublePointPath(PathGroups, PathColor);
|
||||
|
||||
return drawable;
|
||||
if (drawables == null)
|
||||
{
|
||||
drawables = new List<IDrawableObject>();
|
||||
drawables.Add(new RenderableDoublePointPath(PathGroups, PathColor));
|
||||
}
|
||||
return drawables;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,15 +27,17 @@ namespace FirstPlugin.MuuntEditor
|
||||
}
|
||||
}
|
||||
|
||||
private IDrawableObject drawable;
|
||||
public IDrawableObject Drawable
|
||||
private List<IDrawableObject> drawables;
|
||||
public List<IDrawableObject> Drawables
|
||||
{
|
||||
get
|
||||
{
|
||||
if (drawable == null)
|
||||
drawable = new RenderablePath(PathGroups, PathColor);
|
||||
|
||||
return drawable;
|
||||
if (drawables == null)
|
||||
{
|
||||
drawables = new List<IDrawableObject>();
|
||||
drawables.Add(new RenderablePath(PathGroups, PathColor));
|
||||
}
|
||||
return drawables;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics.OpenGL;
|
||||
using FirstPlugin.Turbo.CourseMuuntStructs;
|
||||
using Toolbox.Library;
|
||||
using Toolbox.Library.IO;
|
||||
|
||||
namespace FirstPlugin.MuuntEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Represets a single point that draws a 2D circle and optionally a line (for rotation)
|
||||
/// </summary>
|
||||
public class RenderableSinglePointDrawable : IDrawableObject
|
||||
{
|
||||
public bool DrawSelectionRotationLine = true;
|
||||
|
||||
public List<BasePathGroup> PathGroups = new List<BasePathGroup>();
|
||||
|
||||
public Color LineColor = Color.Green;
|
||||
|
||||
public RenderableSinglePointDrawable(List<BasePathGroup> pathGroups, Color color)
|
||||
{
|
||||
PathGroups = pathGroups;
|
||||
LineColor = color;
|
||||
}
|
||||
|
||||
public void Draw(Matrix4 mvp)
|
||||
{
|
||||
GL.Disable(EnableCap.DepthTest);
|
||||
|
||||
for (int i = 0; i < PathGroups.Count; i++)
|
||||
{
|
||||
foreach (var path in PathGroups[i].PathPoints)
|
||||
{
|
||||
var translate = new Vector3(path.Translate.X, path.Translate.Z, path.Translate.Y);
|
||||
|
||||
if (path.IsSelected)
|
||||
{
|
||||
Render2D.DrawFilledCircle(translate, Color.LightGreen, 30, 40, true);
|
||||
|
||||
}
|
||||
else if (path.IsHovered)
|
||||
Render2D.DrawFilledCircle(translate, LineColor.Lighten(40), 40, 40, true);
|
||||
else
|
||||
Render2D.DrawFilledCircle(translate, LineColor.Darken(20), 30, 40, true);
|
||||
|
||||
GL.LineWidth(2f);
|
||||
|
||||
GL.Enable(EnableCap.DepthTest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Vector3 RotatePoint(Vector3 translate, float X, float Y, float Z, Vector3 rotate)
|
||||
{
|
||||
Matrix4 rotationX = Matrix4.CreateRotationX(rotate.X);
|
||||
Matrix4 rotationY = Matrix4.CreateRotationY(rotate.Z);
|
||||
Matrix4 rotationZ = Matrix4.CreateRotationZ(-rotate.Y);
|
||||
|
||||
Matrix4 transMat = Matrix4.CreateTranslation(new Vector3(translate.X, translate.Z, -translate.Y));
|
||||
Matrix4 comb = (rotationX * rotationY * rotationZ) * transMat;
|
||||
Vector3 pos = new Vector3(X, Y, Z);
|
||||
return Vector3.TransformPosition(pos, comb);
|
||||
}
|
||||
}
|
||||
}
|
@ -30,14 +30,14 @@ namespace FirstPlugin.MuuntEditor
|
||||
|
||||
var pathGroup = new ObjectGroup("Scene Objects");
|
||||
Groups.Add(pathGroup);
|
||||
PathDoublePointDrawableContainer lapPaths = new PathDoublePointDrawableContainer("Lap Paths", Color.Blue);
|
||||
PathDoublePointDrawableContainer lapPaths = new PathDoublePointDrawableContainer("Lap Paths", Color.Cyan);
|
||||
PathDrawableContainer enemyPaths = new PathDrawableContainer("Enemy Paths", Color.Red);
|
||||
PathDrawableContainer glidePaths = new PathDrawableContainer("Glide Paths", Color.Orange);
|
||||
PathDrawableContainer itemPaths = new PathDrawableContainer("Item Paths", Color.Green);
|
||||
PathDrawableContainer steerAssitPaths = new PathDrawableContainer("Steer Assist Paths", Color.Cyan);
|
||||
PathDrawableContainer steerAssitPaths = new PathDrawableContainer("Steer Assist Paths", Color.Crimson);
|
||||
PathDrawableContainer gravityPaths = new PathDrawableContainer("Gravity Paths", Color.Purple);
|
||||
PathDrawableContainer pullPaths = new PathDrawableContainer("Pull Paths", Color.DarkSlateGray);
|
||||
PathDrawableContainer paths = new PathDrawableContainer("Paths", Color.Black);
|
||||
PathDrawableContainer paths = new PathDrawableContainer("Paths", Color.GreenYellow);
|
||||
PathDrawableContainer objPaths = new PathDrawableContainer("Object Paths", Color.Brown);
|
||||
PathDrawableContainer jugemPaths = new PathDrawableContainer("Latiku Paths", Color.Pink);
|
||||
PathDrawableContainer introCameras = new PathDrawableContainer("Intro Camera", Color.Yellow);
|
||||
|
@ -40,7 +40,7 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
public bool IsSelected { get; set; }
|
||||
public bool IsHovered { get; set; }
|
||||
|
||||
public bool IsHit(float X, float Y)
|
||||
public virtual bool IsHit(float X, float Y)
|
||||
{
|
||||
return new STRectangle(Translate.X, Translate.Z, 40, 40).IsHit((int)X, (int)Y);
|
||||
|
||||
@ -76,6 +76,16 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
Translate = new Vector3(Translate.X - X, Translate.Y - Z, Translate.Z - Y);
|
||||
}
|
||||
|
||||
public void PickRotate(float X, float Y, float Z)
|
||||
{
|
||||
Rotate = new Vector3(Rotate.X - X, Rotate.Y - Z, Rotate.Z - Y);
|
||||
}
|
||||
|
||||
public void PickScale(float X, float Y, float Z)
|
||||
{
|
||||
Scale = new Vector3(Scale.X - X, Scale.Y - Z, Scale.Z - Y);
|
||||
}
|
||||
|
||||
public const string N_Translate = "Translate";
|
||||
public const string N_Rotate = "Rotate";
|
||||
public const string N_Scale = "Scale";
|
||||
|
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenTK;
|
||||
|
||||
namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
public class Matrix2DHelper
|
||||
{
|
||||
public static Vector3 RotatePoint(Vector3 translate, float X, float Y, float Z, Vector3 rotate)
|
||||
{
|
||||
Matrix4 rotationX = Matrix4.CreateRotationX(rotate.X);
|
||||
Matrix4 rotationY = Matrix4.CreateRotationY(rotate.Z);
|
||||
Matrix4 rotationZ = Matrix4.CreateRotationZ(-rotate.Y);
|
||||
|
||||
Matrix4 transMat = Matrix4.CreateTranslation(new Vector3(translate.X, translate.Z, -translate.Y));
|
||||
Matrix4 comb = (rotationX * rotationY * rotationZ) * transMat;
|
||||
Vector3 pos = new Vector3(X, Y, Z);
|
||||
return Vector3.TransformPosition(pos, comb);
|
||||
}
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GL_EditorFramework.EditorDrawables;
|
||||
using OpenTK;
|
||||
using Toolbox.Library;
|
||||
|
||||
namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
@ -74,6 +75,30 @@ namespace FirstPlugin.Turbo.CourseMuuntStructs
|
||||
{
|
||||
private RenderablePathPoint renderablePoint;
|
||||
|
||||
public override bool IsHit(float X, float Y)
|
||||
{
|
||||
//Here we need to detect 2 points and see if the space between is selected
|
||||
var point1 = Matrix2DHelper.RotatePoint(Translate, Scale.X / 2, 44, Scale.Y / 2, Rotate);
|
||||
var point2 = Matrix2DHelper.RotatePoint(Translate, -(Scale.X / 2), -44, -(Scale.Y / 2), Rotate);
|
||||
|
||||
|
||||
float LeftPoint = point2.X;
|
||||
float RightPoint = point1.X;
|
||||
float BottomPoint = point2.Y;
|
||||
float TopPoint = point1.Y;
|
||||
|
||||
bool isInBetweenX = (X > LeftPoint) && (X < RightPoint) ||
|
||||
(X < LeftPoint) && (X > RightPoint);
|
||||
|
||||
bool isInBetweenY = (Y > BottomPoint) && (Y < TopPoint) ||
|
||||
(Y < BottomPoint) && (Y > TopPoint);
|
||||
|
||||
if (isInBetweenX && isInBetweenY)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
public override RenderablePathPoint RenderablePoint
|
||||
{
|
||||
|
@ -34,139 +34,72 @@ namespace FirstPlugin.MuuntEditor
|
||||
{
|
||||
foreach (var path in PathGroups[i].PathPoints)
|
||||
{
|
||||
var translate = new Vector3(path.Translate.X, path.Translate.Z, path.Translate.Y);
|
||||
|
||||
//Draw a line repesenting the size of the path area
|
||||
var point1 = RotatePoint(translate, path.Scale.X / 2, path.Scale.Z / 2, path.Scale.Y / 2, path.Rotate);
|
||||
var point2 = RotatePoint(translate, -(path.Scale.X / 2), -(path.Scale.Z / 2), -(path.Scale.Y / 2), path.Rotate);
|
||||
//
|
||||
GL.PushMatrix();
|
||||
GL.Translate(translate);
|
||||
GL.Rotate(MathHelper.RadiansToDegrees(path.Rotate.X), 1, 0, 0);
|
||||
GL.Rotate(MathHelper.RadiansToDegrees(path.Rotate.Z), 0, 1, 0);
|
||||
GL.Rotate(MathHelper.RadiansToDegrees(path.Rotate.Y), 0, 0, 1);
|
||||
var point1 = Matrix2DHelper.RotatePoint(path.Translate, path.Scale.X / 2, path.Scale.Z / 2, path.Scale.Y / 2, path.Rotate);
|
||||
var point2 = Matrix2DHelper.RotatePoint(path.Translate, -(path.Scale.X / 2), -(path.Scale.Z / 2), -(path.Scale.Y / 2), path.Rotate);
|
||||
|
||||
Color pathColor = LineColor;
|
||||
if (path.IsSelected)
|
||||
pathColor = Color.LightGreen;
|
||||
else if (path.IsHovered)
|
||||
pathColor = LineColor.Lighten(70);
|
||||
|
||||
GL.Color3(LineColor);
|
||||
GL.LineWidth(3f);
|
||||
GL.Color3(pathColor);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(point1);
|
||||
GL.Vertex3(point2);
|
||||
GL.End();
|
||||
|
||||
GL.PopMatrix();
|
||||
|
||||
//Draw 2 points repesenting the edges of the path
|
||||
|
||||
GL.LineWidth(2f);
|
||||
|
||||
/* if (path.IsSelected)
|
||||
Render2D.DrawFilledCircle(translate, Color.LightGreen, 5, 40, true);
|
||||
else if (path.IsHovered)
|
||||
Render2D.DrawFilledCircle(translate, LineColor.Lighten(40), 6, 40, true);
|
||||
else
|
||||
Render2D.DrawFilledCircle(translate, LineColor.Darken(20), 5, 40, true);
|
||||
*/
|
||||
/* GL.LineWidth(2f);
|
||||
foreach (var nextPt in path.NextPoints)
|
||||
{
|
||||
var nextTranslate = PathGroups[nextPt.PathID].PathPoints[nextPt.PtID].Translate;
|
||||
foreach (var nextPt in path.NextPoints)
|
||||
{
|
||||
var nextPoint = PathGroups[nextPt.PathID].PathPoints[nextPt.PtID];
|
||||
|
||||
GL.Color3(LineColor);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(translate);
|
||||
GL.Vertex3(nextTranslate.X, nextTranslate.Z, nextTranslate.Y);
|
||||
GL.End();
|
||||
}
|
||||
foreach (var prevPt in path.PrevPoints)
|
||||
{
|
||||
var prevTranslate = PathGroups[prevPt.PathID].PathPoints[prevPt.PtID].Translate;
|
||||
var nextPoint1 = Matrix2DHelper.RotatePoint(nextPoint.Translate, (nextPoint.Scale.X / 2), nextPoint.Scale.Z / 2, -nextPoint.Scale.Y / 2, nextPoint.Rotate);
|
||||
var nextPoint2 = Matrix2DHelper.RotatePoint(nextPoint.Translate, -(nextPoint.Scale.X / 2), -(nextPoint.Scale.Z / 2), (nextPoint.Scale.Y / 2), nextPoint.Rotate);
|
||||
|
||||
GL.Color3(LineColor);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(translate);
|
||||
GL.Vertex3(prevTranslate.X, prevTranslate.Z, prevTranslate.Y);
|
||||
GL.End();
|
||||
}*/
|
||||
/* GL.Color3(Color.Green);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(point1);
|
||||
GL.Vertex3(nextPoint1);
|
||||
GL.End();
|
||||
|
||||
GL.Color3(Color.Green);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(point2);
|
||||
GL.Vertex3(nextPoint2);
|
||||
GL.End();*/
|
||||
}
|
||||
|
||||
foreach (var prevPt in path.PrevPoints)
|
||||
{
|
||||
var prevPoint = PathGroups[prevPt.PathID].PathPoints[prevPt.PtID];
|
||||
|
||||
var prevPoint1 = Matrix2DHelper.RotatePoint(prevPoint.Translate, (prevPoint.Scale.X / 2), prevPoint.Scale.Z / 2, prevPoint.Scale.Y / 2, prevPoint.Rotate);
|
||||
var prevPoint2 = Matrix2DHelper.RotatePoint(prevPoint.Translate, -(prevPoint.Scale.X / 2), -(prevPoint.Scale.Z / 2), -(prevPoint.Scale.Y / 2), prevPoint.Rotate);
|
||||
|
||||
GL.Color3(Color.Green);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(point1);
|
||||
GL.Vertex3(prevPoint1);
|
||||
GL.End();
|
||||
|
||||
GL.Color3(Color.Green);
|
||||
GL.Begin(PrimitiveType.Lines);
|
||||
GL.Vertex3(point2);
|
||||
GL.Vertex3(prevPoint2);
|
||||
GL.End();
|
||||
}
|
||||
|
||||
GL.LineWidth(1f);
|
||||
}
|
||||
}
|
||||
GL.Enable(EnableCap.DepthTest);
|
||||
}
|
||||
|
||||
private void DrawPathPoint(Vector3 center, Vector3 scale, Vector3 rotate, Color color, bool useWireFrame = false)
|
||||
{
|
||||
GL.Color3(color);
|
||||
|
||||
float sizeX = scale.X;
|
||||
float sizeY = scale.Y;
|
||||
float sizeZ = scale.Z;
|
||||
|
||||
|
||||
PrimitiveType primitiveType = PrimitiveType.Quads;
|
||||
if (useWireFrame)
|
||||
{
|
||||
GL.LineWidth(2);
|
||||
primitiveType = PrimitiveType.LineLoop;
|
||||
}
|
||||
|
||||
GL.Begin(primitiveType);
|
||||
GL.Normal3(0.0f, 1.0f, 0.0f);
|
||||
GL.Vertex3(center.X + sizeX, center.Y + sizeY, center.Z - sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y + sizeY, center.Z - sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y + sizeY, center.Z + sizeZ);
|
||||
GL.Vertex3(center.X + sizeX, center.Y + sizeY, center.Z + sizeZ);
|
||||
GL.End();
|
||||
|
||||
GL.Begin(primitiveType);
|
||||
GL.Normal3(0.0f, 0.0f, 1.0f);
|
||||
GL.Vertex3(center.X + sizeX, center.Y - sizeY, center.Z + sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y - sizeY, center.Z + sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y - sizeY, center.Z - sizeZ);
|
||||
GL.Vertex3(center.X + sizeX, center.Y - sizeY, center.Z - sizeZ);
|
||||
GL.End();
|
||||
|
||||
GL.Begin(primitiveType);
|
||||
GL.Normal3(1.0f, 0.0f, 0.0f);
|
||||
GL.Vertex3(center.X + sizeX, center.Y + sizeY, center.Z + sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y + sizeY, center.Z + sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y - sizeY, center.Z + sizeZ);
|
||||
GL.Vertex3(center.X + sizeX, center.Y - sizeY, center.Z + sizeZ);
|
||||
GL.End();
|
||||
|
||||
GL.Begin(primitiveType);
|
||||
GL.Normal3(-1.0f, 0.0f, 0.0f);
|
||||
GL.Vertex3(center.X + sizeX, center.Y - sizeY, center.Z - sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y - sizeY, center.Z - sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y + sizeY, center.Z - sizeZ);
|
||||
GL.Vertex3(center.X + sizeX, center.Y + sizeY, center.Z - sizeZ);
|
||||
GL.End();
|
||||
|
||||
GL.Begin(primitiveType);
|
||||
GL.Normal3(0.0f, -1.0f, 0.0f);
|
||||
GL.Vertex3(center.X - sizeX, center.Y + sizeY, center.Z + sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y + sizeY, center.Z - sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y - sizeY, center.Z - sizeZ);
|
||||
GL.Vertex3(center.X - sizeX, center.Y - sizeY, center.Z + sizeZ);
|
||||
GL.End();
|
||||
|
||||
GL.Begin(primitiveType);
|
||||
GL.Normal3(0.0f, 0.0f, -1.0f);
|
||||
GL.Vertex3(center.X + sizeX, center.Y + sizeY, center.Z - sizeZ);
|
||||
GL.Vertex3(center.X + sizeX, center.Y + sizeY, center.Z + sizeZ);
|
||||
GL.Vertex3(center.X + sizeX, center.Y - sizeY, center.Z + sizeZ);
|
||||
GL.Vertex3(center.X + sizeX, center.Y - sizeY, center.Z - sizeZ);
|
||||
GL.End();
|
||||
}
|
||||
|
||||
private Vector3 RotatePoint(Vector3 translate, float X, float Y, float Z, Vector3 rotate)
|
||||
{
|
||||
return new Vector3(X, Y, Z);
|
||||
|
||||
Matrix4 rotationZ = Matrix4.CreateRotationZ(rotate.Y);
|
||||
Matrix4 rotationY = Matrix4.CreateRotationY(rotate.Z);
|
||||
Matrix4 rotationX = Matrix4.CreateRotationX(rotate.X);
|
||||
|
||||
Matrix4 transMat = Matrix4.CreateTranslation(translate);
|
||||
Matrix4 comb = (rotationX * rotationY * rotationZ) * transMat;
|
||||
Vector3 pos = new Vector3(X, Y, Z);
|
||||
return Vector3.TransformPosition(pos, comb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,6 +60,9 @@ namespace FirstPlugin.Turbo
|
||||
Translate -= new Vector3(X,Z,Y);
|
||||
}
|
||||
|
||||
public void PickRotate(float X, float Y, float Z) { }
|
||||
public void PickScale(float X, float Y, float Z) { }
|
||||
|
||||
Course_MapCamera_bin.CameraData cameraData;
|
||||
|
||||
public CameraPoint(Course_MapCamera_bin.CameraData data, bool isTarget)
|
||||
|
159
File_Format_Library/GUI/ViewportEditor.Designer.cs
generated
Normal file
159
File_Format_Library/GUI/ViewportEditor.Designer.cs
generated
Normal file
@ -0,0 +1,159 @@
|
||||
namespace FirstPlugin.Forms
|
||||
{
|
||||
partial class ViewportEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.stPanel2 = new Toolbox.Library.Forms.STPanel();
|
||||
this.stToolStrip1 = new Toolbox.Library.Forms.STToolStrip();
|
||||
this.toggleViewportToolStripBtn = new System.Windows.Forms.ToolStripButton();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.stPanel3 = new Toolbox.Library.Forms.STPanel();
|
||||
this.splitter1 = new System.Windows.Forms.Splitter();
|
||||
this.timelineTabPage = new Toolbox.Library.Forms.STPanel();
|
||||
this.splitter2 = new System.Windows.Forms.Splitter();
|
||||
this.stPanel2.SuspendLayout();
|
||||
this.stToolStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.stPanel3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// stPanel2
|
||||
//
|
||||
this.stPanel2.Controls.Add(this.stToolStrip1);
|
||||
this.stPanel2.Controls.Add(this.splitContainer1);
|
||||
this.stPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stPanel2.Location = new System.Drawing.Point(0, 0);
|
||||
this.stPanel2.Name = "stPanel2";
|
||||
this.stPanel2.Size = new System.Drawing.Size(712, 543);
|
||||
this.stPanel2.TabIndex = 4;
|
||||
//
|
||||
// stToolStrip1
|
||||
//
|
||||
this.stToolStrip1.HighlightSelectedTab = false;
|
||||
this.stToolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toggleViewportToolStripBtn});
|
||||
this.stToolStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.stToolStrip1.Name = "stToolStrip1";
|
||||
this.stToolStrip1.Size = new System.Drawing.Size(712, 25);
|
||||
this.stToolStrip1.TabIndex = 2;
|
||||
this.stToolStrip1.Text = "stToolStrip1";
|
||||
//
|
||||
// toggleViewportToolStripBtn
|
||||
//
|
||||
this.toggleViewportToolStripBtn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.toggleViewportToolStripBtn.Image = global::FirstPlugin.Properties.Resources.ViewportIcon;
|
||||
this.toggleViewportToolStripBtn.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toggleViewportToolStripBtn.Name = "toggleViewportToolStripBtn";
|
||||
this.toggleViewportToolStripBtn.Size = new System.Drawing.Size(23, 22);
|
||||
this.toggleViewportToolStripBtn.Text = "toolStripButton1";
|
||||
this.toggleViewportToolStripBtn.Click += new System.EventHandler(this.toggleViewportToolStripBtn_Click);
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.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.splitContainer1.Location = new System.Drawing.Point(0, 28);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.splitter2);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.timelineTabPage);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.stPanel3);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(712, 515);
|
||||
this.splitContainer1.SplitterDistance = 440;
|
||||
this.splitContainer1.TabIndex = 1;
|
||||
//
|
||||
// stPanel3
|
||||
//
|
||||
this.stPanel3.Controls.Add(this.splitter1);
|
||||
this.stPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stPanel3.Location = new System.Drawing.Point(0, 0);
|
||||
this.stPanel3.Name = "stPanel3";
|
||||
this.stPanel3.Size = new System.Drawing.Size(440, 515);
|
||||
this.stPanel3.TabIndex = 4;
|
||||
//
|
||||
// splitter1
|
||||
//
|
||||
this.splitter1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.splitter1.Location = new System.Drawing.Point(0, 512);
|
||||
this.splitter1.Name = "splitter1";
|
||||
this.splitter1.Size = new System.Drawing.Size(440, 3);
|
||||
this.splitter1.TabIndex = 4;
|
||||
this.splitter1.TabStop = false;
|
||||
//
|
||||
// timelineTabPage
|
||||
//
|
||||
this.timelineTabPage.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.timelineTabPage.Location = new System.Drawing.Point(0, 380);
|
||||
this.timelineTabPage.Name = "timelineTabPage";
|
||||
this.timelineTabPage.Size = new System.Drawing.Size(440, 135);
|
||||
this.timelineTabPage.TabIndex = 5;
|
||||
//
|
||||
// splitter2
|
||||
//
|
||||
this.splitter2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.splitter2.Location = new System.Drawing.Point(0, 377);
|
||||
this.splitter2.Name = "splitter2";
|
||||
this.splitter2.Size = new System.Drawing.Size(440, 3);
|
||||
this.splitter2.TabIndex = 6;
|
||||
this.splitter2.TabStop = false;
|
||||
//
|
||||
// ViewportEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.stPanel2);
|
||||
this.Name = "ViewportEditor";
|
||||
this.Size = new System.Drawing.Size(712, 543);
|
||||
this.stPanel2.ResumeLayout(false);
|
||||
this.stPanel2.PerformLayout();
|
||||
this.stToolStrip1.ResumeLayout(false);
|
||||
this.stToolStrip1.PerformLayout();
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.stPanel3.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private Toolbox.Library.Forms.STPanel stPanel2;
|
||||
private Toolbox.Library.Forms.STPanel stPanel3;
|
||||
private System.Windows.Forms.Splitter splitter1;
|
||||
private Toolbox.Library.Forms.STToolStrip stToolStrip1;
|
||||
private System.Windows.Forms.ToolStripButton toggleViewportToolStripBtn;
|
||||
private System.Windows.Forms.Splitter splitter2;
|
||||
private Toolbox.Library.Forms.STPanel timelineTabPage;
|
||||
}
|
||||
}
|
208
File_Format_Library/GUI/ViewportEditor.cs
Normal file
208
File_Format_Library/GUI/ViewportEditor.cs
Normal file
@ -0,0 +1,208 @@
|
||||
using System;
|
||||
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.Windows.Forms;
|
||||
using Toolbox.Library.Forms;
|
||||
using Toolbox.Library;
|
||||
using GL_EditorFramework.Interfaces;
|
||||
using GL_EditorFramework.EditorDrawables;
|
||||
|
||||
namespace FirstPlugin.Forms
|
||||
{
|
||||
public partial class ViewportEditor : STUserControl, IViewportContainer
|
||||
{
|
||||
private bool _displayViewport = true;
|
||||
|
||||
public bool DisplayViewport
|
||||
{
|
||||
get
|
||||
{
|
||||
return _displayViewport;
|
||||
}
|
||||
set
|
||||
{
|
||||
_displayViewport = value;
|
||||
SetupViewport();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupViewport()
|
||||
{
|
||||
if (DisplayViewport == true && Runtime.UseOpenGL)
|
||||
{
|
||||
stPanel3.Controls.Add(viewport);
|
||||
splitContainer1.Panel1Collapsed = false;
|
||||
toggleViewportToolStripBtn.Image = Properties.Resources.ViewportIcon;
|
||||
|
||||
if (viewport != null)
|
||||
OnLoadedTab();
|
||||
else
|
||||
{
|
||||
viewport = new Viewport(ObjectEditor.GetDrawableContainers());
|
||||
viewport.Dock = DockStyle.Fill;
|
||||
OnLoadedTab();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stPanel3.Controls.Clear();
|
||||
splitContainer1.Panel1Collapsed = true;
|
||||
toggleViewportToolStripBtn.Image = Properties.Resources.ViewportIconDisable;
|
||||
}
|
||||
}
|
||||
|
||||
Viewport viewport
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Runtime.UseOpenGL || !DisplayViewport)
|
||||
return null;
|
||||
|
||||
var editor = LibraryGUI.GetObjectEditor();
|
||||
return editor.GetViewport();
|
||||
}
|
||||
set
|
||||
{
|
||||
var editor = LibraryGUI.GetObjectEditor();
|
||||
editor.LoadViewport(value);
|
||||
}
|
||||
}
|
||||
|
||||
AnimationPanel animationPanel;
|
||||
|
||||
public ViewportEditor(bool HasModels)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
animationPanel = new AnimationPanel();
|
||||
animationPanel.CurrentAnimation = null;
|
||||
animationPanel.Dock = DockStyle.Fill;
|
||||
timelineTabPage.Controls.Add(animationPanel);
|
||||
|
||||
//Always create an instance of the viewport unless opengl is disabled
|
||||
if (viewport == null && Runtime.UseOpenGL)
|
||||
{
|
||||
viewport = new Viewport(ObjectEditor.GetDrawableContainers());
|
||||
viewport.Dock = DockStyle.Fill;
|
||||
}
|
||||
|
||||
//If the option is enabled by settings, and it has models display the viewport
|
||||
if (Runtime.UseOpenGL && Runtime.DisplayViewport && HasModels)
|
||||
{
|
||||
stPanel3.Controls.Add(viewport);
|
||||
DisplayViewport = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayViewport = false;
|
||||
splitContainer1.Panel1Collapsed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public UserControl GetActiveEditor(Type type)
|
||||
{
|
||||
foreach (var ctrl in splitContainer1.Panel2.Controls)
|
||||
{
|
||||
if (type == null)
|
||||
{
|
||||
return (UserControl)ctrl;
|
||||
}
|
||||
|
||||
if (ctrl.GetType() == type)
|
||||
{
|
||||
return (UserControl)ctrl;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void LoadEditor(UserControl Control)
|
||||
{
|
||||
Control.Dock = DockStyle.Fill;
|
||||
|
||||
splitContainer1.Panel2.Controls.Clear();
|
||||
splitContainer1.Panel2.Controls.Add(Control);
|
||||
}
|
||||
|
||||
public AnimationPanel GetAnimationPanel() => animationPanel;
|
||||
|
||||
public Viewport GetViewport() => viewport;
|
||||
|
||||
public void UpdateViewport()
|
||||
{
|
||||
if (viewport != null && Runtime.UseOpenGL && Runtime.DisplayViewport)
|
||||
viewport.UpdateViewport();
|
||||
}
|
||||
|
||||
|
||||
public bool IsLoaded = false;
|
||||
|
||||
public void LoadViewport(DrawableContainer ActiveDrawable, List<ToolStripMenuItem> customContextMenus = null)
|
||||
{
|
||||
if (!Runtime.UseOpenGL || !DisplayViewport)
|
||||
return;
|
||||
|
||||
if (customContextMenus != null)
|
||||
{
|
||||
foreach (var menu in customContextMenus)
|
||||
viewport.LoadCustomMenuItem(menu);
|
||||
}
|
||||
|
||||
viewport.ReloadDrawables(ActiveDrawable);
|
||||
|
||||
OnLoadedTab();
|
||||
}
|
||||
|
||||
public override void OnControlClosing()
|
||||
{
|
||||
}
|
||||
|
||||
private void OnLoadedTab()
|
||||
{
|
||||
//If a model was loaded we don't need to load the drawables again
|
||||
if (IsLoaded ||!Runtime.UseOpenGL || !Runtime.DisplayViewport)
|
||||
return;
|
||||
|
||||
viewport.LoadObjects();
|
||||
|
||||
IsLoaded = true;
|
||||
}
|
||||
|
||||
private void stTabControl1_TabIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void stTabControl1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool IsTimelineVisable = true;
|
||||
int controlHeight = 0;
|
||||
private void stPanel1_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void toggleViewportToolStripBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Runtime.DisplayViewport)
|
||||
{
|
||||
Runtime.DisplayViewport = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Runtime.DisplayViewport = true;
|
||||
}
|
||||
|
||||
DisplayViewport = Runtime.DisplayViewport;
|
||||
Config.Save();
|
||||
}
|
||||
}
|
||||
}
|
123
File_Format_Library/GUI/ViewportEditor.resx
Normal file
123
File_Format_Library/GUI/ViewportEditor.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="stToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
92
File_Format_Library/Properties/Resources.Designer.cs
generated
92
File_Format_Library/Properties/Resources.Designer.cs
generated
@ -201,31 +201,64 @@ namespace FirstPlugin.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to D:\Project\NeoPlum\Out\Dist\NXROM\NeoPlumNX64_dist.nss
|
||||
///nnSdk.nss
|
||||
///c:/NXSDK/V7_3_2/NintendoSDK/Libraries/NX-NXFP2-a64/Release/multimedia.nss
|
||||
///__nnDetailNintendoSdkRuntimeObjectFile
|
||||
///__nnDetailNintendoSdkRuntimeObjectFileRefer
|
||||
///__nnmusl_fini_dso
|
||||
///__nnmusl_init_dso
|
||||
///__rel_dyn_end
|
||||
///__rel_dyn_start
|
||||
///__rel_plt_end
|
||||
///__rel_plt_start
|
||||
///nndetailRoGetRoDataEnd
|
||||
///nndetailRoGetRoDataStart
|
||||
///nnMain
|
||||
///nninitStartup
|
||||
///_ZdlPv
|
||||
///_ZNSt3__112__next_primeEm
|
||||
///strtoul
|
||||
///strtod
|
||||
///vsnprintf
|
||||
///vswprintf
|
||||
///_ZdaPv
|
||||
///_Znwm
|
||||
///_Znam
|
||||
///__cxa_guard_ac [rest of string was truncated]";.
|
||||
/// Looks up a localized string similar to 1
|
||||
///boo
|
||||
///fan
|
||||
///ice
|
||||
///ivy
|
||||
///lob
|
||||
///net
|
||||
///nub
|
||||
///sky
|
||||
///_vicenight/riotguard/thigh1
|
||||
///_vicenight/riotguard/thigh2
|
||||
///_vicenight/riotguard/thigh3
|
||||
///GenGlow
|
||||
///fx_divot_flash
|
||||
///_craterfield/podsspec
|
||||
///IDLE
|
||||
///Idle
|
||||
///Main
|
||||
///_tutorialfield/wall_base
|
||||
///Pass
|
||||
///_tutorialfield/wall_mask
|
||||
///_tutorialfield/wall_spec
|
||||
///arg1
|
||||
///arm1
|
||||
///ball
|
||||
///blue
|
||||
///boot
|
||||
///drum
|
||||
///dump
|
||||
///fins
|
||||
///fire
|
||||
///flag
|
||||
///glow
|
||||
///gold
|
||||
///hull
|
||||
///land
|
||||
///leg1
|
||||
///leg2
|
||||
///leg3
|
||||
///lid1
|
||||
///lid2
|
||||
///lid3
|
||||
///mast
|
||||
///palm
|
||||
///pole
|
||||
///pots
|
||||
///rock
|
||||
///roof
|
||||
///rope
|
||||
///sand
|
||||
///star
|
||||
///stop
|
||||
///toad
|
||||
///tree
|
||||
///whip
|
||||
///wood
|
||||
///proxy object05/claw1
|
||||
///proxy [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string LM3_Hashes {
|
||||
get {
|
||||
@ -273,6 +306,15 @@ namespace FirstPlugin.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to .
|
||||
/// </summary>
|
||||
internal static string Pkmn {
|
||||
get {
|
||||
return ResourceManager.GetString("Pkmn", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
@ -202,4 +202,7 @@
|
||||
<data name="LM3_Hashes" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Hashes\LM3_Hashes.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="Pkmn" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Hashes\Pkmn.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
</root>
|
62
File_Format_Library/Resources/Hashes/Pkmn.txt
Normal file
62
File_Format_Library/Resources/Hashes/Pkmn.txt
Normal file
@ -0,0 +1,62 @@
|
||||
bin/pokemon/pm0000_00/mdl/pm0000_00.gfbmdl
|
||||
bin/pokemon/pm0000_00/mdl/pm0000_00_rare.gfbmdl
|
||||
bin/pokemon/pm0000_00/pm0000_00.gfbpokecfg
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_field01.gfbanmcfg
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_field.gfbanmcfg
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_battle.gfbanmcfg
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_capture.gfbanmcfg
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_battle01.gfbanmcfg
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_capture01.gfbanmcfg
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_camp.gfbanmcfg
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_app01.gfbanmcfg
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba01_landA01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba01_landB01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba01_landC01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba02_roar01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba10_waitA01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba10_waitB01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba10_waitC01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba10_waitA02.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba10_waitB02.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba10_waitC02.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba20_buturi01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba20_buturi02.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba21_tokusyu01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba21_tokusyu02.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba30_damageS01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_ba41_down01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_fi20_walk01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_fi21_run01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_fi31_run_wait01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_fi31_wait_run01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_mouth01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_gloop01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_eye01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw10_respond01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw11_turnA01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw11_turnB01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw11_turnC01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw20_drowseA01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw20_drowseB01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw20_drowseC01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw21_sleepA01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw21_sleepB01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw21_sleepC01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw30_hate01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw30_hate02.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw31_question01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw32_happyA01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw32_happyB01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw32_happyC01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw33_moveA01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw33_moveB01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw33_moveC01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw34_lonely01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw35_playA01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw35_playB01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw35_playC01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw36_mad01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw50_eatA01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw50_eatB01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw50_eatC01.gfbanm
|
||||
bin/pokemon/pm0000_00/anm/pm0000_00_kw60_touch01.gfbanm
|
@ -602,7 +602,6 @@ namespace Toolbox.Library.Animations
|
||||
b.rot = EulerToQuat(z, y, x);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (AdancedNextFrame)
|
||||
|
@ -140,6 +140,7 @@ namespace Toolbox.Library.Forms
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Dock = DockStyle.Fill;
|
||||
|
||||
findReplaceDialog = new FindReplace();
|
||||
findReplaceDialog.Scintilla = scintilla1;
|
||||
|
52
Switch_Toolbox_Library/HashCalculate/FNV64A1.cs
Normal file
52
Switch_Toolbox_Library/HashCalculate/FNV64A1.cs
Normal file
@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Toolbox.Library
|
||||
{
|
||||
public class FNV64A1
|
||||
{
|
||||
public static ulong Calculate(string text) {
|
||||
return Calculate(Encoding.Default.GetBytes(text));
|
||||
}
|
||||
|
||||
public static ulong CalculateSuffix(string text) {
|
||||
return CalculateSuffix(Encoding.Default.GetBytes(text));
|
||||
}
|
||||
|
||||
public static ulong CalculateSuffix(byte[] bytes)
|
||||
{
|
||||
const ulong fnv64Basis = 0x222645;
|
||||
const ulong fnv64Prime = 0x0001b3;
|
||||
const ulong mask = 0xffffff;
|
||||
|
||||
ulong hash = fnv64Basis & mask;
|
||||
for (var i = 0; i < bytes.Length; i++)
|
||||
{
|
||||
hash = hash ^ bytes[i];
|
||||
hash *= fnv64Prime;
|
||||
hash = hash & mask;
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
//https://gist.github.com/rasmuskl/3786618
|
||||
public static ulong Calculate(byte[] bytes)
|
||||
{
|
||||
const ulong fnv64Offset = 14695981039346656037;
|
||||
const ulong fnv64Prime = 0x100000001b3;
|
||||
ulong hash = fnv64Offset;
|
||||
|
||||
for (var i = 0; i < bytes.Length; i++)
|
||||
{
|
||||
hash = hash ^ bytes[i];
|
||||
hash *= fnv64Prime;
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
@ -26,6 +26,13 @@ namespace System
|
||||
return normalizedPath.StartsWith(normalizedBaseDirPath, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public static string GetLast(this string source, int tail_length)
|
||||
{
|
||||
if (tail_length >= source.Length)
|
||||
return source;
|
||||
return source.Substring(source.Length - tail_length);
|
||||
}
|
||||
|
||||
public static string RemoveNumbersAtEnd(this string str)
|
||||
{
|
||||
Regex rgx = new Regex(@"\d+$");
|
||||
|
13
Switch_Toolbox_Library/Interfaces/IAnimationContainer.cs
Normal file
13
Switch_Toolbox_Library/Interfaces/IAnimationContainer.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Toolbox.Library.Animations
|
||||
{
|
||||
public interface IAnimationContainer
|
||||
{
|
||||
STAnimation AnimationController { get; }
|
||||
}
|
||||
}
|
@ -12,5 +12,7 @@ namespace Toolbox.Library
|
||||
bool IsSelected { get; set; }
|
||||
bool IsHovered { get; set; }
|
||||
void PickTranslate(float X, float Y, float Z);
|
||||
void PickRotate(float X, float Y, float Z);
|
||||
void PickScale(float X, float Y, float Z);
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,8 @@ namespace Toolbox.Library.Forms
|
||||
glControl1.MouseDown += glControl1_MouseDown;
|
||||
glControl1.MouseUp += glControl1_MouseUp;
|
||||
glControl1.MouseMove += glControl1_MouseMove;
|
||||
glControl1.KeyDown += glControl1_KeyDown;
|
||||
|
||||
glControl1.Paint += glControl1_Paint;
|
||||
glControl1.Resize += glControl1_Resize;
|
||||
Controls.Add(glControl1);
|
||||
@ -354,6 +356,30 @@ namespace Toolbox.Library.Forms
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pickAction == PickAction.Rotate)
|
||||
{
|
||||
foreach (var pickObject in SelectedObjects)
|
||||
{
|
||||
if (pickOriginMouse != Point.Empty)
|
||||
{
|
||||
float rotX = 0;
|
||||
float rotY = 0;
|
||||
float rotZ = 0;
|
||||
|
||||
if (pickAxis == PickAxis.X)
|
||||
rotX = pickMouse.X * -0.015625f;
|
||||
if (pickAxis == PickAxis.Y)
|
||||
rotY = pickMouse.Y;
|
||||
if (pickAxis == PickAxis.All)
|
||||
{
|
||||
rotX = pickMouse.X * -0.015625f;
|
||||
// rotY = pickMouse.Y;
|
||||
}
|
||||
|
||||
pickObject.PickRotate(rotX, rotY, rotZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pickOriginMouse = temp;
|
||||
|
||||
@ -370,6 +396,20 @@ namespace Toolbox.Library.Forms
|
||||
DrawSelectionBox(prevPos, curPos);
|
||||
}
|
||||
}
|
||||
|
||||
private void glControl1_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.R)
|
||||
{
|
||||
if (isPicked)
|
||||
pickAction = PickAction.Rotate;
|
||||
}
|
||||
if (e.KeyCode == Keys.G)
|
||||
{
|
||||
if (isPicked)
|
||||
pickAction = PickAction.Translate;
|
||||
}
|
||||
}
|
||||
|
||||
private void glControl1_Resize(object sender, EventArgs e)
|
||||
{
|
||||
@ -396,5 +436,17 @@ namespace Toolbox.Library.Forms
|
||||
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// Viewport2D
|
||||
//
|
||||
this.Name = "Viewport2D";
|
||||
this.Size = new System.Drawing.Size(405, 404);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
120
Switch_Toolbox_Library/OpenGL/Viewport2D.resx
Normal file
120
Switch_Toolbox_Library/OpenGL/Viewport2D.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -367,6 +367,7 @@
|
||||
<Compile Include="FileSystem\ExplorerFolder.cs" />
|
||||
<Compile Include="Generics\Texture\ImageParameters.cs" />
|
||||
<Compile Include="Generics\Texture\STTextureFolder.cs" />
|
||||
<Compile Include="HashCalculate\FNV64A1.cs" />
|
||||
<Compile Include="Helpers\ArchiveNodeMenuHelper.cs" />
|
||||
<Compile Include="Helpers\DirectoryHelper.cs" />
|
||||
<Compile Include="Helpers\DragHelper.cs" />
|
||||
@ -376,6 +377,7 @@
|
||||
<Compile Include="Interfaces\FileFormatting\IPropertyContainer.cs" />
|
||||
<Compile Include="Interfaces\FileFormatting\ISaveOpenedFileStream.cs" />
|
||||
<Compile Include="Interfaces\Forms\IEditorForm.cs" />
|
||||
<Compile Include="Interfaces\IAnimationContainer.cs" />
|
||||
<Compile Include="Interfaces\IMainForm.cs" />
|
||||
<Compile Include="Interfaces\IMdiContainer.cs" />
|
||||
<Compile Include="Interfaces\Textures\ITextureIconLoader.cs" />
|
||||
@ -1158,6 +1160,9 @@
|
||||
<EmbeddedResource Include="Forms\Custom\ListViewCustom.resx">
|
||||
<DependentUpon>ListViewCustom.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="OpenGL\Viewport2D.resx">
|
||||
<DependentUpon>Viewport2D.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
11
Toolbox/GUI/HashCalculatorForm.Designer.cs
generated
11
Toolbox/GUI/HashCalculatorForm.Designer.cs
generated
@ -80,16 +80,16 @@
|
||||
this.stringTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.stringTB.Location = new System.Drawing.Point(88, 74);
|
||||
this.stringTB.Name = "stringTB";
|
||||
this.stringTB.Size = new System.Drawing.Size(121, 20);
|
||||
this.stringTB.Size = new System.Drawing.Size(282, 20);
|
||||
this.stringTB.TabIndex = 11;
|
||||
this.stringTB.TextChanged += new System.EventHandler(this.stTextBox1_TextChanged);
|
||||
//
|
||||
// resultTB
|
||||
//
|
||||
this.resultTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.resultTB.Location = new System.Drawing.Point(299, 74);
|
||||
this.resultTB.Location = new System.Drawing.Point(453, 74);
|
||||
this.resultTB.Name = "resultTB";
|
||||
this.resultTB.Size = new System.Drawing.Size(160, 20);
|
||||
this.resultTB.Size = new System.Drawing.Size(199, 20);
|
||||
this.resultTB.TabIndex = 12;
|
||||
//
|
||||
// hashTypeCB
|
||||
@ -103,6 +103,7 @@
|
||||
this.hashTypeCB.Name = "hashTypeCB";
|
||||
this.hashTypeCB.Size = new System.Drawing.Size(121, 21);
|
||||
this.hashTypeCB.TabIndex = 13;
|
||||
this.hashTypeCB.SelectedIndexChanged += new System.EventHandler(this.hashTypeCB_SelectedIndexChanged);
|
||||
//
|
||||
// stLabel1
|
||||
//
|
||||
@ -125,7 +126,7 @@
|
||||
// stLabel3
|
||||
//
|
||||
this.stLabel3.AutoSize = true;
|
||||
this.stLabel3.Location = new System.Drawing.Point(225, 76);
|
||||
this.stLabel3.Location = new System.Drawing.Point(379, 76);
|
||||
this.stLabel3.Name = "stLabel3";
|
||||
this.stLabel3.Size = new System.Drawing.Size(68, 13);
|
||||
this.stLabel3.TabIndex = 16;
|
||||
@ -134,7 +135,7 @@
|
||||
// chkUseHex
|
||||
//
|
||||
this.chkUseHex.AutoSize = true;
|
||||
this.chkUseHex.Location = new System.Drawing.Point(299, 45);
|
||||
this.chkUseHex.Location = new System.Drawing.Point(453, 45);
|
||||
this.chkUseHex.Name = "chkUseHex";
|
||||
this.chkUseHex.Size = new System.Drawing.Size(86, 17);
|
||||
this.chkUseHex.TabIndex = 17;
|
||||
|
@ -21,6 +21,9 @@ namespace Toolbox
|
||||
InitializeComponent();
|
||||
|
||||
hashTypeCB.Items.Add("NLG_Hash");
|
||||
hashTypeCB.Items.Add("FNV64A1");
|
||||
hashTypeCB.Items.Add("CRC32");
|
||||
|
||||
hashTypeCB.SelectedIndex = 0;
|
||||
|
||||
maxLengthUD.Value = 3;
|
||||
@ -32,10 +35,7 @@ namespace Toolbox
|
||||
|
||||
private void UpdateHash()
|
||||
{
|
||||
uint Hash = 0;
|
||||
if (hashTypeCB.GetSelectedText() == "NLG_Hash")
|
||||
Hash = StringToHash(stringTB.Text);
|
||||
|
||||
ulong Hash = CalculateHash(hashTypeCB.GetSelectedText(), stringTB.Text);
|
||||
if (IsHex)
|
||||
resultTB.Text = Hash.ToString("X");
|
||||
else
|
||||
@ -46,6 +46,17 @@ namespace Toolbox
|
||||
UpdateHash();
|
||||
}
|
||||
|
||||
public static ulong CalculateHash(string type, string text)
|
||||
{
|
||||
if (type == "NLG_Hash")
|
||||
return StringToHash(text);
|
||||
else if (type == "FNV64A1")
|
||||
return FNV64A1.CalculateSuffix(text);
|
||||
else if (type == "CRC32")
|
||||
return Toolbox.Library.Security.Cryptography.Crc32.Compute(text);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static uint StringToHash(string name, bool caseSensative = false)
|
||||
{
|
||||
//From (Works as tested comparing hashbin strings/hashes
|
||||
@ -91,14 +102,16 @@ namespace Toolbox
|
||||
progressBar.Show();
|
||||
progressBar.Task = $"Searching characters";
|
||||
|
||||
string hashType = hashTypeCB.GetSelectedText();
|
||||
|
||||
Thread Thread = new Thread((ThreadStart)(() =>
|
||||
{
|
||||
BruteForceHashes(progressBar);
|
||||
BruteForceHashes(progressBar, hashType);
|
||||
}));
|
||||
Thread.Start();
|
||||
}
|
||||
|
||||
private void BruteForceHashes(STProgressBar progressBar)
|
||||
private void BruteForceHashes(STProgressBar progressBar, string hashType)
|
||||
{
|
||||
if (bruteForceHashTB.Text.Length == 0)
|
||||
return;
|
||||
@ -107,11 +120,11 @@ namespace Toolbox
|
||||
|
||||
CancelOperation = false;
|
||||
|
||||
List<uint> hashes = new List<uint>();
|
||||
List<ulong> hashes = new List<ulong>();
|
||||
foreach (var line in bruteForceHashTB.Lines)
|
||||
{
|
||||
uint hash = 0;
|
||||
uint.TryParse(line, out hash);
|
||||
ulong hash = 0;
|
||||
ulong.TryParse(line, out hash);
|
||||
if (hash == 0) continue;
|
||||
|
||||
hashes.Add(hash);
|
||||
@ -137,7 +150,7 @@ namespace Toolbox
|
||||
{
|
||||
String value = Sb.ToString();
|
||||
|
||||
uint calculatedHash = StringToHash($"{characterStartTB.Text}{value}");
|
||||
ulong calculatedHash = CalculateHash(hashType, $"{characterStartTB.Text}{value}");
|
||||
if (hashes.Contains(calculatedHash))
|
||||
{
|
||||
UpdateTextbox($"{characterStartTB.Text}{value}");
|
||||
@ -157,7 +170,7 @@ namespace Toolbox
|
||||
|
||||
foreach (var line in characterStartTB.Lines)
|
||||
{
|
||||
uint calculatedHash2 = StringToHash($"{line}{value}");
|
||||
ulong calculatedHash2 = CalculateHash(hashType, $"{line}{value}");
|
||||
if (hashes.Contains(calculatedHash2))
|
||||
{
|
||||
UpdateTextbox($"{line}{value}");
|
||||
@ -283,5 +296,9 @@ namespace Toolbox
|
||||
{
|
||||
CancelOperation = true;
|
||||
}
|
||||
|
||||
private void hashTypeCB_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
UpdateHash();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user