From 59cd8575b1cce2e479fcbb9bb26b7e485ac00189 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 8 Apr 2023 22:34:44 +0200 Subject: [PATCH 01/80] Fix wrong spelling of 'Extentions' to 'Extensions' and Add blending to 'ImageExtension' --- PCK-Studio/Classes/Extensions/BlendMode.cs | 12 ++ .../EnumerableExtensions.cs} | 4 +- .../ImageExtensions.cs} | 120 +++++++++++++++--- PCK-Studio/Forms/Editor/Animation.cs | 4 +- PCK-Studio/Forms/Editor/AnimationEditor.cs | 8 +- .../Forms/Utilities/AnimationResources.cs | 5 +- .../Forms/Utilities/BehaviourResources.cs | 4 +- .../Forms/Utilities/MaterialResources.cs | 2 +- PCK-Studio/Forms/Utilities/ModelsResources.cs | 2 +- PCK-Studio/Forms/Utilities/pckCenterOpen.cs | 4 +- PCK-Studio/PckStudio.csproj | 5 +- 11 files changed, 133 insertions(+), 37 deletions(-) create mode 100644 PCK-Studio/Classes/Extensions/BlendMode.cs rename PCK-Studio/Classes/{Extentions/EnumerableExtentions.cs => Extensions/EnumerableExtensions.cs} (79%) rename PCK-Studio/Classes/{Extentions/ImageExtentions.cs => Extensions/ImageExtensions.cs} (50%) diff --git a/PCK-Studio/Classes/Extensions/BlendMode.cs b/PCK-Studio/Classes/Extensions/BlendMode.cs new file mode 100644 index 00000000..96cfc36e --- /dev/null +++ b/PCK-Studio/Classes/Extensions/BlendMode.cs @@ -0,0 +1,12 @@ +namespace PckStudio.Extensions +{ + public enum BlendMode + { + Add, + Subtract, + Multiply, + Average, + DescendingOrder, + AscendingOrder + } +} \ No newline at end of file diff --git a/PCK-Studio/Classes/Extentions/EnumerableExtentions.cs b/PCK-Studio/Classes/Extensions/EnumerableExtensions.cs similarity index 79% rename from PCK-Studio/Classes/Extentions/EnumerableExtentions.cs rename to PCK-Studio/Classes/Extensions/EnumerableExtensions.cs index cda71bba..ed95e29f 100644 --- a/PCK-Studio/Classes/Extentions/EnumerableExtentions.cs +++ b/PCK-Studio/Classes/Extensions/EnumerableExtensions.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -namespace PckStudio.Classes.Extentions +namespace PckStudio.Extensions { - internal static class EnumerableExtentions + internal static class EnumerableExtensions { public static IEnumerable<(int index, T type)>enumerate(this IEnumerable array) { diff --git a/PCK-Studio/Classes/Extentions/ImageExtentions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs similarity index 50% rename from PCK-Studio/Classes/Extentions/ImageExtentions.cs rename to PCK-Studio/Classes/Extensions/ImageExtensions.cs index 6743d1de..6313801d 100644 --- a/PCK-Studio/Classes/Extentions/ImageExtentions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -4,11 +4,14 @@ using System.Drawing; using System.Diagnostics; using System; using System.Drawing.Imaging; +using System.Runtime.InteropServices; +using System.Windows.Media.Media3D; +using System.Web; -namespace PckStudio.Classes.Extentions +namespace PckStudio.Extensions { - internal static class ImageExtentions - { + internal static class ImageExtensions + { public enum ImageLayoutDirection { Horizontal, @@ -31,15 +34,15 @@ namespace PckStudio.Classes.Extentions } } - private static Image GetTileImage(Image source, Rectangle area, Size size, GraphicsUnit unit = GraphicsUnit.Pixel) + public static Image GetArea(this Image source, Rectangle area, GraphicsUnit unit = GraphicsUnit.Pixel) { - Image tileImage = new Bitmap(size.Width, size.Height); + Image tileImage = new Bitmap(area.Width, area.Height); using (Graphics gfx = Graphics.FromImage(tileImage)) { gfx.SmoothingMode = SmoothingMode.None; gfx.InterpolationMode = InterpolationMode.NearestNeighbor; gfx.PixelOffsetMode = PixelOffsetMode.HighQuality; - gfx.DrawImage(source, new Rectangle(Point.Empty, size), area, unit); + gfx.DrawImage(source, new Rectangle(Point.Empty, area.Size), area, unit); } return tileImage; } @@ -54,7 +57,7 @@ namespace PckStudio.Classes.Extentions int row = i / img_row_count; int column = i % img_row_count; Rectangle tileArea = new Rectangle(new Point(column * size.Height, row * size.Width), size); - yield return GetTileImage(source, tileArea, size); + yield return source.GetArea(tileArea); } yield break; } @@ -70,7 +73,7 @@ namespace PckStudio.Classes.Extentions { ImageLayoutInfo locationInfo = new ImageLayoutInfo(source.Width, source.Height, i, layoutDirection); Rectangle tileArea = new Rectangle(locationInfo.SectionPoint, locationInfo.SectionSize); - yield return GetTileImage(source, tileArea, locationInfo.SectionSize); + yield return source.GetArea(tileArea); } yield break; } @@ -112,8 +115,18 @@ namespace PckStudio.Classes.Extentions public CompositingMode CompositingMode { get; set; } public CompositingQuality CompositingQuality { get; set; } public InterpolationMode InterpolationMode { get; set; } - public SmoothingMode SmoothingMode {get; set; } + public SmoothingMode SmoothingMode { get; set; } public PixelOffsetMode PixelOffsetMode { get; set; } + + public void Apply(Graphics graphics) + { + graphics.CompositingMode = CompositingMode; + graphics.CompositingQuality = CompositingQuality; + graphics.InterpolationMode = InterpolationMode; + graphics.SmoothingMode = SmoothingMode; + graphics.PixelOffsetMode = PixelOffsetMode; + } + } public static Image ResizeImage(this Image image, int width, int height, GraphicsConfig graphicsConfig) @@ -125,12 +138,7 @@ namespace PckStudio.Classes.Extentions using (var graphics = Graphics.FromImage(destImage)) { - graphics.CompositingMode = graphicsConfig.CompositingMode; - graphics.CompositingQuality = graphicsConfig.CompositingQuality; - graphics.InterpolationMode = graphicsConfig.InterpolationMode; - graphics.SmoothingMode = graphicsConfig.SmoothingMode; - graphics.PixelOffsetMode = graphicsConfig.PixelOffsetMode; - + graphicsConfig.Apply(graphics); using (var wrapMode = new ImageAttributes()) { wrapMode.SetWrapMode(WrapMode.TileFlipXY); @@ -139,5 +147,87 @@ namespace PckStudio.Classes.Extentions } return destImage; } + + public static Image Fill(this Image image, Color color) + { + using (var g = Graphics.FromImage(image)) + { + using (SolidBrush brush = new SolidBrush(color)) + { + g.FillRectangle(brush, new Rectangle(Point.Empty, image.Size)); + } + } + return image; + } + + public static Image Blend(this Image bg, Color foregroundColor, BlendMode mode) + { + Bitmap bitmap = new Bitmap(bg); + bitmap.Fill(foregroundColor); + return bg.Blend(bitmap, mode); + } + + public static Image Blend(this Image image, Image overlay, BlendMode mode) + { + Stopwatch stopwatch = Stopwatch.StartNew(); + if (image is not Bitmap baseImage || overlay is not Bitmap overlayImage) + return image; + BitmapData baseImageData = baseImage.LockBits(new Rectangle(Point.Empty, baseImage.Size), + ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); + byte[] baseImageBuffer = new byte[baseImageData.Stride * baseImageData.Height]; + + Marshal.Copy(baseImageData.Scan0, baseImageBuffer, 0, baseImageBuffer.Length); + + BitmapData overlayImageData = overlayImage.LockBits(new Rectangle(Point.Empty, overlayImage.Size), + ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); + byte[] overlayImageBuffer = new byte[overlayImageData.Stride * overlayImageData.Height]; + + Marshal.Copy(overlayImageData.Scan0, overlayImageBuffer, 0, overlayImageBuffer.Length); + + for (int k = 0; k < baseImageBuffer.Length && k < overlayImageBuffer.Length; k += 4) + { + baseImageBuffer[k + 0] = CalculateColorComponentBlendValue(baseImageBuffer[k + 0] / 255f, overlayImageBuffer[k + 0] / 255f, mode); + baseImageBuffer[k + 1] = CalculateColorComponentBlendValue(baseImageBuffer[k + 1] / 255f, overlayImageBuffer[k + 1] / 255f, mode); + baseImageBuffer[k + 2] = CalculateColorComponentBlendValue(baseImageBuffer[k + 2] / 255f, overlayImageBuffer[k + 2] / 255f, mode); + } + + Bitmap bitmapResult = new Bitmap(baseImage.Width, baseImage.Height, PixelFormat.Format32bppArgb); + BitmapData resultImageData = bitmapResult.LockBits(new Rectangle(Point.Empty, bitmapResult.Size), + ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); + + Marshal.Copy(baseImageBuffer, 0, resultImageData.Scan0, baseImageBuffer.Length); + + bitmapResult.UnlockBits(resultImageData); + baseImage.UnlockBits(baseImageData); + overlayImage.UnlockBits(overlayImageData); + stopwatch.Stop(); + Debug.WriteLine($"{nameof(ImageExtensions.Blend)} took {stopwatch.ElapsedMilliseconds}ms"); + return bitmapResult; + } + + private static T Clamp(T value, T min, T max) where T : IComparable + { + if (value.CompareTo(min) < 0) return min; + else if (value.CompareTo(max) > 0) return max; + else return value; + } + + private static byte CalculateColorComponentBlendValue(float source, float overlay, BlendMode blendType) + { + source = Clamp(source, 0.0f, 1.0f); + overlay = Clamp(overlay, 0.0f, 1.0f); + + float resultValue = blendType switch + { + BlendMode.Add => source + overlay, + BlendMode.Subtract => source - overlay, + BlendMode.Multiply => source * overlay, + BlendMode.Average => (source + overlay) / 2.0f, + BlendMode.AscendingOrder => source > overlay ? overlay : source, + BlendMode.DescendingOrder => source < overlay ? overlay : source, + _ => 0.0f + }; + return (byte)Clamp(resultValue * 255, 0, 255); + } } } diff --git a/PCK-Studio/Forms/Editor/Animation.cs b/PCK-Studio/Forms/Editor/Animation.cs index ad8a1ccd..7aa20194 100644 --- a/PCK-Studio/Forms/Editor/Animation.cs +++ b/PCK-Studio/Forms/Editor/Animation.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Drawing; -using PckStudio.Classes.Extentions; +using PckStudio.Extensions; using System.Text; @@ -140,7 +140,7 @@ namespace PckStudio.Forms.Editor var textures = isClockOrCompass ? linearImages : frameTextures; - return ImageExtentions.ImageFromImageArray(textures.ToArray(), ImageExtentions.ImageLayoutDirection.Vertical); + return ImageExtensions.ImageFromImageArray(textures.ToArray(), ImageExtensions.ImageLayoutDirection.Vertical); } } } diff --git a/PCK-Studio/Forms/Editor/AnimationEditor.cs b/PCK-Studio/Forms/Editor/AnimationEditor.cs index 7f921db2..7ddcdc7e 100644 --- a/PCK-Studio/Forms/Editor/AnimationEditor.cs +++ b/PCK-Studio/Forms/Editor/AnimationEditor.cs @@ -3,15 +3,13 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Drawing; -using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Windows.Forms; -using PckStudio.Classes.FileTypes; using PckStudio.Forms.Additional_Popups.Animation; using PckStudio.Forms.Utilities; -using PckStudio.Classes.Extentions; +using PckStudio.Extensions; using OMI.Formats.Pck; namespace PckStudio.Forms.Editor @@ -51,7 +49,7 @@ namespace PckStudio.Forms.Editor using MemoryStream textureMem = new MemoryStream(animationFile.Data); var texture = new Bitmap(textureMem); - var frameTextures = texture.CreateImageList(ImageExtentions.ImageLayoutDirection.Horizontal); + var frameTextures = texture.CreateImageList(ImageExtensions.ImageLayoutDirection.Horizontal); currentAnimation = animationFile.Properties.HasProperty("ANIM") ? new Animation(frameTextures, animationFile.Properties.GetPropertyValue("ANIM")) @@ -296,7 +294,7 @@ namespace PckStudio.Forms.Editor return; } using MemoryStream textureMem = new MemoryStream(File.ReadAllBytes(textureFile)); - var textures = Image.FromStream(textureMem).CreateImageList(ImageExtentions.ImageLayoutDirection.Horizontal); + var textures = Image.FromStream(textureMem).CreateImageList(ImageExtensions.ImageLayoutDirection.Horizontal); var new_animation = new Animation(textures); try { diff --git a/PCK-Studio/Forms/Utilities/AnimationResources.cs b/PCK-Studio/Forms/Utilities/AnimationResources.cs index 4d8c1f4a..237d153a 100644 --- a/PCK-Studio/Forms/Utilities/AnimationResources.cs +++ b/PCK-Studio/Forms/Utilities/AnimationResources.cs @@ -1,12 +1,9 @@ using Newtonsoft.Json.Linq; using System.Drawing; using System.Linq; -using System.IO; using PckStudio.Properties; -using System.Drawing.Imaging; -using PckStudio.Classes.Extentions; -using OMI.Formats.Pck; +using PckStudio.Extensions; namespace PckStudio.Forms.Utilities { diff --git a/PCK-Studio/Forms/Utilities/BehaviourResources.cs b/PCK-Studio/Forms/Utilities/BehaviourResources.cs index 763c4e71..8eed8e50 100644 --- a/PCK-Studio/Forms/Utilities/BehaviourResources.cs +++ b/PCK-Studio/Forms/Utilities/BehaviourResources.cs @@ -4,11 +4,9 @@ using System.Linq; using System.IO; using PckStudio.Properties; -using PckStudio.Classes.Extentions; +using PckStudio.Extensions; using OMI.Formats.Behaviour; using OMI.Workers.Behaviour; -using OMI.Formats.Pck; -using System; namespace PckStudio.Forms.Utilities { diff --git a/PCK-Studio/Forms/Utilities/MaterialResources.cs b/PCK-Studio/Forms/Utilities/MaterialResources.cs index 7d27eda1..94cd2e4a 100644 --- a/PCK-Studio/Forms/Utilities/MaterialResources.cs +++ b/PCK-Studio/Forms/Utilities/MaterialResources.cs @@ -4,7 +4,7 @@ using System.Linq; using System.IO; using PckStudio.Properties; -using PckStudio.Classes.Extentions; +using PckStudio.Extensions; using OMI.Formats.Pck; using OMI.Formats.Material; using OMI.Workers.Material; diff --git a/PCK-Studio/Forms/Utilities/ModelsResources.cs b/PCK-Studio/Forms/Utilities/ModelsResources.cs index cdf91454..f61e6ee1 100644 --- a/PCK-Studio/Forms/Utilities/ModelsResources.cs +++ b/PCK-Studio/Forms/Utilities/ModelsResources.cs @@ -4,7 +4,7 @@ using System.Linq; using System.IO; using PckStudio.Properties; -using PckStudio.Classes.Extentions; +using PckStudio.Extensions; using OMI.Formats.Model; using OMI.Formats.Pck; using OMI.Workers.Model; diff --git a/PCK-Studio/Forms/Utilities/pckCenterOpen.cs b/PCK-Studio/Forms/Utilities/pckCenterOpen.cs index c16ab9a7..b1ba4635 100644 --- a/PCK-Studio/Forms/Utilities/pckCenterOpen.cs +++ b/PCK-Studio/Forms/Utilities/pckCenterOpen.cs @@ -19,7 +19,7 @@ using PckStudio.Classes.FileTypes; using PckStudio.Classes.IO.PCK; using OMI.Formats.Pck; using OMI.Workers.Pck; -using PckStudio.Classes.Extentions; +using PckStudio.Extensions; namespace PckStudio.Forms { @@ -1027,7 +1027,7 @@ namespace PckStudio.Forms { var ms = new MemoryStream(skinTexture.Data); Bitmap saveSkin = new Bitmap(Image.FromStream(ms)); - var config = new ImageExtentions.GraphicsConfig() + var config = new ImageExtensions.GraphicsConfig() { CompositingMode = CompositingMode.SourceCopy, CompositingQuality = CompositingQuality.HighQuality, diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 0433db82..96fbce83 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -170,7 +170,8 @@ - + + @@ -185,7 +186,7 @@ - + From 0e12fd5a8ed081185be0ecf94d4940a46ef4f66b Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sun, 9 Apr 2023 18:34:23 +0200 Subject: [PATCH 02/80] Add GraphicsExtensions and move GraphicsConfig --- .../Classes/Extensions/GraphicsExtensions.cs | 38 +++++++++++++++++++ .../Classes/Extensions/ImageExtensions.cs | 32 ++-------------- PCK-Studio/Forms/Utilities/pckCenterOpen.cs | 2 +- PCK-Studio/PckStudio.csproj | 1 + 4 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 PCK-Studio/Classes/Extensions/GraphicsExtensions.cs diff --git a/PCK-Studio/Classes/Extensions/GraphicsExtensions.cs b/PCK-Studio/Classes/Extensions/GraphicsExtensions.cs new file mode 100644 index 00000000..b29842da --- /dev/null +++ b/PCK-Studio/Classes/Extensions/GraphicsExtensions.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Linq; +using System.Text; + +namespace PckStudio.Extensions +{ + public struct GraphicsConfig + { + public GraphicsConfig() + { + CompositingQuality = CompositingQuality.Default; + InterpolationMode = InterpolationMode.Default; + SmoothingMode = SmoothingMode.Default; + PixelOffsetMode = PixelOffsetMode.Default; + } + + public CompositingMode CompositingMode { get; set; } + public CompositingQuality CompositingQuality { get; set; } + public InterpolationMode InterpolationMode { get; set; } + public SmoothingMode SmoothingMode { get; set; } + public PixelOffsetMode PixelOffsetMode { get; set; } + } + + internal static class GraphicsExtensions + { + public static void ApplyConfig(this Graphics graphics, GraphicsConfig config) + { + graphics.CompositingMode = config.CompositingMode; + graphics.CompositingQuality = config.CompositingQuality; + graphics.InterpolationMode = config.InterpolationMode; + graphics.SmoothingMode = config.SmoothingMode; + graphics.PixelOffsetMode = config.PixelOffsetMode; + } + } +} diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index 6313801d..180ff5dc 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -1,12 +1,10 @@ -using System.Collections.Generic; -using System.Drawing.Drawing2D; +using System; using System.Drawing; using System.Diagnostics; -using System; using System.Drawing.Imaging; +using System.Drawing.Drawing2D; +using System.Collections.Generic; using System.Runtime.InteropServices; -using System.Windows.Media.Media3D; -using System.Web; namespace PckStudio.Extensions { @@ -110,25 +108,6 @@ namespace PckStudio.Extensions return new Size(width, heigh); } - public struct GraphicsConfig - { - public CompositingMode CompositingMode { get; set; } - public CompositingQuality CompositingQuality { get; set; } - public InterpolationMode InterpolationMode { get; set; } - public SmoothingMode SmoothingMode { get; set; } - public PixelOffsetMode PixelOffsetMode { get; set; } - - public void Apply(Graphics graphics) - { - graphics.CompositingMode = CompositingMode; - graphics.CompositingQuality = CompositingQuality; - graphics.InterpolationMode = InterpolationMode; - graphics.SmoothingMode = SmoothingMode; - graphics.PixelOffsetMode = PixelOffsetMode; - } - - } - public static Image ResizeImage(this Image image, int width, int height, GraphicsConfig graphicsConfig) { var destRect = new Rectangle(0, 0, width, height); @@ -138,7 +117,7 @@ namespace PckStudio.Extensions using (var graphics = Graphics.FromImage(destImage)) { - graphicsConfig.Apply(graphics); + graphics.ApplyConfig(graphicsConfig); using (var wrapMode = new ImageAttributes()) { wrapMode.SetWrapMode(WrapMode.TileFlipXY); @@ -169,7 +148,6 @@ namespace PckStudio.Extensions public static Image Blend(this Image image, Image overlay, BlendMode mode) { - Stopwatch stopwatch = Stopwatch.StartNew(); if (image is not Bitmap baseImage || overlay is not Bitmap overlayImage) return image; BitmapData baseImageData = baseImage.LockBits(new Rectangle(Point.Empty, baseImage.Size), @@ -200,8 +178,6 @@ namespace PckStudio.Extensions bitmapResult.UnlockBits(resultImageData); baseImage.UnlockBits(baseImageData); overlayImage.UnlockBits(overlayImageData); - stopwatch.Stop(); - Debug.WriteLine($"{nameof(ImageExtensions.Blend)} took {stopwatch.ElapsedMilliseconds}ms"); return bitmapResult; } diff --git a/PCK-Studio/Forms/Utilities/pckCenterOpen.cs b/PCK-Studio/Forms/Utilities/pckCenterOpen.cs index b1ba4635..7a978f68 100644 --- a/PCK-Studio/Forms/Utilities/pckCenterOpen.cs +++ b/PCK-Studio/Forms/Utilities/pckCenterOpen.cs @@ -1027,7 +1027,7 @@ namespace PckStudio.Forms { var ms = new MemoryStream(skinTexture.Data); Bitmap saveSkin = new Bitmap(Image.FromStream(ms)); - var config = new ImageExtensions.GraphicsConfig() + var config = new GraphicsConfig() { CompositingMode = CompositingMode.SourceCopy, CompositingQuality = CompositingQuality.HighQuality, diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 96fbce83..ae28ad89 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -172,6 +172,7 @@ + From 9d3104fe9606ba0abd80b914ed690e6c5a5da4c4 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:20:12 +0200 Subject: [PATCH 03/80] Added 'BlendMode.Screen' --- PCK-Studio/Classes/Extensions/BlendMode.cs | 3 ++- PCK-Studio/Classes/Extensions/ImageExtensions.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/PCK-Studio/Classes/Extensions/BlendMode.cs b/PCK-Studio/Classes/Extensions/BlendMode.cs index 96cfc36e..7fb02709 100644 --- a/PCK-Studio/Classes/Extensions/BlendMode.cs +++ b/PCK-Studio/Classes/Extensions/BlendMode.cs @@ -7,6 +7,7 @@ Multiply, Average, DescendingOrder, - AscendingOrder + AscendingOrder, + Screen } } \ No newline at end of file diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index 180ff5dc..ee800247 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -201,6 +201,7 @@ namespace PckStudio.Extensions BlendMode.Average => (source + overlay) / 2.0f, BlendMode.AscendingOrder => source > overlay ? overlay : source, BlendMode.DescendingOrder => source < overlay ? overlay : source, + BlendMode.Screen => 1f - (1f - source)*(1f - overlay), _ => 0.0f }; return (byte)Clamp(resultValue * 255, 0, 255); From 7ec2a70ee004d127e2439ee0904e61cad16d9fe1 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:23:59 +0200 Subject: [PATCH 04/80] ImageExtensions - Remove GraphicsUnit argument from 'GetArea' --- PCK-Studio/Classes/Extensions/ImageExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index ee800247..9f1e109b 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -32,7 +32,7 @@ namespace PckStudio.Extensions } } - public static Image GetArea(this Image source, Rectangle area, GraphicsUnit unit = GraphicsUnit.Pixel) + public static Image GetArea(this Image source, Rectangle area) { Image tileImage = new Bitmap(area.Width, area.Height); using (Graphics gfx = Graphics.FromImage(tileImage)) @@ -40,7 +40,7 @@ namespace PckStudio.Extensions gfx.SmoothingMode = SmoothingMode.None; gfx.InterpolationMode = InterpolationMode.NearestNeighbor; gfx.PixelOffsetMode = PixelOffsetMode.HighQuality; - gfx.DrawImage(source, new Rectangle(Point.Empty, area.Size), area, unit); + gfx.DrawImage(source, new Rectangle(Point.Empty, area.Size), area, GraphicsUnit.Pixel); } return tileImage; } From 499ed6f292099a60bd58f508484ecd0c89440ef4 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:25:13 +0200 Subject: [PATCH 05/80] ImageExtensions - 'CalculateImageSize' now checks for all images to be the same size --- PCK-Studio/Classes/Extensions/ImageExtensions.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index 9f1e109b..b691b80c 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -5,6 +5,7 @@ using System.Drawing.Imaging; using System.Drawing.Drawing2D; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Linq; namespace PckStudio.Extensions { @@ -96,16 +97,17 @@ namespace PckStudio.Extensions { var horizontal = layoutDirection == ImageLayoutDirection.Horizontal; - // TODO: Validate all source images to be the same size. int width = sources[0].Width; - int heigh = sources[0].Height; + int height = sources[0].Height; + if (!sources.All(img => img.Width.Equals(width) && img.Height.Equals(height))) + throw new InvalidOperationException("Images must have the same width and height."); if (horizontal) width *= sources.Length; else - heigh *= sources.Length; + height *= sources.Length; - return new Size(width, heigh); + return new Size(width, height); } public static Image ResizeImage(this Image image, int width, int height, GraphicsConfig graphicsConfig) From 4cd8c64ea3ceeea5a1d9311a690e492e0853a244 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sun, 9 Apr 2023 19:27:43 +0200 Subject: [PATCH 06/80] ImageExtensions- Add 'ImageLayoutInfo.SectionArea' --- PCK-Studio/Classes/Extensions/ImageExtensions.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index b691b80c..e1c954a8 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -22,14 +22,16 @@ namespace PckStudio.Extensions /// /// Size of sub section of the image /// - public Size SectionSize; - public Point SectionPoint; + public readonly Size SectionSize; + public readonly Point SectionPoint; + public readonly Rectangle SectionArea; public ImageLayoutInfo(int width, int height, int index, ImageLayoutDirection layoutDirection) { bool horizontal = layoutDirection == ImageLayoutDirection.Horizontal; SectionSize = horizontal ? new Size(width, width) : new Size(height, height); SectionPoint = horizontal ? new Point(0, index * width) : new Point(index * height, 0); + SectionArea = new Rectangle(SectionPoint, SectionSize); } } @@ -71,8 +73,7 @@ namespace PckStudio.Extensions for (int i = 0; i < source.Height / source.Width; i++) { ImageLayoutInfo locationInfo = new ImageLayoutInfo(source.Width, source.Height, i, layoutDirection); - Rectangle tileArea = new Rectangle(locationInfo.SectionPoint, locationInfo.SectionSize); - yield return source.GetArea(tileArea); + yield return source.GetArea(locationInfo.SectionArea); } yield break; } From f2ced4285aba3978197abf6322575996172f6e42 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:57:34 +0200 Subject: [PATCH 07/80] ImageExtensions.cs - Move 'ImageLayoutDirection' to namespace level --- PCK-Studio/Classes/Extensions/ImageExtensions.cs | 4 ++-- PCK-Studio/Forms/Editor/Animation.cs | 2 +- PCK-Studio/Forms/Editor/AnimationEditor.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index e1c954a8..91c79c08 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -9,14 +9,14 @@ using System.Linq; namespace PckStudio.Extensions { - internal static class ImageExtensions - { public enum ImageLayoutDirection { Horizontal, Vertical } + internal static class ImageExtensions + { private struct ImageLayoutInfo { /// diff --git a/PCK-Studio/Forms/Editor/Animation.cs b/PCK-Studio/Forms/Editor/Animation.cs index 7aa20194..1f1f8065 100644 --- a/PCK-Studio/Forms/Editor/Animation.cs +++ b/PCK-Studio/Forms/Editor/Animation.cs @@ -140,7 +140,7 @@ namespace PckStudio.Forms.Editor var textures = isClockOrCompass ? linearImages : frameTextures; - return ImageExtensions.ImageFromImageArray(textures.ToArray(), ImageExtensions.ImageLayoutDirection.Vertical); + return ImageExtensions.ImageFromImageArray(textures.ToArray(), ImageLayoutDirection.Vertical); } } } diff --git a/PCK-Studio/Forms/Editor/AnimationEditor.cs b/PCK-Studio/Forms/Editor/AnimationEditor.cs index 7ddcdc7e..b538538b 100644 --- a/PCK-Studio/Forms/Editor/AnimationEditor.cs +++ b/PCK-Studio/Forms/Editor/AnimationEditor.cs @@ -49,7 +49,7 @@ namespace PckStudio.Forms.Editor using MemoryStream textureMem = new MemoryStream(animationFile.Data); var texture = new Bitmap(textureMem); - var frameTextures = texture.CreateImageList(ImageExtensions.ImageLayoutDirection.Horizontal); + var frameTextures = texture.CreateImageList(ImageLayoutDirection.Horizontal); currentAnimation = animationFile.Properties.HasProperty("ANIM") ? new Animation(frameTextures, animationFile.Properties.GetPropertyValue("ANIM")) @@ -294,7 +294,7 @@ namespace PckStudio.Forms.Editor return; } using MemoryStream textureMem = new MemoryStream(File.ReadAllBytes(textureFile)); - var textures = Image.FromStream(textureMem).CreateImageList(ImageExtensions.ImageLayoutDirection.Horizontal); + var textures = Image.FromStream(textureMem).CreateImageList(ImageLayoutDirection.Horizontal); var new_animation = new Animation(textures); try { From 4b105ab8198d9bb35ef592f2472ab55329d89f4c Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:59:19 +0200 Subject: [PATCH 08/80] ImageExtensions.cs - Rename some function member names and use Math.DivRem --- PCK-Studio/Classes/Extensions/ImageExtensions.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index 91c79c08..72147a9d 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -50,13 +50,12 @@ namespace PckStudio.Extensions public static IEnumerable CreateImageList(this Image source, Size size) { - int img_row_count = source.Width / size.Width; - int img_column_count = source.Height / size.Height; - Debug.WriteLine($"{source.Width} {source.Height} {size} {img_column_count} {img_row_count}"); - for (int i = 0; i < img_column_count * img_row_count; i++) + int rowCount = source.Width / size.Width; + int columnCount = source.Height / size.Height; + Debug.WriteLine($"{source.Width} {source.Height} {size} {columnCount} {rowCount}"); + for (int i = 0; i < columnCount * rowCount; i++) { - int row = i / img_row_count; - int column = i % img_row_count; + int row = Math.DivRem(i, rowCount, out int column); Rectangle tileArea = new Rectangle(new Point(column * size.Height, row * size.Width), size); yield return source.GetArea(tileArea); } From 60fbdfe7957ba1998e54e7a9477753a68a3ed11f Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:01:23 +0200 Subject: [PATCH 09/80] ImageExtensions.cs - Improve Blend function when blending with a color --- .../Classes/Extensions/ImageExtensions.cs | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index 72147a9d..c34fb646 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -141,11 +141,38 @@ namespace PckStudio.Extensions return image; } - public static Image Blend(this Image bg, Color foregroundColor, BlendMode mode) + public static Image Blend(this Image image, Color foregroundColor, BlendMode mode) { - Bitmap bitmap = new Bitmap(bg); - bitmap.Fill(foregroundColor); - return bg.Blend(bitmap, mode); + if (image is not Bitmap baseImage) + return image; + + BitmapData baseImageData = baseImage.LockBits(new Rectangle(Point.Empty, baseImage.Size), + ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); + byte[] baseImageBuffer = new byte[baseImageData.Stride * baseImageData.Height]; + + Marshal.Copy(baseImageData.Scan0, baseImageBuffer, 0, baseImageBuffer.Length); + + float overlayR = foregroundColor.R / 255f; + float overlayG = foregroundColor.G / 255f; + float overlayB = foregroundColor.B / 255f; + + for (int k = 0; k < baseImageBuffer.Length; k += 4) + { + baseImageBuffer[k + 0] = CalculateColorComponentBlendValue(baseImageBuffer[k + 0] / 255f, overlayR, mode); + baseImageBuffer[k + 1] = CalculateColorComponentBlendValue(baseImageBuffer[k + 1] / 255f, overlayG, mode); + baseImageBuffer[k + 2] = CalculateColorComponentBlendValue(baseImageBuffer[k + 2] / 255f, overlayB, mode); + } + + Bitmap bitmapResult = new Bitmap(baseImage.Width, baseImage.Height, PixelFormat.Format32bppArgb); + BitmapData resultImageData = bitmapResult.LockBits(new Rectangle(Point.Empty, bitmapResult.Size), + ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); + + Marshal.Copy(baseImageBuffer, 0, resultImageData.Scan0, baseImageBuffer.Length); + + bitmapResult.UnlockBits(resultImageData); + baseImage.UnlockBits(baseImageData); + + return bitmapResult; } public static Image Blend(this Image image, Image overlay, BlendMode mode) From 04b0b66f674725c3cd167bb1bcf3e6e7b65fe1ec Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 10 Apr 2023 11:29:18 +0200 Subject: [PATCH 10/80] Remove CSM.cs and 3DSUtil and created reader/writer for 3ds textures --- PCK-Studio/Classes/FileTypes/CSM.cs | 91 ------------ .../Classes/IO/3DST/3DSTextureReader.cs | 94 +++++++++++++ .../Classes/IO/3DST/3DSTextureWriter.cs | 47 +++++++ .../{Utils/3DS => IO/3DST}/TextureCodec.cs | 27 +++- PCK-Studio/Classes/Utils/3DS/3DSUtil.cs | 131 ------------------ .../Forms/Skins-And-Textures/addnewskin.cs | 5 +- PCK-Studio/MainForm.cs | 8 +- PCK-Studio/PckStudio.csproj | 6 +- 8 files changed, 175 insertions(+), 234 deletions(-) delete mode 100644 PCK-Studio/Classes/FileTypes/CSM.cs create mode 100644 PCK-Studio/Classes/IO/3DST/3DSTextureReader.cs create mode 100644 PCK-Studio/Classes/IO/3DST/3DSTextureWriter.cs rename PCK-Studio/Classes/{Utils/3DS => IO/3DST}/TextureCodec.cs (96%) delete mode 100644 PCK-Studio/Classes/Utils/3DS/3DSUtil.cs diff --git a/PCK-Studio/Classes/FileTypes/CSM.cs b/PCK-Studio/Classes/FileTypes/CSM.cs deleted file mode 100644 index 5c8e27ff..00000000 --- a/PCK-Studio/Classes/FileTypes/CSM.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Drawing; -using System.IO; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using PckStudio.Models; - -namespace PckStudio.Classes -{ - class CSM - { - - //Part Name - //Part Parent(HEAD, BODY, LEG0, LEG1, ARM0, ARM1) - //Part Name - //Position-X - //Position-Y - //Position-Z - //Size-X - //Size-Y - //Size-Z - //UV-Y - //UV-X - - public static List CSMBlock = new List(); - - public static void TryParse(string CSM, MinecraftModelView modelView) - { - try - { - int i = 0; - string[] CSMLines = CSM.Split(new[] { "\n", "\r\n" }, StringSplitOptions.None); - foreach (string line in CSMLines) - { - if (i > 10) - { - GetModelPartFromCSM(CSMBlock, modelView); - CSMBlock.Clear(); - i = 0; - } - CSMBlock.Add(line + "\n"); - i++; - } - - modelView.Invalidate(); - } - catch { } - } - - public static void GetModelPartFromCSM(List CSM, MinecraftModelView modelView) - { - string PartName = CSM[0]; - string PartParent = CSM[1]; - string PartName2 = CSM[2]; - int PositionX = int.Parse(CSM[3]); - int PositionY = int.Parse(CSM[4]); - int PositionZ = int.Parse(CSM[5]); - int SizeX = int.Parse(CSM[6]); - int SizeY = int.Parse(CSM[7]); - int SizeZ = int.Parse(CSM[8]); - int UVY = int.Parse(CSM[9]); - int UVX = int.Parse(CSM[10]); - - //RenderBox - System.Drawing.Image source = Textures[0].Source; - Object3D object3D = new Box(source, new Rectangle(8, 0, 0x10, 8), new Rectangle(0, 8, 0x20, 8), new Point3D(0f, 0f, 0f), Effects.None); - Object3D object3D2 = new Box(source, new Rectangle(0x28, 0, 0x10, 8), new Rectangle(0x20, 8, 0x20, 8), new Point3D(0f, 0f, 0f), Effects.None); - Object3D object3D3 = new Box(source, new Rectangle(0x2C, 0x10, 8, 4), new Rectangle(0x28, 0x14, 0x20, 0xC), new Point3D(0f, 4f, 0f), Effects.FlipHorizontally); - - - //RenderGroup - Object3DGroup object3DGroup = new Object3DGroup(); - object3D2.Scale = 1.16f; - object3DGroup.RotationOrder = RotationOrders.XY; - object3DGroup.MinDegrees1 = -80f; - object3DGroup.MaxDegrees1 = 80f; - object3DGroup.MinDegrees2 = -57f; - object3DGroup.MaxDegrees2 = 57f; - object3DGroup.Add(object3D); - object3DGroup.Add(object3D2); - object3DGroup.Position = new Point3D(0f, 8f, 0f); - object3DGroup.Origin = new Point3D(0f, -4f, 0f); - object3DGroup.RotationOrder = RotationOrders.XY; - modelView.AddDynamic(object3DGroup); - } - - public static Texture[] Textures = new Texture[] { new Texture(Bitmap.FromFile(Environment.CurrentDirectory + "\\default.png")) }; - } -} diff --git a/PCK-Studio/Classes/IO/3DST/3DSTextureReader.cs b/PCK-Studio/Classes/IO/3DST/3DSTextureReader.cs new file mode 100644 index 00000000..e944003f --- /dev/null +++ b/PCK-Studio/Classes/IO/3DST/3DSTextureReader.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using OMI.Workers; +using PckStudio.Classes._3ds; +using OMI; + +namespace PckStudio.Classes.IO._3DST +{ + internal class _3DSTextureReader : IDataFormatReader, IDataFormatReader + { + public Image FromFile(string filename) + { + if (File.Exists(filename)) + { + Image img = null; + using (var fs = File.OpenRead(filename)) + { + img = FromStream(fs); + } + return img; + } + throw new FileNotFoundException(filename); + } + + public Image FromStream(Stream stream) + { + Image img = null; + using (var reader = new EndiannessAwareBinaryReader(stream, Encoding.ASCII, leaveOpen: true, Endianness.LittleEndian)) + { + if (reader.ReadString(4) == "3DST") + { + const int offset = 32; + reader.ReadInt32(); // unknown value + _3DSTextureFormat format = reader.ReadInt32() switch + { + 0 => _3DSTextureFormat.argb8, + 1 => _3DSTextureFormat.rgb8, + 2 => _3DSTextureFormat.rgba5551, + 3 => _3DSTextureFormat.rgb8, + 4 => _3DSTextureFormat.rgba4, + 9 => _3DSTextureFormat.la4, + _ => _3DSTextureFormat.dontCare, + }; + int width = reader.ReadInt32(); + int height = reader.ReadInt32(); + int bufferSize = CalcBufferSize(format, width, height); + stream.Seek(offset, SeekOrigin.Begin); + byte[] buffer = new byte[bufferSize]; + reader.Read(buffer, 0, bufferSize); + img = TextureCodec.Decode(buffer, width, height, format); + img.RotateFlip(RotateFlipType.RotateNoneFlipY); + } + } + return img; + } + + private static int CalcBufferSize(_3DSTextureFormat textureFormat, int width, int height) + { + switch (textureFormat) + { + case _3DSTextureFormat.argb8: + return width * height * 4; + case _3DSTextureFormat.rgb8: + return width * height * 3; + case _3DSTextureFormat.rgba5551: + case _3DSTextureFormat.rgb565: + case _3DSTextureFormat.rgba4: + case _3DSTextureFormat.la8: + case _3DSTextureFormat.hilo8: + return width * height * 2; + case _3DSTextureFormat.l8: + case _3DSTextureFormat.a8: + case _3DSTextureFormat.la4: + case _3DSTextureFormat.etc1a4: + return width * height; + case _3DSTextureFormat.l4: + case _3DSTextureFormat.a4: + case _3DSTextureFormat.etc1: + return width * height >> 1; + default: + throw new InvalidDataException("Invalid texture format on BCH!"); + } + } + + object IDataFormatReader.FromFile(string filename) => FromFile(filename); + + object IDataFormatReader.FromStream(Stream stream) => FromStream(stream); + } +} diff --git a/PCK-Studio/Classes/IO/3DST/3DSTextureWriter.cs b/PCK-Studio/Classes/IO/3DST/3DSTextureWriter.cs new file mode 100644 index 00000000..28864ed2 --- /dev/null +++ b/PCK-Studio/Classes/IO/3DST/3DSTextureWriter.cs @@ -0,0 +1,47 @@ +using System; +using System.Drawing; +using System.IO; +using System.Text; +using OMI; +using OMI.Workers; +using PckStudio.Classes._3ds; + +namespace PckStudio.Classes.IO._3DST +{ + internal class _3DSTextureWriter : IDataFormatWriter + { + private Image _image; + private _3DSTextureFormat _format; + public _3DSTextureWriter(Image image, _3DSTextureFormat format = _3DSTextureFormat.argb8) + { + _image = image; + _format = format; + } + + public void WriteToFile(string filename) + { + using(var fs = File.OpenWrite(filename)) + { + WriteToStream(fs); + } + } + + public void WriteToStream(Stream stream) + { + using (var writer = new EndiannessAwareBinaryWriter(stream, Encoding.ASCII, leaveOpen: true, Endianness.LittleEndian)) + { + writer.WriteString("3DST"); // 0 + writer.Write(2); // 4 unknown + writer.Write((int)_format); // 8 + writer.Write(_image.Width); // 12 + writer.Write(_image.Height); // 16 + writer.Write(0); // 20 + writer.Write(0); // 24 + writer.Write(0); // 28 + _image.RotateFlip(RotateFlipType.RotateNoneFlipY); + byte[] buffer = TextureCodec.Encode(new Bitmap(_image), _format); + stream.Write(buffer, 0, buffer.Length); + } + } + } +} diff --git a/PCK-Studio/Classes/Utils/3DS/TextureCodec.cs b/PCK-Studio/Classes/IO/3DST/TextureCodec.cs similarity index 96% rename from PCK-Studio/Classes/Utils/3DS/TextureCodec.cs rename to PCK-Studio/Classes/IO/3DST/TextureCodec.cs index aa0b963a..2f208a2f 100644 --- a/PCK-Studio/Classes/Utils/3DS/TextureCodec.cs +++ b/PCK-Studio/Classes/IO/3DST/TextureCodec.cs @@ -2,14 +2,35 @@ using System.Drawing; using System.Drawing.Imaging; using System.Runtime.InteropServices; -using PckStudio.Classes._3ds.Utils; namespace PckStudio.Classes._3ds { + /// + /// Format of the texture used on the PICA200. + /// + public enum _3DSTextureFormat + { + argb8 = 0, + rgb8 = 1, + rgba5551 = 2, + rgb565 = 3, + rgba4 = 4, + la8 = 5, + hilo8 = 6, + l8 = 7, + a8 = 8, + la4 = 9, + l4 = 0xa, + a4 = 0xb, + etc1 = 0xc, + etc1a4 = 0xd, + dontCare + } + class TextureCodec { - private static int[] tileOrder = { 0, 1, 8, 9, 2, 3, 10, 11, 16, 17, 24, 25, 18, 19, 26, 27, 4, 5, 12, 13, 6, 7, 14, 15, 20, 21, 28, 29, 22, 23, 30, 31, 32, 33, 40, 41, 34, 35, 42, 43, 48, 49, 56, 57, 50, 51, 58, 59, 36, 37, 44, 45, 38, 39, 46, 47, 52, 53, 60, 61, 54, 55, 62, 63 }; - private static int[,] etc1LUT = { { 2, 8, -2, -8 }, { 5, 17, -5, -17 }, { 9, 29, -9, -29 }, { 13, 42, -13, -42 }, { 18, 60, -18, -60 }, { 24, 80, -24, -80 }, { 33, 106, -33, -106 }, { 47, 183, -47, -183 } }; + private static readonly int[] tileOrder = { 0, 1, 8, 9, 2, 3, 10, 11, 16, 17, 24, 25, 18, 19, 26, 27, 4, 5, 12, 13, 6, 7, 14, 15, 20, 21, 28, 29, 22, 23, 30, 31, 32, 33, 40, 41, 34, 35, 42, 43, 48, 49, 56, 57, 50, 51, 58, 59, 36, 37, 44, 45, 38, 39, 46, 47, 52, 53, 60, 61, 54, 55, 62, 63 }; + private static readonly int[,] etc1LUT = { { 2, 8, -2, -8 }, { 5, 17, -5, -17 }, { 9, 29, -9, -29 }, { 13, 42, -13, -42 }, { 18, 60, -18, -60 }, { 24, 80, -24, -80 }, { 33, 106, -33, -106 }, { 47, 183, -47, -183 } }; private static class TextureConverter { diff --git a/PCK-Studio/Classes/Utils/3DS/3DSUtil.cs b/PCK-Studio/Classes/Utils/3DS/3DSUtil.cs deleted file mode 100644 index 485420a7..00000000 --- a/PCK-Studio/Classes/Utils/3DS/3DSUtil.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; -using System.Drawing; -using System.IO; -using System.Text; - -namespace PckStudio.Classes._3ds.Utils -{ - /// - /// Format of the texture used on the PICA200. - /// - public enum _3DSTextureFormat - { - argb8 = 0, - rgb8 = 1, - rgba5551 = 2, - rgb565 = 3, - rgba4 = 4, - la8 = 5, - hilo8 = 6, - l8 = 7, - a8 = 8, - la4 = 9, - l4 = 0xa, - a4 = 0xb, - etc1 = 0xc, - etc1a4 = 0xd, - dontCare - } - - internal class _3DSUtil - { - private static string ReadString(Stream stream, int len) - { - byte[] buffer = new byte[len]; - stream.Read(buffer, 0, len); - return Encoding.ASCII.GetString(buffer); - } - - private static int ReadInt32(Stream stream) - { - byte[] buffer = new byte[4]; - stream.Read(buffer, 0, 4); - return BitConverter.ToInt32(buffer, 0); - } - - private static void WriteString(Stream stream, string s) - { - byte[] buffer = Encoding.ASCII.GetBytes(s); - stream.Write(buffer, 0, buffer.Length); - } - - private static void WriteInt32(Stream stream, int value) - { - byte[] buffer = BitConverter.GetBytes(value); - stream.Write(buffer, 0, 4); - } - - public static int CalcBufferSize(_3DSTextureFormat textureFormat, int width, int height) - { - switch (textureFormat) - { - case _3DSTextureFormat.argb8: - return width * height * 4; - case _3DSTextureFormat.rgb8: - return width * height * 3; - case _3DSTextureFormat.rgba5551: - case _3DSTextureFormat.rgb565: - case _3DSTextureFormat.rgba4: - case _3DSTextureFormat.la8: - case _3DSTextureFormat.hilo8: - return width * height * 2; - case _3DSTextureFormat.l8: - case _3DSTextureFormat.a8: - case _3DSTextureFormat.la4: - case _3DSTextureFormat.etc1a4: - return width * height; - case _3DSTextureFormat.l4: - case _3DSTextureFormat.a4: - case _3DSTextureFormat.etc1: - return width * height >> 1; - default: - throw new InvalidDataException("Invalid texture format on BCH!"); - } - } - - public static Image GetImageFrom3DST(Stream stream) - { - if (ReadString(stream, 4) == "3DST") - { - const int offset = 32; - stream.Seek(8L, SeekOrigin.Begin); - _3DSTextureFormat format = ReadInt32(stream) switch - { - 0 => _3DSTextureFormat.argb8, - 1 => _3DSTextureFormat.rgb8, - 2 => _3DSTextureFormat.rgba5551, - 3 => _3DSTextureFormat.rgb8, - 4 => _3DSTextureFormat.rgba4, - 9 => _3DSTextureFormat.la4, - _ => _3DSTextureFormat.dontCare, - }; - int width = ReadInt32(stream); - int height = ReadInt32(stream); - int bufferSize = CalcBufferSize(format, width, height); - stream.Seek(offset, SeekOrigin.Begin); - byte[] buffer = new byte[bufferSize]; - stream.Read(buffer, 0, bufferSize); - var img = TextureCodec.Decode(buffer, width, height, format); - img.RotateFlip(RotateFlipType.RotateNoneFlipY); - return img; - } - return null; - } - - public static void SetImageTo3DST(Stream stream, Image source, _3DSTextureFormat format = _3DSTextureFormat.argb8) - { - // TODO: fix Encoding - WriteString(stream, "3DST"); // 0 - WriteInt32(stream, 2); // 4 unknown - WriteInt32(stream, (int)format); // 8 - WriteInt32(stream, source.Width); // 12 - WriteInt32(stream, source.Height); // 16 - WriteInt32(stream, 0); // 20 - WriteInt32(stream, 0); // 24 - WriteInt32(stream, 0); // 28 - source.RotateFlip(RotateFlipType.RotateNoneFlipY); - byte[] buffer = TextureCodec.Encode(new Bitmap(source), format); - stream.Write(buffer, 0, buffer.Length); - } - } -} diff --git a/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs b/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs index 1fda9bed..76a66e8c 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs @@ -5,10 +5,10 @@ using System.Windows.Forms; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using PckStudio.Classes.Utils; -using PckStudio.Classes._3ds.Utils; using OMI.Formats.Languages; using OMI.Formats.Pck; using PckStudio.Forms.Editor; +using PckStudio.Classes.IO._3DST; namespace PckStudio { @@ -347,7 +347,8 @@ namespace PckStudio { using (var fs = File.OpenRead(ofdd.FileName)) { - CheckImage(_3DSUtil.GetImageFrom3DST(fs)); + var reader = new _3DSTextureReader(); + CheckImage(reader.FromStream(fs)); textSkinName.Text = Path.GetFileNameWithoutExtension(ofdd.FileName); } return; diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 1c981353..5be7fa29 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -19,7 +19,6 @@ using PckStudio.Properties; using PckStudio.Classes.FileTypes; using PckStudio.Classes.Utils; using PckStudio.Classes.Utils.ARC; -using PckStudio.Classes._3ds.Utils; using PckStudio.Forms; using PckStudio.Forms.Utilities; using PckStudio.Forms.Editor; @@ -27,6 +26,7 @@ using PckStudio.Forms.Additional_Popups.Animation; using PckStudio.Forms.Additional_Popups; using PckStudio.Classes.Misc; using PckStudio.Classes.IO.PCK; +using PckStudio.Classes.IO._3DST; namespace PckStudio { @@ -2069,11 +2069,11 @@ namespace PckStudio saveFileDialog.DefaultExt = ".3dst"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { - using (var fs = saveFileDialog.OpenFile()) + using (var ms = new MemoryStream(file.Data)) { - using var ms = new MemoryStream(file.Data); Image img = Image.FromStream(ms); - _3DSUtil.SetImageTo3DST(fs, img); + var writer = new _3DSTextureWriter(img); + writer.WriteToFile(saveFileDialog.FileName); } } } diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index ae28ad89..47575773 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -176,7 +176,8 @@ - + + @@ -185,7 +186,6 @@ - @@ -464,7 +464,7 @@ CreditsForm.cs - + AddEntry.cs From 092d76e1bcd5a379bf88ce0ddd06346fee64657b Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 10 Apr 2023 12:26:42 +0200 Subject: [PATCH 11/80] Rename and Moved ListUtils --- .../{Utils/ListUtils.cs => Extensions/ListExtensions.cs} | 4 ++-- PCK-Studio/PckStudio.csproj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename PCK-Studio/Classes/{Utils/ListUtils.cs => Extensions/ListExtensions.cs} (80%) diff --git a/PCK-Studio/Classes/Utils/ListUtils.cs b/PCK-Studio/Classes/Extensions/ListExtensions.cs similarity index 80% rename from PCK-Studio/Classes/Utils/ListUtils.cs rename to PCK-Studio/Classes/Extensions/ListExtensions.cs index ff200c6b..8ec3b636 100644 --- a/PCK-Studio/Classes/Utils/ListUtils.cs +++ b/PCK-Studio/Classes/Extensions/ListExtensions.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -namespace PckStudio.Forms.Utilities +namespace PckStudio.Extensions { - public static class ListUtils + public static class ListExtensions { public static IList Swap(this IList list, int index1, int index2) { diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 47575773..6d7d1bfa 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -416,7 +416,7 @@ installWiiU.cs - + Form From ba188630d27fabb17aab968c7bb751b1640da64d Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:39:05 +0200 Subject: [PATCH 12/80] Update README update section to recurs submodules --- README.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 48f1f058..e918ecda 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # PCK Studio -Modify .PCK archives as you please! +Modify .PCK archives as you please!
+**If you have any issues or would like to suggested a feature, we encourage you to open a new [issue](https://github.com/PhoenixARC/-PCK-Studio/issues) on the github.** ## Features: -#### If you'd like to suggested a feature to be added open an [issue](https://github.com/PhoenixARC/-PCK-Studio/issues) on the github. * Open, Edit and Save .PCK archives (this means models, animations, entire custom packs, etc.) * Add / Remove / Replace skins, audios, textures, animations and much more. * Edit localization data to make your mods support every language supported by minecraft itself! @@ -23,8 +23,8 @@ Modify .PCK archives as you please! ### Setup: ```shell -$ git clone https://github.com/PhoenixARC/-PCK-Studio.git -$ cd "-PCK-Studio" +$ git clone --recursive https://github.com/PhoenixARC/-PCK-Studio.git PCK-Studio +$ cd PCK-Studio ``` ## How to Build: @@ -44,21 +44,19 @@ $ cd "-PCK-Studio" ``` ### A quick note: - * Forms will not load in viewer until the solution is build _at least_ once +## Active Developers: +> [PhoenixARC](https://github.com/PhoenixARC)
+> [MattNL](https://github.com/MattN-L)
+> [Miku-666](https://github.com/NessieHax)
+> [EternalModz](https://github.com/EternalModz)
-## Active Dev Team: -* [PhoenixARC](https://github.com/PhoenixARC) -* [MattNL](https://github.com/MattN-L) -* [Miku-666](https://github.com/NessieHax) -* [EternalModz](https://github.com/EternalModz) - -## Legacy PCK Studio Devs and contributors: -* [Nobledez](https://github.com/Nobledez) -* [XxModZxXWiiPlaza](https://github.com/XxModZxXWiiPlaza) -* [SlothWiiPlaza](https://github.com/Kashiiera) -* [jam1garner](https://github.com/jam1garner) +## Previous Developers and Contributors: +> [Nobledez](https://github.com/Nobledez)
+> [jam1garner](https://github.com/jam1garner)
+> [XxModZxXWiiPlaza](https://github.com/XxModZxXWiiPlaza)
+> [SlothWiiPlaza](https://github.com/Kashiiera)
## Other Credits * [yaboiFoxx](https://github.com/yaboiFoxx) for Improved UI concept From f99d0f4fd2d5d4aabf9ad6aef07d8c1b6932e122 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sun, 16 Apr 2023 19:20:46 +0200 Subject: [PATCH 13/80] Add default value for GraphicsConfig.CompositingMode --- PCK-Studio/Classes/Extensions/GraphicsExtensions.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PCK-Studio/Classes/Extensions/GraphicsExtensions.cs b/PCK-Studio/Classes/Extensions/GraphicsExtensions.cs index b29842da..22f7885d 100644 --- a/PCK-Studio/Classes/Extensions/GraphicsExtensions.cs +++ b/PCK-Studio/Classes/Extensions/GraphicsExtensions.cs @@ -15,6 +15,7 @@ namespace PckStudio.Extensions InterpolationMode = InterpolationMode.Default; SmoothingMode = SmoothingMode.Default; PixelOffsetMode = PixelOffsetMode.Default; + CompositingMode = CompositingMode.SourceOver; } public CompositingMode CompositingMode { get; set; } From 876a05d05d7c8ca4f1baa0b63f11670af4038b37 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sun, 16 Apr 2023 19:23:05 +0200 Subject: [PATCH 14/80] ImageExtensions.cs - Add size check when blending two images --- PCK-Studio/Classes/Extensions/ImageExtensions.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index c34fb646..b2e5a5df 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -9,11 +9,11 @@ using System.Linq; namespace PckStudio.Extensions { - public enum ImageLayoutDirection - { - Horizontal, - Vertical - } + public enum ImageLayoutDirection + { + Horizontal, + Vertical + } internal static class ImageExtensions { @@ -151,7 +151,7 @@ namespace PckStudio.Extensions byte[] baseImageBuffer = new byte[baseImageData.Stride * baseImageData.Height]; Marshal.Copy(baseImageData.Scan0, baseImageBuffer, 0, baseImageBuffer.Length); - + float overlayR = foregroundColor.R / 255f; float overlayG = foregroundColor.G / 255f; float overlayB = foregroundColor.B / 255f; @@ -177,8 +177,10 @@ namespace PckStudio.Extensions public static Image Blend(this Image image, Image overlay, BlendMode mode) { - if (image is not Bitmap baseImage || overlay is not Bitmap overlayImage) + if (image is not Bitmap baseImage || overlay is not Bitmap overlayImage || + image.Width != overlay.Width || image.Height != overlay.Height) return image; + BitmapData baseImageData = baseImage.LockBits(new Rectangle(Point.Empty, baseImage.Size), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); byte[] baseImageBuffer = new byte[baseImageData.Stride * baseImageData.Height]; From 485011c552cc2209dfe7a7cf0316e7eb31a0c100 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 17 Apr 2023 17:58:57 +0200 Subject: [PATCH 15/80] Removed unused BedrockJSONtoCSM and CSMtoBedrockJSON --- PCK-Studio/Classes/Utils/BedrockJSONtoCSM.cs | 98 ----------------- PCK-Studio/Classes/Utils/CSMtoBedrockJSON.cs | 105 ------------------- 2 files changed, 203 deletions(-) delete mode 100644 PCK-Studio/Classes/Utils/BedrockJSONtoCSM.cs delete mode 100644 PCK-Studio/Classes/Utils/CSMtoBedrockJSON.cs diff --git a/PCK-Studio/Classes/Utils/BedrockJSONtoCSM.cs b/PCK-Studio/Classes/Utils/BedrockJSONtoCSM.cs deleted file mode 100644 index b9989707..00000000 --- a/PCK-Studio/Classes/Utils/BedrockJSONtoCSM.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; - -namespace PckStudio.Classes.Utils.ModelConversion -{ - public class BedrockJSONtoCSM - { - public string JSONtoCSM(string JsonString) - { - dynamic jsonDe = JsonConvert.DeserializeObject(JsonString); - string NewJSON = JsonConvert.SerializeObject(jsonDe["minecraft:geometry"]); - JObject[] NewJObject = JsonConvert.DeserializeObject(NewJSON); - - string CSMData = ""; - foreach (JBone bone in NewJObject[0].bones) - { - int i = 0; - string PARENT = bone.name; - foreach (JCube Cube in bone.cubes) - { - string name = PARENT + " " + i; - - float PosXModifier = 0; - float PosYModifier = 0; - float PosZModifier = 0; - - switch (PARENT) - { - case "ARM0": - PosXModifier = 5; - PosYModifier = 22; - break; - case "ARM1": - PosXModifier = -5; - PosYModifier = 22; - break; - case "LEG0": - PosXModifier = 1.9f; - PosYModifier = 12; - break; - case "LEG1": - PosXModifier = -1.9f; - PosYModifier = 12; - break; - case "BODY": - PosYModifier = 24; - break; - case "HEAD": - PosYModifier = 24; - break; - } - - - float PosX = Cube.origin[0] + PosXModifier; - float PosY = Cube.origin[1] + PosYModifier; - float PosZ = Cube.origin[2] + PosZModifier; - float SizeX = Cube.size[0]; - float SizeY = Cube.size[1]; - float SizeZ = Cube.size[2]; - float UvX = Cube.uv[0]; - float UvY = Cube.uv[1]; - - CSMData += name + "\n" + PARENT + "\n" + name + "\n" + PosX + "\n" + PosY + "\n" + PosZ + "\n" + SizeX + "\n" + SizeY + "\n" + SizeZ + "\n" + UvX + "\n" + UvY + "\n"; - i++; - } - } - return CSMData; - } - } - - internal class WholeJSON - { - public string format_version = "1.12.0"; - public Dictionary entries = new Dictionary(); - } - - internal class JObject - { - public Dictionary description = new Dictionary(); - public JBone[] bones = { }; - } - internal class JBone - { - public string name = ""; - public int[] pivot = {0, 0, 0}; - public JCube[] cubes = { }; - } - internal class JCube - { - public float[] origin = new float[3]; - public float[] size = new float [3]; - public float[] uv = new float[2]; - } -} diff --git a/PCK-Studio/Classes/Utils/CSMtoBedrockJSON.cs b/PCK-Studio/Classes/Utils/CSMtoBedrockJSON.cs deleted file mode 100644 index 93df0546..00000000 --- a/PCK-Studio/Classes/Utils/CSMtoBedrockJSON.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; - -namespace PckStudio.Classes.Utils.ModelConversion -{ - public class CSMtoBedrockJSON - { - public string CSMtoJSON(string CSMString) - { - List CSMLIST = new List(); - CSMLIST.AddRange(CSMString.Split(new[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries)); - List> CSMS = SplitToSublists(CSMLIST, 11); - - JObject jobj = new JObject(); - List bones = new List(); - Dictionary> CubeList = new Dictionary> - { - {"HEAD", new List()}, - {"BODY", new List()}, - {"ARM0", new List()}, - {"ARM1", new List()}, - {"LEG0", new List()}, - {"LEG1", new List()} - }; - - foreach (List CSMItem in CSMS) - { - JCube NewCube = new JCube(); - - - float PosXModifier = 0; - float PosYModifier = 0; - float PosZModifier = 0; - - switch (CSMItem[1]) - { - case "ARM0": - PosXModifier = -5; - PosYModifier = -22; - break; - case "ARM1": - PosXModifier = 5; - PosYModifier = -22; - break; - case "LEG0": - PosXModifier = -1.9f; - PosYModifier = -12; - break; - case "LEG1": - PosXModifier = 1.9f; - PosYModifier = -12; - break; - case "BODY": - PosYModifier = -24; - break; - case "HEAD": - PosYModifier = -24; - break; - } - NewCube.origin[0] = float.Parse(CSMItem[3]) + PosXModifier; - NewCube.origin[1] = float.Parse(CSMItem[4]) + PosYModifier; - NewCube.origin[2] = float.Parse(CSMItem[5]) + PosZModifier; - NewCube.size[0] = float.Parse(CSMItem[6]); - NewCube.size[1] = float.Parse(CSMItem[7]); - NewCube.size[2] = float.Parse(CSMItem[8]); - NewCube.uv[0] = float.Parse(CSMItem[9]); - NewCube.uv[1] = float.Parse(CSMItem[10]); - CubeList[CSMItem[1]].Add(NewCube); - } - foreach (KeyValuePair> bone in CubeList) - { - JBone jb = new JBone(); - jb.name = bone.Key; - jb.cubes = bone.Value.ToArray(); - bones.Add(jb); - } - jobj.bones = bones.ToArray(); - jobj.description.Add("identifier", "geometry.steve"); - jobj.description.Add("texture_width", 64); - jobj.description.Add("texture_height", 64); - jobj.description.Add("visible_bounds_width", 2); - jobj.description.Add("visible_bounds_height", 3.5f); - jobj.description.Add("visible_bounds_offset", new float[] { 0, 1.25f, 0 }); - WholeJSON WJ = new WholeJSON(); - WJ.entries.Add("format_version", "1.12.0"); - WJ.entries.Add("minecraft:geometry", new JObject[] { jobj }); - string JSONDATA = JsonConvert.SerializeObject(WJ.entries, Formatting.Indented); - return JSONDATA; - } - - public List> SplitToSublists(List source, int size) - { - return source - .Select((x, i) => new { Index = i, Value = x }) - .GroupBy(x => x.Index / size) - .Select(x => x.Select(v => v.Value).ToList()) - .ToList(); - } - } - -} From 6acbb8c209e9165c2a86f707abcce1c3df16c6ef Mon Sep 17 00:00:00 2001 From: PhoenixARC <46140834+PhoenixARC@users.noreply.github.com> Date: Wed, 19 Apr 2023 16:14:28 -0400 Subject: [PATCH 16/80] remove link to unknown developer as was requested by the developer, their GitHub link has been removed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e918ecda..956e9118 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ $ cd PCK-Studio > [Nobledez](https://github.com/Nobledez)
> [jam1garner](https://github.com/jam1garner)
> [XxModZxXWiiPlaza](https://github.com/XxModZxXWiiPlaza)
-> [SlothWiiPlaza](https://github.com/Kashiiera)
+> SlothWiiPlaza
## Other Credits * [yaboiFoxx](https://github.com/yaboiFoxx) for Improved UI concept From 995fb47f421cde8a18210e2135282df15616572c Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 24 Apr 2023 15:14:15 +0200 Subject: [PATCH 17/80] Renamed folder 'IO/PCK' to 'IO/PckAudio' and renamed PCKAudioFile to PckAudioFile --- .../{PCKAudioFile.cs => PckAudioFile.cs} | 2 +- .../PckAudioFileReader.cs} | 20 +++---- .../PckAudioFileWriter.cs} | 6 +-- PCK-Studio/Forms/Editor/AudioEditor.cs | 52 +++++++++---------- PCK-Studio/MainForm.cs | 10 ++-- PCK-Studio/PckStudio.csproj | 6 +-- 6 files changed, 48 insertions(+), 48 deletions(-) rename PCK-Studio/Classes/FileTypes/{PCKAudioFile.cs => PckAudioFile.cs} (99%) rename PCK-Studio/Classes/IO/{PCK/PCKAudioFileReader.cs => PckAudio/PckAudioFileReader.cs} (88%) rename PCK-Studio/Classes/IO/{PCK/PCKAudioFileWriter.cs => PckAudio/PckAudioFileWriter.cs} (95%) diff --git a/PCK-Studio/Classes/FileTypes/PCKAudioFile.cs b/PCK-Studio/Classes/FileTypes/PckAudioFile.cs similarity index 99% rename from PCK-Studio/Classes/FileTypes/PCKAudioFile.cs rename to PCK-Studio/Classes/FileTypes/PckAudioFile.cs index f6b02138..d9524b10 100644 --- a/PCK-Studio/Classes/FileTypes/PCKAudioFile.cs +++ b/PCK-Studio/Classes/FileTypes/PckAudioFile.cs @@ -7,7 +7,7 @@ using OMI.Formats.Languages; namespace PckStudio.Classes.FileTypes { - public class PCKAudioFile + public class PckAudioFile { public class InvalidCategoryException : Exception { diff --git a/PCK-Studio/Classes/IO/PCK/PCKAudioFileReader.cs b/PCK-Studio/Classes/IO/PckAudio/PckAudioFileReader.cs similarity index 88% rename from PCK-Studio/Classes/IO/PCK/PCKAudioFileReader.cs rename to PCK-Studio/Classes/IO/PckAudio/PckAudioFileReader.cs index 4eb1710a..66893c5f 100644 --- a/PCK-Studio/Classes/IO/PCK/PCKAudioFileReader.cs +++ b/PCK-Studio/Classes/IO/PckAudio/PckAudioFileReader.cs @@ -17,23 +17,23 @@ namespace PckStudio.Classes.IO.PCK { } } - internal class PCKAudioFileReader : IDataFormatReader, IDataFormatReader + internal class PckAudioFileReader : IDataFormatReader, IDataFormatReader { - private PCKAudioFile _file; + private PckAudioFile _file; private Endianness _endianness; private List LUT = new List(); - private List _OriginalAudioTypeOrder = new List(); + private List _OriginalAudioTypeOrder = new List(); - public PCKAudioFileReader(Endianness endianness) + public PckAudioFileReader(Endianness endianness) { _endianness = endianness; } - public PCKAudioFile FromFile(string filename) + public PckAudioFile FromFile(string filename) { if(File.Exists(filename)) { - PCKAudioFile file; + PckAudioFile file; using(var fs = File.OpenRead(filename)) { file = FromStream(fs); @@ -43,7 +43,7 @@ namespace PckStudio.Classes.IO.PCK throw new FileNotFoundException(filename); } - public PCKAudioFile FromStream(Stream stream) + public PckAudioFile FromStream(Stream stream) { using (var reader = new EndiannessAwareBinaryReader(stream, _endianness == Endianness.BigEndian @@ -56,7 +56,7 @@ namespace PckStudio.Classes.IO.PCK throw new OverflowException(nameof(pck_type)); if (pck_type > 1) throw new InvalidAudioPckException(nameof(pck_type)); - _file = new PCKAudioFile(); + _file = new PckAudioFile(); ReadLookUpTable(reader); ReadCategories(reader); ReadCategorySongs(reader); @@ -81,8 +81,8 @@ namespace PckStudio.Classes.IO.PCK int categoryEntryCount = reader.ReadInt32(); for (; 0 < categoryEntryCount; categoryEntryCount--) { - var parameterType = (PCKAudioFile.AudioCategory.EAudioParameterType)reader.ReadInt32(); - var audioType = (PCKAudioFile.AudioCategory.EAudioType)reader.ReadInt32(); + var parameterType = (PckAudioFile.AudioCategory.EAudioParameterType)reader.ReadInt32(); + var audioType = (PckAudioFile.AudioCategory.EAudioType)reader.ReadInt32(); string name = ReadString(reader); // AddCategory puts the file's categories out of order and causes some songs to be put in the wrong categories // This is my simple fix for the issue. diff --git a/PCK-Studio/Classes/IO/PCK/PCKAudioFileWriter.cs b/PCK-Studio/Classes/IO/PckAudio/PckAudioFileWriter.cs similarity index 95% rename from PCK-Studio/Classes/IO/PCK/PCKAudioFileWriter.cs rename to PCK-Studio/Classes/IO/PckAudio/PckAudioFileWriter.cs index 3a1d9223..afed490a 100644 --- a/PCK-Studio/Classes/IO/PCK/PCKAudioFileWriter.cs +++ b/PCK-Studio/Classes/IO/PckAudio/PckAudioFileWriter.cs @@ -7,10 +7,10 @@ using System.Text; namespace PckStudio.Classes.IO.PCK { - internal class PCKAudioFileWriter : IDataFormatWriter + internal class PckAudioFileWriter : IDataFormatWriter { - private PCKAudioFile _file; + private PckAudioFile _file; private Endianness _endianness; private static readonly List LUT = new List { @@ -19,7 +19,7 @@ namespace PckStudio.Classes.IO.PCK "CREDITID" }; - public PCKAudioFileWriter(PCKAudioFile file, Endianness endianness) + public PckAudioFileWriter(PckAudioFile file, Endianness endianness) { _file = file; _endianness = endianness; diff --git a/PCK-Studio/Forms/Editor/AudioEditor.cs b/PCK-Studio/Forms/Editor/AudioEditor.cs index 746e1eec..76cb8cca 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.cs +++ b/PCK-Studio/Forms/Editor/AudioEditor.cs @@ -25,7 +25,7 @@ namespace PckStudio.Forms.Editor public partial class AudioEditor : MetroForm { public string defaultType = "yes"; - PCKAudioFile audioFile = null; + PckAudioFile audioFile = null; PckFile.FileData audioPCK; LOCFile loc; bool _isLittleEndian = false; @@ -44,15 +44,15 @@ namespace PckStudio.Forms.Editor "Unused?" }; - private string GetCategoryFromId(PCKAudioFile.AudioCategory.EAudioType categoryId) - => categoryId >= PCKAudioFile.AudioCategory.EAudioType.Overworld && - categoryId <= PCKAudioFile.AudioCategory.EAudioType.Unused + private string GetCategoryFromId(PckAudioFile.AudioCategory.EAudioType categoryId) + => categoryId >= PckAudioFile.AudioCategory.EAudioType.Overworld && + categoryId <= PckAudioFile.AudioCategory.EAudioType.Unused ? Categories[(int)categoryId] : "Not valid"; - private PCKAudioFile.AudioCategory.EAudioType GetCategoryId(string category) + private PckAudioFile.AudioCategory.EAudioType GetCategoryId(string category) { - return (PCKAudioFile.AudioCategory.EAudioType)Categories.IndexOf(category); + return (PckAudioFile.AudioCategory.EAudioType)Categories.IndexOf(category); } public AudioEditor(PckFile.FileData file, LOCFile locFile, bool isLittleEndian) @@ -64,7 +64,7 @@ namespace PckStudio.Forms.Editor audioPCK = file; using (var stream = new MemoryStream(file.Data)) { - var reader = new PCKAudioFileReader(isLittleEndian ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); + var reader = new PckAudioFileReader(isLittleEndian ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); audioFile = reader.FromStream(stream); } @@ -77,10 +77,10 @@ namespace PckStudio.Forms.Editor treeView1.Nodes.Clear(); foreach (var category in audioFile.Categories) { - if(category.audioType == PCKAudioFile.AudioCategory.EAudioType.Creative) + if(category.audioType == PckAudioFile.AudioCategory.EAudioType.Creative) { if (category.Name == "include_overworld" && - audioFile.TryGetCategory(PCKAudioFile.AudioCategory.EAudioType.Overworld, out PCKAudioFile.AudioCategory overworldCategory)) + audioFile.TryGetCategory(PckAudioFile.AudioCategory.EAudioType.Overworld, out PckAudioFile.AudioCategory overworldCategory)) { foreach (var name in category.SongNames.ToList()) { @@ -96,7 +96,7 @@ namespace PckStudio.Forms.Editor treeNode.Tag = category; treeView1.Nodes.Add(treeNode); } - playOverworldInCreative.Enabled = audioFile.HasCategory(PCKAudioFile.AudioCategory.EAudioType.Creative); + playOverworldInCreative.Enabled = audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Creative); treeView1.EndUpdate(); } @@ -121,7 +121,7 @@ namespace PckStudio.Forms.Editor private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { treeView2.Nodes.Clear(); - if (e.Node.Tag is PCKAudioFile.AudioCategory category) + if (e.Node.Tag is PckAudioFile.AudioCategory category) foreach (var name in category.SongNames) { treeView2.Nodes.Add(name); @@ -141,7 +141,7 @@ namespace PckStudio.Forms.Editor var category = audioFile.GetCategory(GetCategoryId(add.SelectedItem)); - if (GetCategoryId(add.SelectedItem) == PCKAudioFile.AudioCategory.EAudioType.Creative) + if (GetCategoryId(add.SelectedItem) == PckAudioFile.AudioCategory.EAudioType.Creative) { playOverworldInCreative.Visible = true; playOverworldInCreative.Checked = false; @@ -161,7 +161,7 @@ namespace PckStudio.Forms.Editor private void addEntryMenuItem_Click(object sender, EventArgs e) { - if (treeView1.SelectedNode is TreeNode t && t.Tag is PCKAudioFile.AudioCategory) + if (treeView1.SelectedNode is TreeNode t && t.Tag is PckAudioFile.AudioCategory) { if (!parent.CreateDataFolder()) return; @@ -182,7 +182,7 @@ namespace PckStudio.Forms.Editor if (treeView1.SelectedNode is TreeNode main && audioFile.RemoveCategory(GetCategoryId(treeView1.SelectedNode.Text))) { - if(GetCategoryId(treeView1.SelectedNode.Text) == PCKAudioFile.AudioCategory.EAudioType.Creative) + if(GetCategoryId(treeView1.SelectedNode.Text) == PckAudioFile.AudioCategory.EAudioType.Creative) { playOverworldInCreative.Visible = false; playOverworldInCreative.Checked = false; @@ -206,7 +206,7 @@ namespace PckStudio.Forms.Editor private void removeEntryMenuItem_Click(object sender, EventArgs e) { - if (treeView2.SelectedNode != null && treeView1.SelectedNode.Tag is PCKAudioFile.AudioCategory category) + if (treeView2.SelectedNode != null && treeView1.SelectedNode.Tag is PckAudioFile.AudioCategory category) { category.SongNames.Remove(treeView2.SelectedNode.Text); treeView2.SelectedNode.Remove(); @@ -261,7 +261,7 @@ namespace PckStudio.Forms.Editor } else if (user_prompt == DialogResult.No) { - if (treeView1.SelectedNode is TreeNode node && node.Tag is PCKAudioFile.AudioCategory cat) + if (treeView1.SelectedNode is TreeNode node && node.Tag is PckAudioFile.AudioCategory cat) { //adds song without affecting the binka file cat.SongNames.Add(songName); @@ -318,7 +318,7 @@ namespace PckStudio.Forms.Editor } // this is repeated again becuase this is meant to prevent any files that fail to convert from being added to the category - if (treeView1.SelectedNode is TreeNode t && t.Tag is PCKAudioFile.AudioCategory category) + if (treeView1.SelectedNode is TreeNode t && t.Tag is PckAudioFile.AudioCategory category) { category.SongNames.Add(songName); treeView2.Nodes.Add(songName); @@ -345,15 +345,15 @@ namespace PckStudio.Forms.Editor private void saveToolStripMenuItem1_Click(object sender, EventArgs e) { - if (!audioFile.HasCategory(PCKAudioFile.AudioCategory.EAudioType.Overworld) || - !audioFile.HasCategory(PCKAudioFile.AudioCategory.EAudioType.Nether) || - !audioFile.HasCategory(PCKAudioFile.AudioCategory.EAudioType.End)) + if (!audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Overworld) || + !audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.Nether) || + !audioFile.HasCategory(PckAudioFile.AudioCategory.EAudioType.End)) { MessageBox.Show("Your changes were not saved. The game will crash when loading your pack if the Overworld, Nether and End categories don't all exist with at least one valid song.", "Mandatory Categories Missing"); return; } - PCKAudioFile.AudioCategory overworldCategory = audioFile.GetCategory(PCKAudioFile.AudioCategory.EAudioType.Overworld); + PckAudioFile.AudioCategory overworldCategory = audioFile.GetCategory(PckAudioFile.AudioCategory.EAudioType.Overworld); bool songs_missing = false; foreach (var category in audioFile.Categories) @@ -375,7 +375,7 @@ namespace PckStudio.Forms.Editor } category.Name = ""; - if (playOverworldInCreative.Checked && category.audioType == PCKAudioFile.AudioCategory.EAudioType.Creative) + if (playOverworldInCreative.Checked && category.audioType == PckAudioFile.AudioCategory.EAudioType.Creative) { foreach (var name in overworldCategory.SongNames) { @@ -397,7 +397,7 @@ namespace PckStudio.Forms.Editor using (var stream = new MemoryStream()) { - var writer = new PCKAudioFileWriter(audioFile, _isLittleEndian ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); + var writer = new PckAudioFileWriter(audioFile, _isLittleEndian ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); writer.WriteToStream(stream); audioPCK.SetData(stream.ToArray()); } @@ -562,7 +562,7 @@ namespace PckStudio.Forms.Editor private void convertToWAVToolStripMenuItem_Click(object sender, EventArgs e) { - if (treeView2.SelectedNode != null && treeView1.SelectedNode.Tag is PCKAudioFile.AudioCategory) + if (treeView2.SelectedNode != null && treeView1.SelectedNode.Tag is PckAudioFile.AudioCategory) { Binka.ToWav(Path.Combine(parent.GetDataPath(), treeView2.SelectedNode.Text + ".binka"), Path.Combine(parent.GetDataPath())); } @@ -570,7 +570,7 @@ namespace PckStudio.Forms.Editor private void setCategoryToolStripMenuItem_Click(object sender, EventArgs e) { - if (!(treeView1.SelectedNode is TreeNode t && t.Tag is PCKAudioFile.AudioCategory category)) return; + if (!(treeView1.SelectedNode is TreeNode t && t.Tag is PckAudioFile.AudioCategory category)) return; string[] available = Categories.FindAll(str => !audioFile.HasCategory(GetCategoryId(str))).ToArray(); if (available.Length > 0) @@ -581,7 +581,7 @@ namespace PckStudio.Forms.Editor audioFile.RemoveCategory(category.audioType); - audioFile.AddCategory(category.parameterType, GetCategoryId(add.SelectedItem), category.audioType == PCKAudioFile.AudioCategory.EAudioType.Overworld && playOverworldInCreative.Checked ? "include_overworld" : ""); + audioFile.AddCategory(category.parameterType, GetCategoryId(add.SelectedItem), category.audioType == PckAudioFile.AudioCategory.EAudioType.Overworld && playOverworldInCreative.Checked ? "include_overworld" : ""); var newCategory = audioFile.GetCategory(GetCategoryId(add.SelectedItem)); diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 5be7fa29..5c65a8a8 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -835,15 +835,15 @@ namespace PckStudio private PckFile.FileData CreateNewAudioFile(bool isLittle) { // create actual valid pck file structure - PCKAudioFile audioPck = new PCKAudioFile(); - audioPck.AddCategory(PCKAudioFile.AudioCategory.EAudioType.Overworld); - audioPck.AddCategory(PCKAudioFile.AudioCategory.EAudioType.Nether); - audioPck.AddCategory(PCKAudioFile.AudioCategory.EAudioType.End); + PckAudioFile audioPck = new PckAudioFile(); + audioPck.AddCategory(PckAudioFile.AudioCategory.EAudioType.Overworld); + audioPck.AddCategory(PckAudioFile.AudioCategory.EAudioType.Nether); + audioPck.AddCategory(PckAudioFile.AudioCategory.EAudioType.End); PckFile.FileData pckFileData = currentPCK.CreateNewFile("audio.pck", PckFile.FileData.FileType.AudioFile, () => { using (var stream = new MemoryStream()) { - var writer = new PCKAudioFileWriter(audioPck, isLittle ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); + var writer = new PckAudioFileWriter(audioPck, isLittle ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); writer.WriteToStream(stream); return stream.ToArray(); } diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 6d7d1bfa..3b0cf3ee 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -174,14 +174,14 @@ - + - - + + From 4a41612188f2f802deb07d55fe6390e0d272d21f Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 25 Apr 2023 18:15:02 +0200 Subject: [PATCH 18/80] Updated ProgramInfo.BuildVersion to only return the version format --- PCK-Studio/MainForm.cs | 2 +- PCK-Studio/Program.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 5c65a8a8..f6078acf 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -72,7 +72,7 @@ namespace PckStudio labelVersion.Text = "PCK Studio: " + Application.ProductVersion; ChangelogRichTextBox.Text = Resources.CHANGELOG; #if DEBUG - labelVersion.Text += Program.Info.BuildVersion + " " + Program.Info.LastCommitHash; + labelVersion.Text += $" (Debug build: {Program.Info.BuildVersion}@{Program.Info.LastCommitHash})"; #endif pckFileTypeHandler = new Dictionary>(15) diff --git a/PCK-Studio/Program.cs b/PCK-Studio/Program.cs index 8a8f5c1c..51fce472 100644 --- a/PCK-Studio/Program.cs +++ b/PCK-Studio/Program.cs @@ -21,7 +21,7 @@ namespace PckStudio { // adopted Minecraft Java Edition Snapshot format (YYwWWn) // to keep better track of work in progress features and builds - return string.Format("(Debug build #{0}w{1}{2})", + return string.Format("#{0}w{1}{2}", date.ToString("yy"), BuildCalendar.GetWeekOfYear(date, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday), BuildType); From 931bc861c7e5d536702f239301da645286616002 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 25 Apr 2023 18:17:09 +0200 Subject: [PATCH 19/80] ImageExtensions.cs - Renamed ImageFromImageArray to CombineImages --- .../Classes/Extensions/ImageExtensions.cs | 19 ++++++++++++------- PCK-Studio/Forms/Editor/Animation.cs | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index b2e5a5df..cd4ce7a2 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -77,12 +77,12 @@ namespace PckStudio.Extensions yield break; } - public static Image ImageFromImageArray(Image[] sources, ImageLayoutDirection layoutDirection) + public static Image CombineImages(IList sources, ImageLayoutDirection layoutDirection) { Size imageSize = CalculateImageSize(sources, layoutDirection); - var result = new Bitmap(imageSize.Width, imageSize.Height); + var image = new Bitmap(imageSize.Width, imageSize.Height); - using (var graphic = Graphics.FromImage(result)) + using (var graphic = Graphics.FromImage(image)) { foreach (var (i, texture) in sources.enumerate()) { @@ -90,22 +90,27 @@ namespace PckStudio.Extensions graphic.DrawImage(texture, info.SectionPoint); }; } - return result; + return image; } - private static Size CalculateImageSize(Image[] sources, ImageLayoutDirection layoutDirection) + private static Size CalculateImageSize(IList sources, ImageLayoutDirection layoutDirection) { + if (sources.Count == 0) + { + return Size.Empty; + } var horizontal = layoutDirection == ImageLayoutDirection.Horizontal; int width = sources[0].Width; int height = sources[0].Height; + if (!sources.All(img => img.Width.Equals(width) && img.Height.Equals(height))) throw new InvalidOperationException("Images must have the same width and height."); if (horizontal) - width *= sources.Length; + width *= sources.Count; else - height *= sources.Length; + height *= sources.Count; return new Size(width, height); } diff --git a/PCK-Studio/Forms/Editor/Animation.cs b/PCK-Studio/Forms/Editor/Animation.cs index 1f1f8065..66f25134 100644 --- a/PCK-Studio/Forms/Editor/Animation.cs +++ b/PCK-Studio/Forms/Editor/Animation.cs @@ -140,7 +140,7 @@ namespace PckStudio.Forms.Editor var textures = isClockOrCompass ? linearImages : frameTextures; - return ImageExtensions.ImageFromImageArray(textures.ToArray(), ImageLayoutDirection.Vertical); + return ImageExtensions.CombineImages(textures, ImageLayoutDirection.Vertical); } } } From 12b7fce6ef14aff6cf8595e76aaf0ad20f44e83d Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 25 Apr 2023 18:19:10 +0200 Subject: [PATCH 20/80] MainForm.cs - Removed unnecessary mods folder creation on startup --- PCK-Studio/MainForm.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index f6078acf..cb12fb4b 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -127,16 +127,6 @@ namespace PckStudio modelsFileBINToolStripMenuItem.Click += (sender, e) => setFileType_Click(sender, e, PckFile.FileData.FileType.ModelsFile); behavioursFileBINToolStripMenuItem.Click += (sender, e) => setFileType_Click(sender, e, PckFile.FileData.FileType.BehavioursFile); entityMaterialsFileBINToolStripMenuItem.Click += (sender, e) => setFileType_Click(sender, e, PckFile.FileData.FileType.MaterialFile); - - try - { - Directory.CreateDirectory(Program.AppDataCache + "\\mods\\"); - } - catch (UnauthorizedAccessException ex) - { - MessageBox.Show("Could not Create directory due to Unauthorized Access"); - Debug.WriteLine(ex.Message); - } } private void FormMain_FormClosing(object sender, FormClosingEventArgs e) From 2e889ab8f0250f6cce3562150a7407e8699208f2 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 25 Apr 2023 18:23:40 +0200 Subject: [PATCH 21/80] Added ColorExtensions --- .../Classes/Extensions/ColorExtensions.cs | 45 +++++++++++++++++++ .../Classes/Extensions/ImageExtensions.cs | 44 ++++-------------- PCK-Studio/PckStudio.csproj | 1 + 3 files changed, 54 insertions(+), 36 deletions(-) create mode 100644 PCK-Studio/Classes/Extensions/ColorExtensions.cs diff --git a/PCK-Studio/Classes/Extensions/ColorExtensions.cs b/PCK-Studio/Classes/Extensions/ColorExtensions.cs new file mode 100644 index 00000000..bdc42897 --- /dev/null +++ b/PCK-Studio/Classes/Extensions/ColorExtensions.cs @@ -0,0 +1,45 @@ +using System; +using System.Drawing; +using System.Numerics; + +namespace PckStudio.Extensions +{ + internal static class ColorExtensions + { + /// + /// Normalizes the Color between 0.0 - 1.0 + /// + /// + public static Vector3 Normalize(this Color color) + { + return new Vector3(color.R / 255f, color.G / 255f, color.B / 255f); + } + + private static T Clamp(T value, T min, T max) where T : IComparable + { + if (value.CompareTo(min) < 0) return min; + if (value.CompareTo(max) > 0) return max; + return value; + } + + public static byte CalculateColorBlendValue(float source, float overlay, BlendMode blendType) + { + source = Clamp(source, 0.0f, 1.0f); + overlay = Clamp(overlay, 0.0f, 1.0f); + + float resultValue = blendType switch + { + BlendMode.Add => source + overlay, + BlendMode.Subtract => source - overlay, + BlendMode.Multiply => source * overlay, + BlendMode.Average => (source + overlay) / 2.0f, + BlendMode.AscendingOrder => source > overlay ? overlay : source, + BlendMode.DescendingOrder => source < overlay ? overlay : source, + BlendMode.Screen => 1f - (1f - source) * (1f - overlay), + _ => 0.0f + }; + return (byte)Clamp(resultValue * 255, 0, 255); + } + + } +} diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index cd4ce7a2..a41adb41 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -146,7 +146,7 @@ namespace PckStudio.Extensions return image; } - public static Image Blend(this Image image, Color foregroundColor, BlendMode mode) + public static Image Blend(this Image image, Color overlayColor, BlendMode mode) { if (image is not Bitmap baseImage) return image; @@ -157,15 +157,13 @@ namespace PckStudio.Extensions Marshal.Copy(baseImageData.Scan0, baseImageBuffer, 0, baseImageBuffer.Length); - float overlayR = foregroundColor.R / 255f; - float overlayG = foregroundColor.G / 255f; - float overlayB = foregroundColor.B / 255f; + var normalized = overlayColor.Normalize(); for (int k = 0; k < baseImageBuffer.Length; k += 4) { - baseImageBuffer[k + 0] = CalculateColorComponentBlendValue(baseImageBuffer[k + 0] / 255f, overlayR, mode); - baseImageBuffer[k + 1] = CalculateColorComponentBlendValue(baseImageBuffer[k + 1] / 255f, overlayG, mode); - baseImageBuffer[k + 2] = CalculateColorComponentBlendValue(baseImageBuffer[k + 2] / 255f, overlayB, mode); + baseImageBuffer[k + 0] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 0] / 255f, normalized.X, mode); + baseImageBuffer[k + 1] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 1] / 255f, normalized.Y, mode); + baseImageBuffer[k + 2] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 2] / 255f, normalized.Z, mode); } Bitmap bitmapResult = new Bitmap(baseImage.Width, baseImage.Height, PixelFormat.Format32bppArgb); @@ -200,9 +198,9 @@ namespace PckStudio.Extensions for (int k = 0; k < baseImageBuffer.Length && k < overlayImageBuffer.Length; k += 4) { - baseImageBuffer[k + 0] = CalculateColorComponentBlendValue(baseImageBuffer[k + 0] / 255f, overlayImageBuffer[k + 0] / 255f, mode); - baseImageBuffer[k + 1] = CalculateColorComponentBlendValue(baseImageBuffer[k + 1] / 255f, overlayImageBuffer[k + 1] / 255f, mode); - baseImageBuffer[k + 2] = CalculateColorComponentBlendValue(baseImageBuffer[k + 2] / 255f, overlayImageBuffer[k + 2] / 255f, mode); + baseImageBuffer[k + 0] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 0] / 255f, overlayImageBuffer[k + 0] / 255f, mode); + baseImageBuffer[k + 1] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 1] / 255f, overlayImageBuffer[k + 1] / 255f, mode); + baseImageBuffer[k + 2] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 2] / 255f, overlayImageBuffer[k + 2] / 255f, mode); } Bitmap bitmapResult = new Bitmap(baseImage.Width, baseImage.Height, PixelFormat.Format32bppArgb); @@ -216,31 +214,5 @@ namespace PckStudio.Extensions overlayImage.UnlockBits(overlayImageData); return bitmapResult; } - - private static T Clamp(T value, T min, T max) where T : IComparable - { - if (value.CompareTo(min) < 0) return min; - else if (value.CompareTo(max) > 0) return max; - else return value; - } - - private static byte CalculateColorComponentBlendValue(float source, float overlay, BlendMode blendType) - { - source = Clamp(source, 0.0f, 1.0f); - overlay = Clamp(overlay, 0.0f, 1.0f); - - float resultValue = blendType switch - { - BlendMode.Add => source + overlay, - BlendMode.Subtract => source - overlay, - BlendMode.Multiply => source * overlay, - BlendMode.Average => (source + overlay) / 2.0f, - BlendMode.AscendingOrder => source > overlay ? overlay : source, - BlendMode.DescendingOrder => source < overlay ? overlay : source, - BlendMode.Screen => 1f - (1f - source)*(1f - overlay), - _ => 0.0f - }; - return (byte)Clamp(resultValue * 255, 0, 255); - } } } diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 3b0cf3ee..3a7b7ebc 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -171,6 +171,7 @@ + From 35fb42ecaa4fc6b75e44dfaaf8f89087a6e0abf3 Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 19:29:24 -0400 Subject: [PATCH 22/80] Added a SkinBox class for multiple forms to use --- PCK-Studio/Classes/Models/SkinBox.cs | 61 ++++++++++++++++++++++++++++ PCK-Studio/PckStudio.csproj | 1 + 2 files changed, 62 insertions(+) create mode 100644 PCK-Studio/Classes/Models/SkinBox.cs diff --git a/PCK-Studio/Classes/Models/SkinBox.cs b/PCK-Studio/Classes/Models/SkinBox.cs new file mode 100644 index 00000000..91ae8241 --- /dev/null +++ b/PCK-Studio/Classes/Models/SkinBox.cs @@ -0,0 +1,61 @@ +using System; +using System.Numerics; +using System.Text.RegularExpressions; +using System.Windows.Forms; + +namespace PckStudio.Classes.Models +{ + public class SkinBox + { + public string Parent; + public Vector3 Pos; + public Vector3 Size; + public float U, V; + public bool HideWithArmor; + public bool Mirror; + public float Inflation; + public SkinBox(string input) + { + try + { + string[] arguments = Regex.Split(input, @"\s+"); // split by whitespace + + int old_length = arguments.Length - 1; + + Console.WriteLine($"Old length - {old_length}"); + + Array.Resize(ref arguments, 12); + + for (int x = 11; x > old_length; x--) + { + arguments[x] = "0"; // set any missing arguments to '0' + } + + Parent = arguments[0].ToUpper(); // just in case a box has all lower, the editor still parses correctly + + Pos = new Vector3(float.Parse(arguments[1]), float.Parse(arguments[2]), float.Parse(arguments[3])); + Size = new Vector3(float.Parse(arguments[4]), float.Parse(arguments[5]), float.Parse(arguments[6])); + U = float.Parse(arguments[7]); + V = float.Parse(arguments[8]); + HideWithArmor = Convert.ToBoolean(int.Parse(arguments[9])); + Mirror = Convert.ToBoolean(int.Parse(arguments[10])); + Inflation = float.Parse(arguments[11]); + } + catch (FormatException fex) + { + MessageBox.Show($"A Format Exception was thrown\nFailed to parse BOX value\n{fex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + catch (IndexOutOfRangeException iex) // this should be MUCH more rare now + { + MessageBox.Show($"A box paramater was out of range\nFailed to parse BOX value\n{iex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + catch (Exception ex) + { + Parent = string.Empty; + } + } + + } +} diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 3a7b7ebc..5d3cd260 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -187,6 +187,7 @@ + From ffbb8fa5783b4a39d0d87f9e394e6d624c0c48e3 Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 19:40:16 -0400 Subject: [PATCH 23/80] Colons are now removed when using the edit all entries function --- PCK-Studio/MainForm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index cb12fb4b..61a3c068 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -2179,7 +2179,7 @@ namespace PckStudio int idx = line.IndexOf(' '); if (idx == -1 || line.Length - 1 == idx) continue; - file.Properties.Add((line.Substring(0, idx), line.Substring(idx + 1))); + file.Properties.Add((line.Substring(0, idx).Replace(":", string.Empty), line.Substring(idx + 1))); } ReloadMetaTreeView(); if (IsSubPCKNode(node.FullPath)) RebuildSubPCK(node); From 455b266a6bf2b4c311c0a12a7d55b971cb033b0e Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 19:40:39 -0400 Subject: [PATCH 24/80] Box Editor now utilizes the new SkinBox class rather than its own --- PCK-Studio/Forms/Editor/BoxEditor.cs | 42 ++-------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/PCK-Studio/Forms/Editor/BoxEditor.cs b/PCK-Studio/Forms/Editor/BoxEditor.cs index a7972c68..f53e158a 100644 --- a/PCK-Studio/Forms/Editor/BoxEditor.cs +++ b/PCK-Studio/Forms/Editor/BoxEditor.cs @@ -1,7 +1,6 @@ using System; -using System.Numerics; -using System.Text.RegularExpressions; using System.Windows.Forms; +using PckStudio.Classes.Models; namespace PckStudio.Forms.Editor { @@ -9,50 +8,13 @@ namespace PckStudio.Forms.Editor { public string Result; - class BOX - { - public string Parent; - public Vector3 Pos; - public Vector3 Size; - public float U, V; - public bool HideWithArmor; - public bool Mirror; - public float Inflation; - public BOX(string input) - { - string[] arguments = Regex.Split(input, @"\s+"); - - try - { - Parent = arguments[0].ToUpper(); // just in case a box has all lower, the editor still parses correctly - Pos = new Vector3(float.Parse(arguments[1]), float.Parse(arguments[2]), float.Parse(arguments[3])); - Size = new Vector3(float.Parse(arguments[4]), float.Parse(arguments[5]), float.Parse(arguments[6])); - U = float.Parse(arguments[7]); - V = float.Parse(arguments[8]); - HideWithArmor = Convert.ToBoolean(int.Parse(arguments[9])); - Mirror = Convert.ToBoolean(int.Parse(arguments[10])); - Inflation = float.Parse(arguments[11]); - } - catch (IndexOutOfRangeException) - { - // This is normal as some box values can have less parameters but no more than 12 - return; - } - catch (Exception ex) - { - Parent = string.Empty; - } - } - - } - public BoxEditor(string inBOX, bool hasInflation) { InitializeComponent(); inflationUpDown.Enabled = hasInflation; - BOX box = new BOX(inBOX); + SkinBox box = new SkinBox(inBOX); if (string.IsNullOrEmpty(box.Parent) || !parentComboBox.Items.Contains(box.Parent)) { From 591e1ac5dc53aaa3a852bcd10f69d95fb94db109 Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 19:41:58 -0400 Subject: [PATCH 25/80] Fixed part and offset names in GenerateModel --- .../Forms/Skins-And-Textures/generateModel.cs | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index 2a87eeba..651dc56f 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -46,12 +46,23 @@ namespace PckStudio // 64x64 Overlay Parts "HEADWEAR", "JACKET", - "SHOULDER0", - "SHOULDER1", "SLEEVE0", "SLEEVE1", "PANTS0", "PANTS1", + "SOCK0", + "SOCK1", + + // Armor Parts + "HELMET", + "CHEST", + "SHOULDER0", + "SHOULDER1", + "WAIST", + "LEGGING0", + "LEGGING1", + "BOOT0", + "BOOT1", }; private static readonly string[] ValidModelOffsetTypes = new string[] @@ -67,11 +78,11 @@ namespace PckStudio // Armor Offsets "HELMET", "CHEST", + "WAIST", + "LEGGING0", + "LEGGING1", "BOOT0", "BOOT1", - "WAIST", - "PANTS0", - "PANTS1", "TOOL0", "TOOL1", From cd21ee80170d3d9e1d83c5dee2a76f4e16d21774 Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 19:42:22 -0400 Subject: [PATCH 26/80] Marked generateModel as obsolete --- PCK-Studio/Forms/Skins-And-Textures/generateModel.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index 651dc56f..d57b0e62 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -15,6 +15,7 @@ using OMI.Formats.Pck; namespace PckStudio { + [Obsolete] public partial class generateModel : MetroForm { PictureBox skinPreview; From de6f7e9f35a011cb4c7b811cf2292e504cec0e8a Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 19:48:46 -0400 Subject: [PATCH 27/80] Added ToProperty method to SkinBox --- PCK-Studio/Classes/Models/SkinBox.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PCK-Studio/Classes/Models/SkinBox.cs b/PCK-Studio/Classes/Models/SkinBox.cs index 91ae8241..eb27a7cf 100644 --- a/PCK-Studio/Classes/Models/SkinBox.cs +++ b/PCK-Studio/Classes/Models/SkinBox.cs @@ -7,13 +7,13 @@ namespace PckStudio.Classes.Models { public class SkinBox { - public string Parent; + public string Type; public Vector3 Pos; public Vector3 Size; public float U, V; public bool HideWithArmor; public bool Mirror; - public float Inflation; + public float Scale; public SkinBox(string input) { try @@ -31,7 +31,7 @@ namespace PckStudio.Classes.Models arguments[x] = "0"; // set any missing arguments to '0' } - Parent = arguments[0].ToUpper(); // just in case a box has all lower, the editor still parses correctly + Type = arguments[0].ToUpper(); // just in case a box has all lower, the editor still parses correctly Pos = new Vector3(float.Parse(arguments[1]), float.Parse(arguments[2]), float.Parse(arguments[3])); Size = new Vector3(float.Parse(arguments[4]), float.Parse(arguments[5]), float.Parse(arguments[6])); @@ -39,7 +39,7 @@ namespace PckStudio.Classes.Models V = float.Parse(arguments[8]); HideWithArmor = Convert.ToBoolean(int.Parse(arguments[9])); Mirror = Convert.ToBoolean(int.Parse(arguments[10])); - Inflation = float.Parse(arguments[11]); + Scale = float.Parse(arguments[11]); } catch (FormatException fex) { @@ -53,9 +53,14 @@ namespace PckStudio.Classes.Models } catch (Exception ex) { - Parent = string.Empty; + Type = string.Empty; } } + public ValueTuple ToProperty() + { + string value = $"{Type} {Pos.X} {Pos.Y} {Pos.Z} {Size.X} {Size.Y} {Size.Z} {U} {V} {HideWithArmor} {Mirror} {Scale}"; + return new ValueTuple("BOX", value.Replace(',', '.')); + } } } From 779a2bb655ec52a80798295d705b8cd3d8b5436a Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 20:01:15 -0400 Subject: [PATCH 28/80] Fixed member names in BoxEditor --- PCK-Studio/Forms/Editor/BoxEditor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PCK-Studio/Forms/Editor/BoxEditor.cs b/PCK-Studio/Forms/Editor/BoxEditor.cs index f53e158a..771f3bc6 100644 --- a/PCK-Studio/Forms/Editor/BoxEditor.cs +++ b/PCK-Studio/Forms/Editor/BoxEditor.cs @@ -16,12 +16,12 @@ namespace PckStudio.Forms.Editor SkinBox box = new SkinBox(inBOX); - if (string.IsNullOrEmpty(box.Parent) || !parentComboBox.Items.Contains(box.Parent)) + if (string.IsNullOrEmpty(box.Type) || !parentComboBox.Items.Contains(box.Type)) { throw new Exception("Failed to parse BOX value"); } - parentComboBox.SelectedItem = parentComboBox.Items[parentComboBox.Items.IndexOf(box.Parent)]; + parentComboBox.SelectedItem = parentComboBox.Items[parentComboBox.Items.IndexOf(box.Type)]; PosXUpDown.Value = (decimal)box.Pos.X; PosYUpDown.Value = (decimal)box.Pos.Y; PosZUpDown.Value = (decimal)box.Pos.Z; @@ -32,7 +32,7 @@ namespace PckStudio.Forms.Editor uvYUpDown.Value = (decimal)box.V; armorCheckBox.Checked = box.HideWithArmor; mirrorCheckBox.Checked = box.Mirror; - inflationUpDown.Value = (decimal)box.Inflation; + inflationUpDown.Value = (decimal)box.Scale; } private void saveButton_Click(object sender, EventArgs e) From 39171fb41a285053dfbbcaacf5bc739c74da7b7a Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 20:07:33 -0400 Subject: [PATCH 29/80] Replaced ModelPart class and added support for HD Skins --- .../Forms/Skins-And-Textures/generateModel.cs | 322 +++++++----------- 1 file changed, 127 insertions(+), 195 deletions(-) diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index d57b0e62..509f9551 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -4,12 +4,14 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Linq; +using System.Numerics; using System.Windows.Forms; using System.Collections; using System.IO; using Newtonsoft.Json; using MetroFramework.Forms; using PckStudio.Classes.FileTypes; +using PckStudio.Classes.Models; using System.Text.RegularExpressions; using OMI.Formats.Pck; @@ -89,39 +91,9 @@ namespace PckStudio "TOOL1", }; - List modelParts = new List(); + List modelBoxes = new List(); List modelOffsets = new List(); - class ModelPart - { - public string Type; - public float X, Y, Z; - public float Width; - public float Height; - public float Length; - public int U, V; - - public ModelPart(string type, float x, float y, float z, float width, float height, float length, int u, int v) - { - Type = type; - X = x; - Y = y; - Z = z; - Width = width; - Height = height; - Length = length; - U = u; - V = v; - } - - public ValueTuple ToProperty() - { - string value = $"{Type} {X} {Y} {Z} {Width} {Height} {Length} {U} {V}"; - return new ValueTuple("BOX", value.Replace(',', '.')); - } - - } - class ModelOffset { public string Name; @@ -164,56 +136,14 @@ namespace PckStudio { case "BOX": { - string[] Format = ReplaceWhitespace(property.Item2, ",").TrimEnd('\n', '\r', ' ').Split(','); - if (Format.Length < 9) - { - Console.WriteLine($"'{property.Item1}' property has too few arguments: {property.Item2}"); - continue; - } - string name = Format[0]; + SkinBox box = new SkinBox(property.Item2); + + string name = box.Type; if (ValidModelBoxTypes.Contains(name)) { - // %10ls = name - // %f - // %f - // %f - // %f - // %f - // %f - // %f - // %f - // %d - // %d - // %f - try - { - float x = float.Parse(Format[1]); - float y = float.Parse(Format[2]); - float z = float.Parse(Format[3]); - float sizeX = float.Parse(Format[4]); - float sizeY = float.Parse(Format[5]); - float sizeZ = float.Parse(Format[6]); - int u = int.Parse(Format[7]); - int v = int.Parse(Format[8]); - modelParts.Add(new ModelPart(name, x, y, z, sizeX, sizeY, sizeZ, u, v)); - } - catch (FormatException ex) - { - Console.WriteLine(ex.Message); - MessageBox.Show("A Format Exception was thrown\nFailed to parse BOX value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - catch (OverflowException ex) - { - Console.WriteLine(ex.Message); - MessageBox.Show("An Overflow Exception was thrown\nFailed to parse BOX value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - if (Format.Length >= 11) - { - string unk1 = Format[9]; - string unk2 = Format[10]; - Console.WriteLine($"{unk1} | {unk2}"); + modelBoxes.Add(box); } + comboParent.Enabled = true; break; } @@ -272,25 +202,28 @@ namespace PckStudio float legY = (displayBox.Height / 2) + 85; // -80; float groundLevel = (displayBox.Height / 2) + 145; graphics.DrawLine(Pens.White, 0, groundLevel, displayBox.Width, groundLevel); + float gfx_scale = texturePreview.Image.Width / 64; // used for displaying larger graphics properly; 64 is the base skin width for all models + // Chooses Render settings based on current direction foreach (ListViewItem listViewItem in listViewBoxes.Items) { - if (!(listViewItem.Tag is ModelPart)) continue; - ModelPart part = listViewItem.Tag as ModelPart; + if (!(listViewItem.Tag is SkinBox)) continue; + SkinBox part = listViewItem.Tag as SkinBox; float x = displayBox.Width / 2; float y = 0; + switch (direction) { case eViewDirection.front: { //Sets X & Y based on model part class // listViewItem.Text -> part.Type - // listViewItem.SubItems[1] -> part.X - // listViewItem.SubItems[2] -> part.Y - // listViewItem.SubItems[3] -> part.Z - // listViewItem.SubItems[4] -> part.Width - // listViewItem.SubItems[5] -> part.Height - // listViewItem.SubItems[6] -> part.Length + // listViewItem.SubItems[1] -> part.Pos.X + // listViewItem.SubItems[2] -> part.Pos.Y + // listViewItem.SubItems[3] -> part.Pos.Z + // listViewItem.SubItems[4] -> part.Size.X + // listViewItem.SubItems[5] -> part.Size.Y + // listViewItem.SubItems[6] -> part.Size.Z // listViewItem.SubItems[7] -> part.U // listViewItem.SubItems[8] -> part.V switch (part.Type) @@ -327,20 +260,19 @@ namespace PckStudio if (!checkTextureGenerate.Checked) { RectangleF destRect = new RectangleF( - x + part.X * 5, - y + part.Y * 5, - part.Width * 5, - part.Height * 5); + x + part.Pos.X * 5, + y + part.Pos.Y * 5, + part.Size.X * 5, + part.Size.Y * 5); RectangleF srcRect = new RectangleF( - part.U + part.Length, - part.V + part.Length, - part.Width, - part.Height); - graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); + (part.U + part.Size.Z) * gfx_scale, + (part.V + part.Size.Z) * gfx_scale, + part.Size.X * gfx_scale, + part.Size.Y * gfx_scale); } else { - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.X * 5, y + part.Y * 5, part.Width * 5, part.Height * 5); + graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.Pos.X * 5, y + part.Pos.Y * 5, part.Size.X * 5, part.Size.Y * 5); } break; @@ -380,21 +312,21 @@ namespace PckStudio if (!checkTextureGenerate.Checked) { RectangleF destRect = new RectangleF( - x + part.Z * 5, - y + part.Y * 5, - part.Length * 5, - part.Height * 5); + x + part.Pos.Z * 5, + y + part.Pos.Y * 5, + part.Size.Z * 5, + part.Size.Y * 5); RectangleF srcRect = new RectangleF( - part.U + part.Length + part.Width, - part.V + part.Length, - part.Length, - part.Height); + (part.U + part.Size.Z + part.Size.X) * gfx_scale, + (part.V + part.Size.Z) * gfx_scale, + part.Size.Z * gfx_scale, + part.Size.Y * gfx_scale); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); } else { //Draws Part - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.Z * 5, y + part.Y * 5, part.Length * 5, part.Height * 5); + graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.Pos.Z * 5, y + part.Pos.Y * 5, part.Size.Z * 5, part.Size.Y * 5); } bitmapModelPreview.RotateFlip(RotateFlipType.RotateNoneFlipX); break; @@ -433,21 +365,21 @@ namespace PckStudio if (!checkTextureGenerate.Checked) { RectangleF destRect = new RectangleF( - x + part.X * 5, - y + part.Y * 5, - part.Width * 5, - part.Height * 5); + x + part.Pos.X * 5, + y + part.Pos.Y * 5, + part.Size.X * 5, + part.Size.Y * 5); RectangleF srcRect = new RectangleF( - part.U + part.Length * 2 + part.Width, - part.V + part.Length, - part.Width, - part.Height); + (part.U + part.Size.Z * 2 + part.Size.X) * gfx_scale, + (part.V + part.Size.Z) * gfx_scale, + part.Size.X * gfx_scale, + part.Size.Y * gfx_scale); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); } else { //Draws Part - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.X * 5, y + part.Y * 5, part.Width * 5, part.Height * 5); + graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.Pos.X * 5, y + part.Pos.Y * 5, part.Size.X * 5, part.Size.Y * 5); } bitmapModelPreview.RotateFlip(RotateFlipType.RotateNoneFlipX); break; @@ -483,21 +415,21 @@ namespace PckStudio if (!checkTextureGenerate.Checked) { RectangleF destRect = new RectangleF( - x + part.Z * 5, - y + part.Y * 5, - part.Length * 5, - part.Height * 5); + x + part.Pos.Z * 5, + y + part.Pos.Y * 5, + part.Size.Z * 5, + part.Size.Y * 5); RectangleF srcRect = new RectangleF( - part.U + part.Length + part.Width, - part.V + part.Length, - part.Length, - part.Height); + (part.U + part.Size.Z + part.Size.X) * gfx_scale, + (part.V + part.Size.Z) * gfx_scale, + part.Size.Z * gfx_scale, + part.Size.Y * gfx_scale); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); } else { //Draws Part - graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.Z * 5, y + part.Y * 5, part.Length * 5, part.Height * 5); + graphics.FillRectangle(new SolidBrush(listViewItem.ForeColor), x + part.Pos.Z * 5, y + part.Pos.Y * 5, part.Size.Z * 5, part.Size.Y * 5); } break; } @@ -519,13 +451,13 @@ namespace PckStudio Bitmap bitmapAutoTexture = new Bitmap(texturePreview.Width, texturePreview.Height); using (Graphics graphics = Graphics.FromImage(bitmapAutoTexture)) { - foreach (var part in modelParts) + foreach (var part in modelBoxes) { - float width = part.Width * 2; - float height = part.Height * 2; - float length = part.Length * 2; - int u = part.U * 2; - int v = part.V * 2; + float width = part.Size.X * 2; + float height = part.Size.Y * 2; + float length = part.Size.Z * 2; + float u = part.U * 2; + float v = part.V * 2; Random r = new Random(); Brush brush = new SolidBrush(Color.FromArgb(r.Next(int.MinValue, int.MaxValue))); graphics.FillRectangle(brush, u + length, v, width, length); @@ -851,7 +783,7 @@ namespace PckStudio //Creates Item private void createToolStripMenuItem_Click(object sender, EventArgs e) { - modelParts.Add(new ModelPart("New Part", 0, 0, 0, 0, 0, 0, 0, 0)); + modelBoxes.Add(new SkinBox("NEW_BOX 0 0 0 1 1 1 0 0 0 0 0")); updateListView(); render(); } @@ -861,21 +793,21 @@ namespace PckStudio private void listView1_SelectedIndexChanged(object sender, EventArgs e) { changeColorToolStripMenuItem.Visible = false; - if (listViewBoxes.SelectedItems.Count != 0 && listViewBoxes.SelectedItems[0].Tag is ModelPart) + if (listViewBoxes.SelectedItems.Count != 0 && listViewBoxes.SelectedItems[0].Tag is SkinBox) { changeColorToolStripMenuItem.Visible = true; - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; //graphics.DrawRectangle(Pens.Yellow, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5 - 1, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5 - 1, (float)double.Parse(this.selected.SubItems[6].Text) * 5 + 2, (float)double.Parse(this.selected.SubItems[5].Text) * 5 + 2); //graphics.DrawRectangle(Pens.Black, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5, (float)double.Parse(this.selected.SubItems[6].Text) * 5, (float)double.Parse(this.selected.SubItems[5].Text) * 5); comboParent.Text = part.Type; - PosXUpDown.Value = (decimal)part.X; - PosYUpDown.Value = (decimal)part.Y; - PosZUpDown.Value = (decimal)part.Z; - SizeXUpDown.Value = (decimal)part.Width; - SizeYUpDown.Value = (decimal)part.Height; - SizeZUpDown.Value = (decimal)part.Length; - TextureXUpDown.Value = part.U; - TextureYUpDown.Value = part.V; + PosXUpDown.Value = (decimal)part.Pos.X; + PosYUpDown.Value = (decimal)part.Pos.Y; + PosZUpDown.Value = (decimal)part.Pos.Z; + SizeXUpDown.Value = (decimal)part.Size.X; + SizeYUpDown.Value = (decimal)part.Size.Y; + SizeZUpDown.Value = (decimal)part.Size.Z; + TextureXUpDown.Value = (decimal)part.U; + TextureYUpDown.Value = (decimal)part.V; render(); } } @@ -885,9 +817,9 @@ namespace PckStudio private void comboParent_SelectedIndexChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.Type = comboParent.Text; buttonIMPORT.Enabled = true; buttonEXPORT.Enabled = true; @@ -906,10 +838,10 @@ namespace PckStudio private void SizeXUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; - part.Width = (float)SizeXUpDown.Value; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; + part.Size.X = (float)SizeXUpDown.Value; } updateListView(); render(); @@ -918,10 +850,10 @@ namespace PckStudio private void SizeYUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; - part.Height = (float)SizeYUpDown.Value; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; + part.Size.Y = (float)SizeYUpDown.Value; } updateListView(); render(); @@ -930,10 +862,10 @@ namespace PckStudio private void SizeZUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; - part.Length = (float)SizeZUpDown.Value; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; + part.Size.Z = (float)SizeZUpDown.Value; } updateListView(); render(); @@ -942,10 +874,10 @@ namespace PckStudio private void PosXUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; - part.X = (float)PosXUpDown.Value; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; + part.Pos.X = (float)PosXUpDown.Value; } updateListView(); render(); @@ -955,10 +887,10 @@ namespace PckStudio private void PosYUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; - part.Y = (float)PosYUpDown.Value; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; + part.Pos.Y = (float)PosYUpDown.Value; } updateListView(); render(); @@ -968,10 +900,10 @@ namespace PckStudio private void PosZUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; - part.Z = (float)PosZUpDown.Value; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; + part.Pos.Z = (float)PosZUpDown.Value; } updateListView(); render(); @@ -1010,9 +942,9 @@ namespace PckStudio private void TextureXUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.U = (int)TextureXUpDown.Value; } updateListView(); @@ -1024,9 +956,9 @@ namespace PckStudio private void TextureYUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.V = (int)TextureXUpDown.Value; } updateListView(); @@ -1073,7 +1005,7 @@ namespace PckStudio private void buttonDone_Click(object sender, EventArgs e) { Bitmap bitmap1 = new Bitmap(displayBox.Width, displayBox.Height); - foreach (var part in modelParts) + foreach (var part in modelBoxes) { boxes.Add(part.ToProperty()); } @@ -1122,12 +1054,12 @@ namespace PckStudio //Loads in model template(Steve) private void buttonTemplate_Click(object sender, EventArgs e) { - modelParts.Add(new ModelPart("HEAD", -4, -8, -4, 8, 8, 8, 0, 0)); - modelParts.Add(new ModelPart("BODY", -4, 0, -2, 8, 12, 4, 16, 16)); - modelParts.Add(new ModelPart("ARM0", -3, -2, -2, 4, 12, 4, 40, 16)); - modelParts.Add(new ModelPart("ARM1", -1, -2, -2, 4, 12, 4, 40, 16)); - modelParts.Add(new ModelPart("LEG0", -2, 0, -2, 4, 12, 4, 0, 16)); - modelParts.Add(new ModelPart("LEG1", -2, 0, -2, 4, 12, 4, 0, 16)); + modelBoxes.Add(new SkinBox("HEAD -4 -8 -4 8 8 8 0 0 0 0 0")); + modelBoxes.Add(new SkinBox("BODY -4 0 -2 8 12 4 16 16 0 0 0")); + modelBoxes.Add(new SkinBox("ARM0 -3 -2 -2 4 12 4 40 16 0 0 0")); + modelBoxes.Add(new SkinBox("ARM1 -1 -2 -2 4 12 4 40 16 0 1 0")); + modelBoxes.Add(new SkinBox("LEG0 -2 0 -2 4 12 4 0 16 0 0 0")); + modelBoxes.Add(new SkinBox("LEG1 -2 0 -2 4 12 0 16 0 1 0")); comboParent.Enabled = true; updateListView(); render(); @@ -1136,16 +1068,16 @@ namespace PckStudio private void updateListView() { listViewBoxes.Items.Clear(); - foreach (var part in modelParts) + foreach (var part in modelBoxes) { ListViewItem listViewItem = new ListViewItem(part.Type); listViewItem.Tag = part; - listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.X.ToString())); - listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Y.ToString())); - listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Z.ToString())); - listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Width.ToString())); - listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Height.ToString())); - listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Length.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Pos.X.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Pos.Y.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Pos.Z.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Size.X.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Size.Y.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Size.Z.ToString())); listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.U.ToString())); listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.V.ToString())); listViewBoxes.Items.Add(listViewItem); @@ -1186,11 +1118,10 @@ namespace PckStudio listViewBoxes.Items.Clear(); string str1 = File.ReadAllText(openFileDialog.FileName); - modelParts.Clear(); + modelBoxes.Clear(); List lines = str1.Split(new[] { "\n\r", "\n" }, StringSplitOptions.None).ToList(); if (string.IsNullOrEmpty(lines[lines.Count - 1])) lines.RemoveAt(lines.Count - 1); - int currentLine = 0; int passedlines = 0; for (int i = 0; i < lines.Count;) { @@ -1202,11 +1133,12 @@ namespace PckStudio float SizeX = float.Parse(lines[6 + passedlines]); float SizeY = float.Parse(lines[7 + passedlines]); float SizeZ = float.Parse(lines[8 + passedlines]); - int UvX = int.Parse(lines[9 + passedlines]); - int UvY = int.Parse(lines[10 + passedlines]); + float UvX = float.Parse(lines[9 + passedlines]); + float UvY = float.Parse(lines[10 + passedlines]); passedlines += 11; i += 11; - modelParts.Add(new ModelPart(parent, PosX, PosY, PosZ, SizeX, SizeY, SizeZ, UvX, UvY)); + // CSM doesn't support armor, mirror, or scale values as far as I know of - May + modelBoxes.Add(new SkinBox($"{parent} {PosX} {PosY} {PosZ} {SizeX} {SizeY} {SizeZ} {UvX} {UvY} {false} {false} {0}")); } } comboParent.Enabled = true; @@ -1293,18 +1225,18 @@ namespace PckStudio private void listView1_Click(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && listViewBoxes.SelectedItems[0] != null && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - var part = listViewBoxes.SelectedItems[0].Tag as ModelPart; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; comboParent.Text = part.Type; - PosXUpDown.Value = (decimal)part.X; - PosYUpDown.Value = (decimal)part.Y; - PosZUpDown.Value = (decimal)part.Z; - SizeXUpDown.Value = (decimal)part.Width; - SizeYUpDown.Value = (decimal)part.Height; - SizeZUpDown.Value = (decimal)part.Length; - TextureXUpDown.Value = part.U; - TextureYUpDown.Value = part.V; + PosXUpDown.Value = (decimal)part.Pos.X; + PosYUpDown.Value = (decimal)part.Pos.Y; + PosZUpDown.Value = (decimal)part.Pos.Z; + SizeXUpDown.Value = (decimal)part.Size.X; + SizeYUpDown.Value = (decimal)part.Size.Y; + SizeZUpDown.Value = (decimal)part.Size.Z; + TextureXUpDown.Value = (decimal)part.U; + TextureYUpDown.Value = (decimal)part.V; SizeXUpDown.Enabled = true; SizeYUpDown.Enabled = true; SizeZUpDown.Enabled = true; @@ -1343,9 +1275,9 @@ namespace PckStudio private void delStuffUsingDelKey(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is ModelPart) + listViewBoxes.SelectedItems[0].Tag is SkinBox) { - if (modelParts.Remove(listViewBoxes.SelectedItems[0].Tag as ModelPart)) + if (modelBoxes.Remove(listViewBoxes.SelectedItems[0].Tag as SkinBox)) listViewBoxes.SelectedItems[0].Remove(); render(); } From ee562c2c932b255269af46a7c55a563bd181ea74 Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 20:09:04 -0400 Subject: [PATCH 30/80] ComboBox in GenerateModel now displays all box types --- PCK-Studio/Forms/Skins-And-Textures/generateModel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index 509f9551..d965f74b 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -119,6 +119,8 @@ namespace PckStudio skinPreview = preview; if (texturePreview.Image == null) texturePreview.Image = new Bitmap(64, 64); + comboParent.Items.Clear(); + ValidModelBoxTypes.ToList().ForEach(p => comboParent.Items.Add(p)); loadData(); } private static readonly Regex sWhitespace = new Regex(@"\s+"); From b434df93f43c281f363d8ef6801039c70ccd9746 Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 20:10:04 -0400 Subject: [PATCH 31/80] Added proper offset for all box types --- .../Forms/Skins-And-Textures/generateModel.cs | 106 ++++++++++++++---- 1 file changed, 87 insertions(+), 19 deletions(-) diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index d965f74b..ff525426 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -231,28 +231,44 @@ namespace PckStudio switch (part.Type) { case "HEAD": + case "HEADWEAR": + case "HELMET": y = headbodyY + int.Parse(offsetHead.Text) * 5; break; case "BODY": + case "JACKET": + case "CHEST": y = headbodyY + int.Parse(offsetBody.Text) * 5; break; case "ARM0": + case "SLEEVE0": + case "SHOULDER0": x -= 25; y = armY + int.Parse(offsetArms.Text) * 5; break; case "ARM1": + case "SLEEVE1": + case "SHOULDER1": x += 25; y = armY + int.Parse(offsetArms.Text) * 5; break; case "LEG0": + case "PANTS0": + case "SOCK0": + case "LEGGING0": + case "BOOT0": x -= 10; y = legY + int.Parse(offsetLegs.Text) * 5; break; case "LEG1": + case "PANTS1": + case "SOCK1": + case "LEGGING1": + case "BOOT1": x += 10; y = legY + int.Parse(offsetLegs.Text) * 5; break; @@ -286,27 +302,42 @@ namespace PckStudio switch (part.Type) { case "HEAD": - y = headbodyY + float.Parse(offsetHead.Text) * 5; + case "HEADWEAR": + case "HELMET": + y = headbodyY + int.Parse(offsetHead.Text) * 5; break; - case "BODY": - y = headbodyY + float.Parse(offsetBody.Text) * 5; + case "JACKET": + case "CHEST": + y = headbodyY + int.Parse(offsetBody.Text) * 5; break; case "ARM0": - y = armY + float.Parse(offsetArms.Text) * 5; + case "SLEEVE0": + case "SHOULDER0": + y = armY + int.Parse(offsetArms.Text) * 5; break; case "ARM1": - y = armY + float.Parse(offsetArms.Text) * 5; + case "SLEEVE1": + case "SHOULDER1": + y = armY + int.Parse(offsetArms.Text) * 5; break; case "LEG0": - y = legY + float.Parse(offsetLegs.Text) * 5; + case "PANTS0": + case "SOCK0": + case "LEGGING0": + case "BOOT0": + y = legY + int.Parse(offsetLegs.Text) * 5; break; case "LEG1": - y = legY + float.Parse(offsetLegs.Text) * 5; + case "PANTS1": + case "SOCK1": + case "LEGGING1": + case "BOOT1": + y = legY + int.Parse(offsetLegs.Text) * 5; break; } @@ -340,26 +371,46 @@ namespace PckStudio switch (part.Type) { case "HEAD": - y = headbodyY + float.Parse(offsetHead.Text) * 5; + case "HEADWEAR": + case "HELMET": + y = headbodyY + int.Parse(offsetHead.Text) * 5; break; case "BODY": - y = headbodyY + float.Parse(offsetBody.Text) * 5; + case "JACKET": + case "CHEST": + y = headbodyY + int.Parse(offsetBody.Text) * 5; break; + case "ARM0": + case "SLEEVE0": + case "SHOULDER0": x -= 25; - y = armY + float.Parse(offsetArms.Text) * 5; + y = armY + int.Parse(offsetArms.Text) * 5; break; + case "ARM1": + case "SLEEVE1": + case "SHOULDER1": x += 25; - y = armY + float.Parse(offsetArms.Text) * 5; + y = armY + int.Parse(offsetArms.Text) * 5; break; + case "LEG0": + case "PANTS0": + case "SOCK0": + case "LEGGING0": + case "BOOT0": x -= 10; - y = legY + float.Parse(offsetLegs.Text) * 5; + y = legY + int.Parse(offsetLegs.Text) * 5; break; + case "LEG1": + case "PANTS1": + case "SOCK1": + case "LEGGING1": + case "BOOT1": x += 10; - y = legY + float.Parse(offsetLegs.Text) * 5; + y = legY + int.Parse(offsetLegs.Text) * 5; break; } @@ -392,25 +443,42 @@ namespace PckStudio switch (part.Type) { case "HEAD": - y = headbodyY + float.Parse(offsetHead.Text) * 5; + case "HEADWEAR": + case "HELMET": + y = headbodyY + int.Parse(offsetHead.Text) * 5; break; case "BODY": - y = headbodyY + float.Parse(offsetBody.Text) * 5; + case "JACKET": + case "CHEST": + y = headbodyY + int.Parse(offsetBody.Text) * 5; break; case "ARM0": - y = armY + float.Parse(offsetArms.Text) * 5; + case "SLEEVE0": + case "SHOULDER0": + y = armY + int.Parse(offsetArms.Text) * 5; break; + case "ARM1": - y = armY + float.Parse(offsetArms.Text) * 5; + case "SLEEVE1": + case "SHOULDER1": + y = armY + int.Parse(offsetArms.Text) * 5; break; case "LEG0": - y = legY + float.Parse(offsetLegs.Text) * 5; + case "PANTS0": + case "SOCK0": + case "LEGGING0": + case "BOOT0": + y = legY + int.Parse(offsetLegs.Text) * 5; break; case "LEG1": - y = legY + float.Parse(offsetLegs.Text) * 5; + case "PANTS1": + case "SOCK1": + case "LEGGING1": + case "BOOT1": + y = legY + int.Parse(offsetLegs.Text) * 5; break; } //Maps imported Texture if auto texture is disabled From 29910b803ac1b700a903381423abdcc61138b950 Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 20:31:28 -0400 Subject: [PATCH 32/80] Expanded valid skin check for import function --- .../Forms/Skins-And-Textures/generateModel.cs | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index ff525426..fdb4a891 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -1056,18 +1056,29 @@ namespace PckStudio OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "PNG Image Files | *.png"; openFileDialog.Title = "Select Skin Texture"; - if (openFileDialog.ShowDialog() == DialogResult.OK && Image.FromFile(openFileDialog.FileName).Width == Image.FromFile(openFileDialog.FileName).Height) + + if (openFileDialog.ShowDialog() == DialogResult.OK) // skins can only be a 1:1 ratio (base 64x64) or a 2:1 ratio (base 64x32) { - checkTextureGenerate.Checked = false; - Bitmap bitmap = new Bitmap(64, 64); - using (Graphics graphics = Graphics.FromImage(bitmap)) - { - graphics.DrawImage(Image.FromFile(openFileDialog.FileName), 0, 0, 64, 64); - graphics.InterpolationMode = InterpolationMode.NearestNeighbor; + using (var img = Image.FromFile(openFileDialog.FileName)) + { + if ((img.Width == img.Height || img.Height == img.Width / 2)) + { + checkTextureGenerate.Checked = false; + Bitmap bitmap = new Bitmap(img.Width, img.Width); + using (Graphics graphics = Graphics.FromImage(bitmap)) + { + graphics.DrawImage(img, 0, 0, img.Width, img.Height); + graphics.InterpolationMode = InterpolationMode.NearestNeighbor; + } + texturePreview.Image = bitmap; + render(); + } + else + { + MessageBox.Show(this, "Not a valid skin file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } - texturePreview.Image = bitmap; } - render(); } From 518f07768245106f73869215d83801e6d3874f71 Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 20:49:51 -0400 Subject: [PATCH 33/80] Fixed error with the generator template --- PCK-Studio/Forms/Skins-And-Textures/generateModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index fdb4a891..9123feec 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -1140,7 +1140,7 @@ namespace PckStudio modelBoxes.Add(new SkinBox("ARM0 -3 -2 -2 4 12 4 40 16 0 0 0")); modelBoxes.Add(new SkinBox("ARM1 -1 -2 -2 4 12 4 40 16 0 1 0")); modelBoxes.Add(new SkinBox("LEG0 -2 0 -2 4 12 4 0 16 0 0 0")); - modelBoxes.Add(new SkinBox("LEG1 -2 0 -2 4 12 0 16 0 1 0")); + modelBoxes.Add(new SkinBox("LEG1 -2 0 -2 4 12 4 0 16 0 1 0")); comboParent.Enabled = true; updateListView(); render(); From 2650e115df94422c21c52d06625300f447d8050b Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 20:56:42 -0400 Subject: [PATCH 34/80] GenerateModel now uses the texture immediately --- .../Forms/Skins-And-Textures/addnewskin.cs | 6 +---- .../generateModel.Designer.cs | 10 ++++----- .../Forms/Skins-And-Textures/generateModel.cs | 11 ++++------ .../Skins-And-Textures/generateModel.resx | 22 +++++++++---------- PCK-Studio/MainForm.cs | 2 +- 5 files changed, 21 insertions(+), 30 deletions(-) diff --git a/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs b/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs index 76a66e8c..1216142c 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs @@ -283,14 +283,10 @@ namespace PckStudio if (MessageBox.Show("Create your own custom skin model?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) != DialogResult.Yes) return; - PictureBox preview = new PictureBox(); //Creates new picture for generated model preview - generateModel generate = new generateModel(generatedModel, preview); + generateModel generate = new generateModel(generatedModel, Properties.Resources.classic_template); if (generate.ShowDialog() == DialogResult.OK) //Opens Model Generator Dialog { - //comboBoxSkinType.Items.Add("Custom"); //Adds skin preset to combobox - //comboBoxSkinType.Text = "Custom"; //Sets combo to custom preset - displayBox.Image = preview.Image; //Sets displayBox to created model preview try { using (FileStream stream = File.OpenRead(Application.StartupPath + "\\temp.png")) diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.Designer.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.Designer.cs index d4ce7f7c..4d0b3833 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.Designer.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.Designer.cs @@ -370,8 +370,6 @@ // checkTextureGenerate // resources.ApplyResources(this.checkTextureGenerate, "checkTextureGenerate"); - this.checkTextureGenerate.Checked = true; - this.checkTextureGenerate.CheckState = System.Windows.Forms.CheckState.Checked; this.checkTextureGenerate.Name = "checkTextureGenerate"; this.checkTextureGenerate.Theme = MetroFramework.MetroThemeStyle.Dark; this.checkTextureGenerate.UseSelectable = true; @@ -503,13 +501,13 @@ // resources.ApplyResources(this.Z, "Z"); // - // Width + // _Width // - resources.ApplyResources(this._Width, "Width"); + resources.ApplyResources(this._Width, "_Width"); // - // Height + // _Height // - resources.ApplyResources(this._Height, "Height"); + resources.ApplyResources(this._Height, "_Height"); // // Length // diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index 9123feec..c320f46f 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -10,7 +10,6 @@ using System.Collections; using System.IO; using Newtonsoft.Json; using MetroFramework.Forms; -using PckStudio.Classes.FileTypes; using PckStudio.Classes.Models; using System.Text.RegularExpressions; using OMI.Formats.Pck; @@ -20,7 +19,7 @@ namespace PckStudio [Obsolete] public partial class generateModel : MetroForm { - PictureBox skinPreview; + PictureBox skinPreview = new PictureBox(); eViewDirection direction = eViewDirection.front; @@ -111,14 +110,11 @@ namespace PckStudio } } - - public generateModel(PckFile.PCKProperties skinProperties, PictureBox preview) + public generateModel(PckFile.PCKProperties skinProperties, Image texture) { InitializeComponent(); boxes = skinProperties; - skinPreview = preview; - if (texturePreview.Image == null) - texturePreview.Image = new Bitmap(64, 64); + texturePreview.Image = texture; comboParent.Items.Clear(); ValidModelBoxTypes.ToList().ForEach(p => comboParent.Items.Add(p)); loadData(); @@ -287,6 +283,7 @@ namespace PckStudio (part.V + part.Size.Z) * gfx_scale, part.Size.X * gfx_scale, part.Size.Y * gfx_scale); + graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); } else { diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.resx b/PCK-Studio/Forms/Skins-And-Textures/generateModel.resx index 5c44268a..e5da709a 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.resx +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.resx @@ -610,7 +610,7 @@ myTablePanel2 - PckStudio.Forms.MyTablePanel, PCK-Studio, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tabPage1 @@ -1413,16 +1413,16 @@ 30 - + Width - + Center - + Height - + Center @@ -3267,16 +3267,16 @@ System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Width + + _Width - + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Height + + _Height - + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 61a3c068..9a3426fc 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -424,7 +424,7 @@ namespace PckStudio { if (file.Properties.HasProperty("BOX")) { - using (generateModel generate = new generateModel(file.Properties, new PictureBox())) + using (generateModel generate = new generateModel(file.Properties, Image.FromStream(new MemoryStream(file.Data)))) if (generate.ShowDialog() == DialogResult.OK) { entryDataTextBox.Text = entryTypeTextBox.Text = string.Empty; From de52230aaa8e29d4516ac16b495180e076ad8adb Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 21:05:43 -0400 Subject: [PATCH 35/80] Removed console stuff --- PCK-Studio/Classes/Models/SkinBox.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/PCK-Studio/Classes/Models/SkinBox.cs b/PCK-Studio/Classes/Models/SkinBox.cs index eb27a7cf..40474734 100644 --- a/PCK-Studio/Classes/Models/SkinBox.cs +++ b/PCK-Studio/Classes/Models/SkinBox.cs @@ -22,8 +22,6 @@ namespace PckStudio.Classes.Models int old_length = arguments.Length - 1; - Console.WriteLine($"Old length - {old_length}"); - Array.Resize(ref arguments, 12); for (int x = 11; x > old_length; x--) From f772711eef221e848d79e9409db94bbfdc8d83cd Mon Sep 17 00:00:00 2001 From: MattNL Date: Tue, 25 Apr 2023 21:15:16 -0400 Subject: [PATCH 36/80] Fixed HD 64x32 skins not working in the Add Skin form --- PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs b/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs index 1216142c..b45db1c7 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs @@ -87,7 +87,7 @@ namespace PckStudio //comboBoxSkinType.Text = "Steve (64x64)"; skinType = eSkinType._64x64HD; } - else if (img.Width == img.Height / 2) // 64x32 HD + else if (img.Height == img.Width / 2) // 64x32 HD { anim.SetFlag(ANIM_EFFECTS.RESOLUTION_64x64, false); anim.SetFlag(ANIM_EFFECTS.SLIM_MODEL, false); From 0b697e92bb2fc58c5c988af6325e5bcc6efc5310 Mon Sep 17 00:00:00 2001 From: MattNL Date: Wed, 26 Apr 2023 09:01:37 -0400 Subject: [PATCH 37/80] Added missing (duplicate?) armor names Some 4J skins use these names but the ones prior work the same. Adding them just in case. --- .../Forms/Skins-And-Textures/generateModel.cs | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index c320f46f..f5ea6374 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -50,6 +50,7 @@ namespace PckStudio "JACKET", "SLEEVE0", "SLEEVE1", + "WAIST", "PANTS0", "PANTS1", "SOCK0", @@ -57,10 +58,10 @@ namespace PckStudio // Armor Parts "HELMET", - "CHEST", - "SHOULDER0", - "SHOULDER1", - "WAIST", + "CHEST", "BODYARMOR", + "SHOULDER0", "ARMARMOR0", + "SHOULDER1", "ARMARMOR0", + "BELT", "LEGGING0", "LEGGING1", "BOOT0", @@ -79,8 +80,10 @@ namespace PckStudio // Armor Offsets "HELMET", - "CHEST", - "WAIST", + "CHEST", "BODYARMOR", + "SHOULDER0", "ARMARMOR0", + "SHOULDER1", "ARMARMOR0", + "BELT", "LEGGING0", "LEGGING1", "BOOT0", @@ -234,10 +237,14 @@ namespace PckStudio case "BODY": case "JACKET": case "CHEST": + case "BODYARMOR": + case "BELT": + case "WAIST": y = headbodyY + int.Parse(offsetBody.Text) * 5; break; case "ARM0": + case "ARMARMOR0": case "SLEEVE0": case "SHOULDER0": x -= 25; @@ -245,6 +252,7 @@ namespace PckStudio break; case "ARM1": + case "ARMARMOR1": case "SLEEVE1": case "SHOULDER1": x += 25; @@ -306,16 +314,21 @@ namespace PckStudio case "BODY": case "JACKET": case "CHEST": + case "BODYARMOR": + case "BELT": + case "WAIST": y = headbodyY + int.Parse(offsetBody.Text) * 5; break; case "ARM0": + case "ARMARMOR0": case "SLEEVE0": case "SHOULDER0": y = armY + int.Parse(offsetArms.Text) * 5; break; case "ARM1": + case "ARMARMOR1": case "SLEEVE1": case "SHOULDER1": y = armY + int.Parse(offsetArms.Text) * 5; @@ -375,10 +388,14 @@ namespace PckStudio case "BODY": case "JACKET": case "CHEST": + case "BODYARMOR": + case "BELT": + case "WAIST": y = headbodyY + int.Parse(offsetBody.Text) * 5; break; case "ARM0": + case "ARMARMOR0": case "SLEEVE0": case "SHOULDER0": x -= 25; @@ -386,6 +403,7 @@ namespace PckStudio break; case "ARM1": + case "ARMARMOR1": case "SLEEVE1": case "SHOULDER1": x += 25; @@ -447,16 +465,21 @@ namespace PckStudio case "BODY": case "JACKET": case "CHEST": + case "BODYARMOR": + case "BELT": + case "WAIST": y = headbodyY + int.Parse(offsetBody.Text) * 5; break; case "ARM0": + case "ARMARMOR0": case "SLEEVE0": case "SHOULDER0": y = armY + int.Parse(offsetArms.Text) * 5; break; case "ARM1": + case "ARMARMOR1": case "SLEEVE1": case "SHOULDER1": y = armY + int.Parse(offsetArms.Text) * 5; From 95664ad003a669091c63f3a6cd2e2ff6c8b4a046 Mon Sep 17 00:00:00 2001 From: MattNL Date: Wed, 26 Apr 2023 09:04:04 -0400 Subject: [PATCH 38/80] Fixed SkinBox not converting bool to int --- PCK-Studio/Classes/Models/SkinBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCK-Studio/Classes/Models/SkinBox.cs b/PCK-Studio/Classes/Models/SkinBox.cs index 40474734..e27587cd 100644 --- a/PCK-Studio/Classes/Models/SkinBox.cs +++ b/PCK-Studio/Classes/Models/SkinBox.cs @@ -57,7 +57,7 @@ namespace PckStudio.Classes.Models public ValueTuple ToProperty() { - string value = $"{Type} {Pos.X} {Pos.Y} {Pos.Z} {Size.X} {Size.Y} {Size.Z} {U} {V} {HideWithArmor} {Mirror} {Scale}"; + string value = $"{Type} {Pos.X} {Pos.Y} {Pos.Z} {Size.X} {Size.Y} {Size.Z} {U} {V} {Convert.ToInt32(HideWithArmor)} {Convert.ToInt32(Mirror)} {Scale}"; return new ValueTuple("BOX", value.Replace(',', '.')); } } From d5a3d8fee4cf64adb847fd1eef148f8dcf23e7cf Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 26 Apr 2023 15:10:40 +0200 Subject: [PATCH 39/80] Update OMI-Lib commit ref to fix save issue iun loc editor --- Vendor/OMI-Lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vendor/OMI-Lib b/Vendor/OMI-Lib index 806fde8e..b5285431 160000 --- a/Vendor/OMI-Lib +++ b/Vendor/OMI-Lib @@ -1 +1 @@ -Subproject commit 806fde8e511de473b885fd7e7311e6f05c05ef47 +Subproject commit b52854318373efaa39f7c480c2b84a9f8d62a495 From 406dbc3ab0499884d701e0ffc2865c8c95b34698 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 29 Apr 2023 15:46:41 +0200 Subject: [PATCH 40/80] ImageExtensions.cs - Update 'ImageLayoutInfo' and fixed issue in 'CombineImages' --- .../Classes/Extensions/ImageExtensions.cs | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index a41adb41..9037fa2d 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -28,9 +28,27 @@ namespace PckStudio.Extensions public ImageLayoutInfo(int width, int height, int index, ImageLayoutDirection layoutDirection) { - bool horizontal = layoutDirection == ImageLayoutDirection.Horizontal; - SectionSize = horizontal ? new Size(width, width) : new Size(height, height); - SectionPoint = horizontal ? new Point(0, index * width) : new Point(index * height, 0); + switch(layoutDirection) + { + case ImageLayoutDirection.Horizontal: + { + SectionSize = new Size(height,height); + SectionPoint = new Point(index * height, 0); + } + break; + + case ImageLayoutDirection.Vertical: + { + SectionSize = new Size(width, width); + SectionPoint = new Point(0, index * width); + } + break; + + default: + SectionSize = Size.Empty; + SectionPoint = new Point(-1, -1); + break; + } SectionArea = new Rectangle(SectionPoint, SectionSize); } } @@ -86,7 +104,7 @@ namespace PckStudio.Extensions { foreach (var (i, texture) in sources.enumerate()) { - var info = new ImageLayoutInfo(imageSize.Width, imageSize.Height, i, layoutDirection); + var info = new ImageLayoutInfo(texture.Width, texture.Height, i, layoutDirection); graphic.DrawImage(texture, info.SectionPoint); }; } From 92bc2a20ea8124d690ebbd57da9c14ce7a54c8d7 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 29 Apr 2023 15:48:30 +0200 Subject: [PATCH 41/80] AnimationEditor.cs - Fixed 'CreateImageList' having wrong 'ImageLayoutDirection' when parsing frame textures --- PCK-Studio/Forms/Editor/AnimationEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCK-Studio/Forms/Editor/AnimationEditor.cs b/PCK-Studio/Forms/Editor/AnimationEditor.cs index b538538b..06970be2 100644 --- a/PCK-Studio/Forms/Editor/AnimationEditor.cs +++ b/PCK-Studio/Forms/Editor/AnimationEditor.cs @@ -49,7 +49,7 @@ namespace PckStudio.Forms.Editor using MemoryStream textureMem = new MemoryStream(animationFile.Data); var texture = new Bitmap(textureMem); - var frameTextures = texture.CreateImageList(ImageLayoutDirection.Horizontal); + var frameTextures = texture.CreateImageList(ImageLayoutDirection.Vertical); currentAnimation = animationFile.Properties.HasProperty("ANIM") ? new Animation(frameTextures, animationFile.Properties.GetPropertyValue("ANIM")) From 1db7e49b05f7e2a509072f4e79f09e7f3e412e5e Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 29 Apr 2023 15:50:44 +0200 Subject: [PATCH 42/80] Network.cs, Update.cs - Marked as Obsolete --- PCK-Studio/Classes/Networking/Network.cs | 1 + PCK-Studio/Classes/Networking/Update.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/PCK-Studio/Classes/Networking/Network.cs b/PCK-Studio/Classes/Networking/Network.cs index 2b232564..f35575ac 100644 --- a/PCK-Studio/Classes/Networking/Network.cs +++ b/PCK-Studio/Classes/Networking/Network.cs @@ -5,6 +5,7 @@ using System.Windows.Forms; namespace PckStudio.Classes.Networking { + [Obsolete] class Network { public static string Version = Application.ProductVersion; diff --git a/PCK-Studio/Classes/Networking/Update.cs b/PCK-Studio/Classes/Networking/Update.cs index 7c674e9d..4813ae45 100644 --- a/PCK-Studio/Classes/Networking/Update.cs +++ b/PCK-Studio/Classes/Networking/Update.cs @@ -7,6 +7,7 @@ using System.Windows.Forms; namespace PckStudio.Classes.Networking { + [Obsolete] public enum UpdateResult { // Base Failure value @@ -19,6 +20,7 @@ namespace PckStudio.Classes.Networking UpdateFailure, } + [Obsolete] class UpdateOptions { public bool IsBeta { get; set; } @@ -45,6 +47,7 @@ namespace PckStudio.Classes.Networking } } + [Obsolete] static class Update { public static UpdateResult CheckForUpdate(UpdateOptions options) From f75b58a1ef9c36ac49a1ac8762e6b4bfdb001fe4 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 29 Apr 2023 17:34:09 +0200 Subject: [PATCH 43/80] ColorExtensions.cs - Renamed 'CalculateColorBlendValue' to 'BlendValues' --- PCK-Studio/Classes/Extensions/ColorExtensions.cs | 2 +- PCK-Studio/Classes/Extensions/ImageExtensions.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PCK-Studio/Classes/Extensions/ColorExtensions.cs b/PCK-Studio/Classes/Extensions/ColorExtensions.cs index bdc42897..e2bb0ed7 100644 --- a/PCK-Studio/Classes/Extensions/ColorExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ColorExtensions.cs @@ -22,7 +22,7 @@ namespace PckStudio.Extensions return value; } - public static byte CalculateColorBlendValue(float source, float overlay, BlendMode blendType) + public static byte BlendValues(float source, float overlay, BlendMode blendType) { source = Clamp(source, 0.0f, 1.0f); overlay = Clamp(overlay, 0.0f, 1.0f); diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Classes/Extensions/ImageExtensions.cs index 9037fa2d..10820471 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Classes/Extensions/ImageExtensions.cs @@ -179,9 +179,9 @@ namespace PckStudio.Extensions for (int k = 0; k < baseImageBuffer.Length; k += 4) { - baseImageBuffer[k + 0] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 0] / 255f, normalized.X, mode); - baseImageBuffer[k + 1] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 1] / 255f, normalized.Y, mode); - baseImageBuffer[k + 2] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 2] / 255f, normalized.Z, mode); + baseImageBuffer[k + 0] = ColorExtensions.BlendValues(baseImageBuffer[k + 0] / 255f, normalized.X, mode); + baseImageBuffer[k + 1] = ColorExtensions.BlendValues(baseImageBuffer[k + 1] / 255f, normalized.Y, mode); + baseImageBuffer[k + 2] = ColorExtensions.BlendValues(baseImageBuffer[k + 2] / 255f, normalized.Z, mode); } Bitmap bitmapResult = new Bitmap(baseImage.Width, baseImage.Height, PixelFormat.Format32bppArgb); @@ -216,9 +216,9 @@ namespace PckStudio.Extensions for (int k = 0; k < baseImageBuffer.Length && k < overlayImageBuffer.Length; k += 4) { - baseImageBuffer[k + 0] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 0] / 255f, overlayImageBuffer[k + 0] / 255f, mode); - baseImageBuffer[k + 1] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 1] / 255f, overlayImageBuffer[k + 1] / 255f, mode); - baseImageBuffer[k + 2] = ColorExtensions.CalculateColorBlendValue(baseImageBuffer[k + 2] / 255f, overlayImageBuffer[k + 2] / 255f, mode); + baseImageBuffer[k + 0] = ColorExtensions.BlendValues(baseImageBuffer[k + 0] / 255f, overlayImageBuffer[k + 0] / 255f, mode); + baseImageBuffer[k + 1] = ColorExtensions.BlendValues(baseImageBuffer[k + 1] / 255f, overlayImageBuffer[k + 1] / 255f, mode); + baseImageBuffer[k + 2] = ColorExtensions.BlendValues(baseImageBuffer[k + 2] / 255f, overlayImageBuffer[k + 2] / 255f, mode); } Bitmap bitmapResult = new Bitmap(baseImage.Width, baseImage.Height, PixelFormat.Format32bppArgb); From 1420f8a4916748e47fbd7ec05669fe61610b01db Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 29 Apr 2023 19:14:06 +0200 Subject: [PATCH 44/80] Binka.cs - Implemented 'ToWav' properly --- .gitmodules | 3 + PCK-Studio/Classes/FileTypes/Binka.cs | 140 ++--- PCK-Studio/Classes/Misc/FileCacher.cs | 51 ++ .../Forms/Editor/AudioEditor.Designer.cs | 545 +++++++++--------- PCK-Studio/Forms/Editor/AudioEditor.resx | 150 ++--- PCK-Studio/PckStudio.csproj | 5 + PCK_Studio.sln | 15 + Vendor/SharpMss32 | 1 + 8 files changed, 468 insertions(+), 442 deletions(-) create mode 100644 PCK-Studio/Classes/Misc/FileCacher.cs create mode 160000 Vendor/SharpMss32 diff --git a/.gitmodules b/.gitmodules index ded44002..39456fd0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "OMI-Lib"] path = Vendor/OMI-Lib url = https://github.com/PhoenixARC/-OMI-Filetype-Library.git +[submodule "Vendor/SharpMss32"] + path = Vendor/SharpMss32 + url = https://github.com/NessieHax/SharpMss32.git diff --git a/PCK-Studio/Classes/FileTypes/Binka.cs b/PCK-Studio/Classes/FileTypes/Binka.cs index 67e731dc..26776e15 100644 --- a/PCK-Studio/Classes/FileTypes/Binka.cs +++ b/PCK-Studio/Classes/FileTypes/Binka.cs @@ -2,43 +2,22 @@ using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; +using System.Web.Caching; +using PckStudio.Classes.Misc; +using SharpMSS; namespace PckStudio.Classes { internal static class Binka { - private class LibHandle - { - [DllImport("kernel32.dll")] - public static extern IntPtr LoadLibrary(string lpFileName); - - [DllImport("kernel32.dll")] - public static extern int FreeLibrary(IntPtr library); - - private IntPtr libHandle; - - public IntPtr Handle => libHandle; - - public LibHandle(string libraryPath) - { - libHandle = LoadLibrary(libraryPath); - } - - ~LibHandle() - { - FreeLibrary(libHandle); - } - } - - private static string dataCache = Program.AppDataCache; - - public static uint LastAILErrorCode = 0xffffffff; + private static FileCacher cacher = new FileCacher(Program.AppDataCache); public static int FromWav(string inputFilepath, string outputFilepath, int compressionLevel) { - var process = Process.Start(new ProcessStartInfo + cacher.Cache(Properties.Resources.binka_encode, "binka_encode.exe"); + var process = Process.Start(new ProcessStartInfo { - FileName = GetAndCacheResource("binka_encode.exe"), + FileName = cacher.GetCachedFilepath("binka_encode.exe"), Arguments = $"\"{inputFilepath}\" \"{outputFilepath}\" -s -b{compressionLevel}", UseShellExecute = true, CreateNoWindow = true, @@ -48,94 +27,45 @@ namespace PckStudio.Classes return process.ExitCode; } - public static unsafe void ToWav(string inputFilename, string outputFilepath) + public static void ToWav(string inputFilepath, string outputFilepath) { - // handle should be closed when function gets out of scope - LibHandle mss32LibHandle = new LibHandle(GetAndCacheResource("mss32.dll")); - - string ext = Path.GetExtension(inputFilename).ToLower(); - switch (ext) + if (!inputFilepath.EndsWith(".binka")) { - case ".binka": - case ".wav": - break; - default: - throw new NotSupportedException(nameof(ext)+":"+ext); + throw new Exception("Not a Bink Audio file."); } - string outputDirectory = Path.GetDirectoryName(outputFilepath); - Directory.CreateDirectory(outputDirectory); - string destinationFilepath = Path.Combine(outputDirectory, Path.GetFileName(inputFilename)); - byte[] inputFiledata = File.ReadAllBytes(inputFilename); - Debug.WriteLine($"{nameof(inputFiledata)}: {inputFiledata.Length}"); + cacher.Cache(Properties.Resources.mss32, "mss32.dll"); + cacher.Cache(Properties.Resources.binkawin, "binkawin.asi"); - AILInternalCalls.SetRedistDirectory("."); - AILInternalCalls.Startup(); // __fastcall + LibHandle mss32LibHandle = new LibHandle(cacher.GetCachedFilepath("mss32.dll")); + + string destinationFilepath = Path.Combine( + Path.GetDirectoryName(outputFilepath), + Path.GetFileNameWithoutExtension(inputFilepath) + ".wav"); + + AILAPI.SetRedistDirectory(cacher.CacheDirectory.Replace('\\', '/')); + + RIBAPI.LoadApplicationProviders("*.asi"); + + byte[] inputFiledata = File.ReadAllBytes(inputFilepath); int resultBufferSize = 0; IntPtr resultBuffer = new IntPtr(); - // crash happens in AIL_decompress_ASI - LastAILErrorCode = (uint)AILInternalCalls.DecompressASI(inputFiledata, inputFiledata.Length, ".binka", resultBuffer, &resultBufferSize); - Debug.WriteLine("AIL Error Code: " + LastAILErrorCode.ToString()); + if (AILAPI.DecompressASI(inputFiledata, inputFiledata.Length, ".binka", ref resultBuffer, ref resultBufferSize, null) == 0) + { + Console.WriteLine(AILAPI.GetLastError()); + return; + } byte[] buffer = new byte[resultBufferSize]; Marshal.Copy(resultBuffer, buffer, 0, resultBufferSize); - AILInternalCalls.MemFreeLock(resultBuffer); - AILInternalCalls.Shutdown(); - File.WriteAllBytes(destinationFilepath, buffer); - } + + AILAPI.MemFreeLock(resultBuffer); + RIBAPI.FreeProviderLibrary(0); // free all loaded providers + AILAPI.Shutdown(); - // Move to a cache class ? - private static string GetAndCacheResource(string resourceName) - { - _ = resourceName ?? throw new ArgumentNullException(nameof(resourceName)); - string destinationFilepath = Path.Combine(dataCache, resourceName); - if (!File.Exists(destinationFilepath)) - { - byte[] resourceData = ExtractResource(resourceName); - using (FileStream fsDst = File.OpenWrite(destinationFilepath)) - { - fsDst.Write(resourceData, 0, resourceData.Length); - } - } - return destinationFilepath; - } + File.WriteAllBytes(destinationFilepath, buffer); - internal static byte[] ExtractResource(string resourceName) - { - byte[] resourceData = (byte[])Properties.Resources.ResourceManager.GetObject(Path.GetFileNameWithoutExtension(resourceName)); - return resourceData; - } - - private class AILInternalCalls - { - public delegate int AIL_decomp_func(); - - [DllImport("mss32.dll", EntryPoint = "_AIL_decompress_ASI@24")] - public unsafe static extern int DecompressASI( - [MarshalAs(UnmanagedType.LPArray)] byte[] indata, - int insize, - [MarshalAs(UnmanagedType.LPStr)] string ext, - IntPtr result, - int *resultSize, - [MarshalAs(UnmanagedType.FunctionPtr)] AIL_decomp_func func = null); - - [DllImport("mss32.dll", EntryPoint = "_AIL_last_error@0")] - [return: MarshalAs(UnmanagedType.LPStr)] - public static extern string LastError(); - - [DllImport("mss32.dll", EntryPoint = "_AIL_set_redist_directory@4")] - [return: MarshalAs(UnmanagedType.LPStr)] - public static extern string SetRedistDirectory([MarshalAs(UnmanagedType.LPStr)] string redistDir); - - [DllImport("mss32.dll", EntryPoint = "_AIL_mem_free_lock@4")] - public static extern void MemFreeLock(IntPtr ptr); - - [DllImport("mss32.dll", EntryPoint = "_AIL_startup@0")] - public static extern int Startup(); - - [DllImport("mss32.dll", EntryPoint = "_AIL_shutdown@0")] - public static extern int Shutdown(); - } - } + } + } } diff --git a/PCK-Studio/Classes/Misc/FileCacher.cs b/PCK-Studio/Classes/Misc/FileCacher.cs new file mode 100644 index 00000000..e2fb623a --- /dev/null +++ b/PCK-Studio/Classes/Misc/FileCacher.cs @@ -0,0 +1,51 @@ +using System; +using System.IO; + +namespace PckStudio.Classes.Misc +{ + internal class FileCacher + { + private string _cacheDirectory; + + public string CacheDirectory => _cacheDirectory; + + public FileCacher(string cacheDirectory) + { + _cacheDirectory = cacheDirectory; + } + + public bool HasFileCached(string filename) + { + string destinationFilepath = Path.Combine(_cacheDirectory, filename); + return File.Exists(destinationFilepath); + } + + public string GetCachedFilepath(string filename) + { + if (HasFileCached(filename)) + { + return Path.Combine(_cacheDirectory, filename); + } + return null; + } + + /// + /// Caches data if the doesn't already exists in the + /// + /// Data to cache + /// Filename with extension + /// + public void Cache(byte[] data, string filename) + { + _ = filename ?? throw new ArgumentNullException("filename"); + string destinationFilepath = Path.Combine(_cacheDirectory, filename); + if (!File.Exists(destinationFilepath)) + { + using (FileStream fsDst = File.OpenWrite(destinationFilepath)) + { + fsDst.Write(data, 0, data.Length); + } + } + } + } +} diff --git a/PCK-Studio/Forms/Editor/AudioEditor.Designer.cs b/PCK-Studio/Forms/Editor/AudioEditor.Designer.cs index bd643284..a9011a57 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.Designer.cs +++ b/PCK-Studio/Forms/Editor/AudioEditor.Designer.cs @@ -29,304 +29,312 @@ namespace PckStudio.Forms.Editor ///
private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AudioEditor)); - this.treeView1 = new System.Windows.Forms.TreeView(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addCategoryStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeCategoryStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.changeCategoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.catImages = new System.Windows.Forms.ImageList(this.components); - this.menuStrip = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.creditsEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteUnusedBINKAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openDataFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.bulkReplaceExistingTracksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.organizeTracksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.howToAddSongsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.whatAreTheCategoriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.howToEditCreditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optimizeDataFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.bINKACompressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.treeView2 = new System.Windows.Forms.TreeView(); - this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addEntryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeEntryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.verifyFileLocationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.playOverworldInCreative = new MetroFramework.Controls.MetroCheckBox(); - this.compressionUpDown = new System.Windows.Forms.NumericUpDown(); - this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); - this.contextMenuStrip1.SuspendLayout(); - this.menuStrip.SuspendLayout(); - this.contextMenuStrip2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.compressionUpDown)).BeginInit(); - this.SuspendLayout(); - // - // treeView1 - // - resources.ApplyResources(this.treeView1, "treeView1"); - this.treeView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.treeView1.ContextMenuStrip = this.contextMenuStrip1; - this.treeView1.ForeColor = System.Drawing.Color.White; - this.treeView1.ImageList = this.catImages; - this.treeView1.LabelEdit = true; - this.treeView1.Name = "treeView1"; - this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect); - this.treeView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView1_KeyDown); - // - // contextMenuStrip1 - // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AudioEditor)); + this.treeView1 = new System.Windows.Forms.TreeView(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.addCategoryStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.removeCategoryStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.changeCategoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.catImages = new System.Windows.Forms.ImageList(this.components); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.creditsEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.deleteUnusedBINKAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openDataFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.bulkReplaceExistingTracksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.organizeTracksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.howToAddSongsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.whatAreTheCategoriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.howToEditCreditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optimizeDataFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.bINKACompressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.treeView2 = new System.Windows.Forms.TreeView(); + this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.addEntryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.removeEntryMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.verifyFileLocationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.playOverworldInCreative = new MetroFramework.Controls.MetroCheckBox(); + this.compressionUpDown = new System.Windows.Forms.NumericUpDown(); + this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); + this.convertToWAVToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStrip1.SuspendLayout(); + this.menuStrip.SuspendLayout(); + this.contextMenuStrip2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.compressionUpDown)).BeginInit(); + this.SuspendLayout(); + // + // treeView1 + // + resources.ApplyResources(this.treeView1, "treeView1"); + this.treeView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.treeView1.ContextMenuStrip = this.contextMenuStrip1; + this.treeView1.ForeColor = System.Drawing.Color.White; + this.treeView1.ImageList = this.catImages; + this.treeView1.LabelEdit = true; + this.treeView1.Name = "treeView1"; + this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect); + this.treeView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView1_KeyDown); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addCategoryStripMenuItem, this.removeCategoryStripMenuItem, this.changeCategoryToolStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1"); - // - // addCategoryStripMenuItem - // - resources.ApplyResources(this.addCategoryStripMenuItem, "addCategoryStripMenuItem"); - this.addCategoryStripMenuItem.Name = "addCategoryStripMenuItem"; - this.addCategoryStripMenuItem.Click += new System.EventHandler(this.addCategoryStripMenuItem_Click); - // - // removeCategoryStripMenuItem - // - this.removeCategoryStripMenuItem.Name = "removeCategoryStripMenuItem"; - resources.ApplyResources(this.removeCategoryStripMenuItem, "removeCategoryStripMenuItem"); - this.removeCategoryStripMenuItem.Click += new System.EventHandler(this.removeCategoryStripMenuItem_Click); - // - // changeCategoryToolStripMenuItem - // - this.changeCategoryToolStripMenuItem.Name = "changeCategoryToolStripMenuItem"; - resources.ApplyResources(this.changeCategoryToolStripMenuItem, "changeCategoryToolStripMenuItem"); - this.changeCategoryToolStripMenuItem.Click += new System.EventHandler(this.setCategoryToolStripMenuItem_Click); - // - // catImages - // - this.catImages.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("catImages.ImageStream"))); - this.catImages.TransparentColor = System.Drawing.Color.Transparent; - this.catImages.Images.SetKeyName(0, "0_overworld.png"); - this.catImages.Images.SetKeyName(1, "1_nether.png"); - this.catImages.Images.SetKeyName(2, "2_end.png"); - this.catImages.Images.SetKeyName(3, "4_creative.png"); - this.catImages.Images.SetKeyName(4, "3_menu.png"); - this.catImages.Images.SetKeyName(5, "5_mg01.png"); - this.catImages.Images.SetKeyName(6, "6_mg02.png"); - this.catImages.Images.SetKeyName(7, "7_mg03.png"); - this.catImages.Images.SetKeyName(8, "8_unused.png"); - // - // menuStrip - // - resources.ApplyResources(this.menuStrip, "menuStrip"); - this.menuStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.contextMenuStrip1.Name = "contextMenuStrip1"; + resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1"); + // + // addCategoryStripMenuItem + // + resources.ApplyResources(this.addCategoryStripMenuItem, "addCategoryStripMenuItem"); + this.addCategoryStripMenuItem.Name = "addCategoryStripMenuItem"; + this.addCategoryStripMenuItem.Click += new System.EventHandler(this.addCategoryStripMenuItem_Click); + // + // removeCategoryStripMenuItem + // + this.removeCategoryStripMenuItem.Name = "removeCategoryStripMenuItem"; + resources.ApplyResources(this.removeCategoryStripMenuItem, "removeCategoryStripMenuItem"); + this.removeCategoryStripMenuItem.Click += new System.EventHandler(this.removeCategoryStripMenuItem_Click); + // + // changeCategoryToolStripMenuItem + // + this.changeCategoryToolStripMenuItem.Name = "changeCategoryToolStripMenuItem"; + resources.ApplyResources(this.changeCategoryToolStripMenuItem, "changeCategoryToolStripMenuItem"); + this.changeCategoryToolStripMenuItem.Click += new System.EventHandler(this.setCategoryToolStripMenuItem_Click); + // + // catImages + // + this.catImages.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("catImages.ImageStream"))); + this.catImages.TransparentColor = System.Drawing.Color.Transparent; + this.catImages.Images.SetKeyName(0, "0_overworld.png"); + this.catImages.Images.SetKeyName(1, "1_nether.png"); + this.catImages.Images.SetKeyName(2, "2_end.png"); + this.catImages.Images.SetKeyName(3, "4_creative.png"); + this.catImages.Images.SetKeyName(4, "3_menu.png"); + this.catImages.Images.SetKeyName(5, "5_mg01.png"); + this.catImages.Images.SetKeyName(6, "6_mg02.png"); + this.catImages.Images.SetKeyName(7, "7_mg03.png"); + this.catImages.Images.SetKeyName(8, "8_unused.png"); + // + // menuStrip + // + resources.ApplyResources(this.menuStrip, "menuStrip"); + this.menuStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.toolsToolStripMenuItem, this.helpToolStripMenuItem}); - this.menuStrip.Name = "menuStrip"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuStrip.Name = "menuStrip"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.saveToolStripMenuItem1}); - this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem"); - // - // saveToolStripMenuItem1 - // - resources.ApplyResources(this.saveToolStripMenuItem1, "saveToolStripMenuItem1"); - this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1"; - this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click); - // - // toolsToolStripMenuItem - // - this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem"); + // + // saveToolStripMenuItem1 + // + resources.ApplyResources(this.saveToolStripMenuItem1, "saveToolStripMenuItem1"); + this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1"; + this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click); + // + // toolsToolStripMenuItem + // + this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.creditsEditorToolStripMenuItem, this.deleteUnusedBINKAsToolStripMenuItem, this.openDataFolderToolStripMenuItem, this.bulkReplaceExistingTracksToolStripMenuItem, this.organizeTracksToolStripMenuItem}); - this.toolsToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - resources.ApplyResources(this.toolsToolStripMenuItem, "toolsToolStripMenuItem"); - // - // creditsEditorToolStripMenuItem - // - this.creditsEditorToolStripMenuItem.Name = "creditsEditorToolStripMenuItem"; - resources.ApplyResources(this.creditsEditorToolStripMenuItem, "creditsEditorToolStripMenuItem"); - this.creditsEditorToolStripMenuItem.Click += new System.EventHandler(this.creditsEditorToolStripMenuItem_Click); - // - // deleteUnusedBINKAsToolStripMenuItem - // - this.deleteUnusedBINKAsToolStripMenuItem.Name = "deleteUnusedBINKAsToolStripMenuItem"; - resources.ApplyResources(this.deleteUnusedBINKAsToolStripMenuItem, "deleteUnusedBINKAsToolStripMenuItem"); - this.deleteUnusedBINKAsToolStripMenuItem.Click += new System.EventHandler(this.deleteUnusedBINKAsToolStripMenuItem_Click); - // - // openDataFolderToolStripMenuItem - // - this.openDataFolderToolStripMenuItem.Name = "openDataFolderToolStripMenuItem"; - resources.ApplyResources(this.openDataFolderToolStripMenuItem, "openDataFolderToolStripMenuItem"); - this.openDataFolderToolStripMenuItem.Click += new System.EventHandler(this.openDataFolderToolStripMenuItem_Click); - // - // bulkReplaceExistingTracksToolStripMenuItem - // - this.bulkReplaceExistingTracksToolStripMenuItem.Name = "bulkReplaceExistingTracksToolStripMenuItem"; - resources.ApplyResources(this.bulkReplaceExistingTracksToolStripMenuItem, "bulkReplaceExistingTracksToolStripMenuItem"); - this.bulkReplaceExistingTracksToolStripMenuItem.Click += new System.EventHandler(this.bulkReplaceExistingFilesToolStripMenuItem_Click); - // - // organizeTracksToolStripMenuItem - // - this.organizeTracksToolStripMenuItem.Name = "organizeTracksToolStripMenuItem"; - resources.ApplyResources(this.organizeTracksToolStripMenuItem, "organizeTracksToolStripMenuItem"); - this.organizeTracksToolStripMenuItem.Click += new System.EventHandler(this.organizeTracksToolStripMenuItem_Click); - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolsToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + resources.ApplyResources(this.toolsToolStripMenuItem, "toolsToolStripMenuItem"); + // + // creditsEditorToolStripMenuItem + // + this.creditsEditorToolStripMenuItem.Name = "creditsEditorToolStripMenuItem"; + resources.ApplyResources(this.creditsEditorToolStripMenuItem, "creditsEditorToolStripMenuItem"); + this.creditsEditorToolStripMenuItem.Click += new System.EventHandler(this.creditsEditorToolStripMenuItem_Click); + // + // deleteUnusedBINKAsToolStripMenuItem + // + this.deleteUnusedBINKAsToolStripMenuItem.Name = "deleteUnusedBINKAsToolStripMenuItem"; + resources.ApplyResources(this.deleteUnusedBINKAsToolStripMenuItem, "deleteUnusedBINKAsToolStripMenuItem"); + this.deleteUnusedBINKAsToolStripMenuItem.Click += new System.EventHandler(this.deleteUnusedBINKAsToolStripMenuItem_Click); + // + // openDataFolderToolStripMenuItem + // + this.openDataFolderToolStripMenuItem.Name = "openDataFolderToolStripMenuItem"; + resources.ApplyResources(this.openDataFolderToolStripMenuItem, "openDataFolderToolStripMenuItem"); + this.openDataFolderToolStripMenuItem.Click += new System.EventHandler(this.openDataFolderToolStripMenuItem_Click); + // + // bulkReplaceExistingTracksToolStripMenuItem + // + this.bulkReplaceExistingTracksToolStripMenuItem.Name = "bulkReplaceExistingTracksToolStripMenuItem"; + resources.ApplyResources(this.bulkReplaceExistingTracksToolStripMenuItem, "bulkReplaceExistingTracksToolStripMenuItem"); + this.bulkReplaceExistingTracksToolStripMenuItem.Click += new System.EventHandler(this.bulkReplaceExistingFilesToolStripMenuItem_Click); + // + // organizeTracksToolStripMenuItem + // + this.organizeTracksToolStripMenuItem.Name = "organizeTracksToolStripMenuItem"; + resources.ApplyResources(this.organizeTracksToolStripMenuItem, "organizeTracksToolStripMenuItem"); + this.organizeTracksToolStripMenuItem.Click += new System.EventHandler(this.organizeTracksToolStripMenuItem_Click); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.howToAddSongsToolStripMenuItem, this.whatAreTheCategoriesToolStripMenuItem, this.howToEditCreditsToolStripMenuItem, this.optimizeDataFolderToolStripMenuItem, this.bINKACompressionToolStripMenuItem}); - this.helpToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - resources.ApplyResources(this.helpToolStripMenuItem, "helpToolStripMenuItem"); - // - // howToAddSongsToolStripMenuItem - // - this.howToAddSongsToolStripMenuItem.Name = "howToAddSongsToolStripMenuItem"; - resources.ApplyResources(this.howToAddSongsToolStripMenuItem, "howToAddSongsToolStripMenuItem"); - this.howToAddSongsToolStripMenuItem.Click += new System.EventHandler(this.howToAddSongsToolStripMenuItem_Click); - // - // whatAreTheCategoriesToolStripMenuItem - // - this.whatAreTheCategoriesToolStripMenuItem.Name = "whatAreTheCategoriesToolStripMenuItem"; - resources.ApplyResources(this.whatAreTheCategoriesToolStripMenuItem, "whatAreTheCategoriesToolStripMenuItem"); - this.whatAreTheCategoriesToolStripMenuItem.Click += new System.EventHandler(this.whatAreTheCategoriesToolStripMenuItem_Click); - // - // howToEditCreditsToolStripMenuItem - // - this.howToEditCreditsToolStripMenuItem.Name = "howToEditCreditsToolStripMenuItem"; - resources.ApplyResources(this.howToEditCreditsToolStripMenuItem, "howToEditCreditsToolStripMenuItem"); - this.howToEditCreditsToolStripMenuItem.Click += new System.EventHandler(this.howToEditCreditsToolStripMenuItem_Click); - // - // optimizeDataFolderToolStripMenuItem - // - this.optimizeDataFolderToolStripMenuItem.Name = "optimizeDataFolderToolStripMenuItem"; - resources.ApplyResources(this.optimizeDataFolderToolStripMenuItem, "optimizeDataFolderToolStripMenuItem"); - this.optimizeDataFolderToolStripMenuItem.Click += new System.EventHandler(this.optimizeDataFolderToolStripMenuItem_Click); - // - // bINKACompressionToolStripMenuItem - // - this.bINKACompressionToolStripMenuItem.Name = "bINKACompressionToolStripMenuItem"; - resources.ApplyResources(this.bINKACompressionToolStripMenuItem, "bINKACompressionToolStripMenuItem"); - this.bINKACompressionToolStripMenuItem.Click += new System.EventHandler(this.BINKACompressionToolStripMenuItem_Click); - // - // treeView2 - // - this.treeView2.AllowDrop = true; - resources.ApplyResources(this.treeView2, "treeView2"); - this.treeView2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.treeView2.ContextMenuStrip = this.contextMenuStrip2; - this.treeView2.ForeColor = System.Drawing.Color.White; - this.treeView2.Name = "treeView2"; - this.treeView2.DragDrop += new System.Windows.Forms.DragEventHandler(this.Binka_DragDrop); - this.treeView2.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeView2_DragEnter); - this.treeView2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView2_KeyDown); - // - // contextMenuStrip2 - // - this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.helpToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + resources.ApplyResources(this.helpToolStripMenuItem, "helpToolStripMenuItem"); + // + // howToAddSongsToolStripMenuItem + // + this.howToAddSongsToolStripMenuItem.Name = "howToAddSongsToolStripMenuItem"; + resources.ApplyResources(this.howToAddSongsToolStripMenuItem, "howToAddSongsToolStripMenuItem"); + this.howToAddSongsToolStripMenuItem.Click += new System.EventHandler(this.howToAddSongsToolStripMenuItem_Click); + // + // whatAreTheCategoriesToolStripMenuItem + // + this.whatAreTheCategoriesToolStripMenuItem.Name = "whatAreTheCategoriesToolStripMenuItem"; + resources.ApplyResources(this.whatAreTheCategoriesToolStripMenuItem, "whatAreTheCategoriesToolStripMenuItem"); + this.whatAreTheCategoriesToolStripMenuItem.Click += new System.EventHandler(this.whatAreTheCategoriesToolStripMenuItem_Click); + // + // howToEditCreditsToolStripMenuItem + // + this.howToEditCreditsToolStripMenuItem.Name = "howToEditCreditsToolStripMenuItem"; + resources.ApplyResources(this.howToEditCreditsToolStripMenuItem, "howToEditCreditsToolStripMenuItem"); + this.howToEditCreditsToolStripMenuItem.Click += new System.EventHandler(this.howToEditCreditsToolStripMenuItem_Click); + // + // optimizeDataFolderToolStripMenuItem + // + this.optimizeDataFolderToolStripMenuItem.Name = "optimizeDataFolderToolStripMenuItem"; + resources.ApplyResources(this.optimizeDataFolderToolStripMenuItem, "optimizeDataFolderToolStripMenuItem"); + this.optimizeDataFolderToolStripMenuItem.Click += new System.EventHandler(this.optimizeDataFolderToolStripMenuItem_Click); + // + // bINKACompressionToolStripMenuItem + // + this.bINKACompressionToolStripMenuItem.Name = "bINKACompressionToolStripMenuItem"; + resources.ApplyResources(this.bINKACompressionToolStripMenuItem, "bINKACompressionToolStripMenuItem"); + this.bINKACompressionToolStripMenuItem.Click += new System.EventHandler(this.BINKACompressionToolStripMenuItem_Click); + // + // treeView2 + // + this.treeView2.AllowDrop = true; + resources.ApplyResources(this.treeView2, "treeView2"); + this.treeView2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.treeView2.ContextMenuStrip = this.contextMenuStrip2; + this.treeView2.ForeColor = System.Drawing.Color.White; + this.treeView2.Name = "treeView2"; + this.treeView2.DragDrop += new System.Windows.Forms.DragEventHandler(this.Binka_DragDrop); + this.treeView2.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeView2_DragEnter); + this.treeView2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeView2_KeyDown); + // + // contextMenuStrip2 + // + this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addEntryMenuItem, this.removeEntryMenuItem, - this.verifyFileLocationToolStripMenuItem}); - this.contextMenuStrip2.Name = "contextMenuStrip1"; - resources.ApplyResources(this.contextMenuStrip2, "contextMenuStrip2"); - // - // addEntryMenuItem - // - resources.ApplyResources(this.addEntryMenuItem, "addEntryMenuItem"); - this.addEntryMenuItem.Name = "addEntryMenuItem"; - this.addEntryMenuItem.Click += new System.EventHandler(this.addEntryMenuItem_Click); - // - // removeEntryMenuItem - // - this.removeEntryMenuItem.Name = "removeEntryMenuItem"; - resources.ApplyResources(this.removeEntryMenuItem, "removeEntryMenuItem"); - this.removeEntryMenuItem.Click += new System.EventHandler(this.removeEntryMenuItem_Click); - // - // verifyFileLocationToolStripMenuItem - // - this.verifyFileLocationToolStripMenuItem.Name = "verifyFileLocationToolStripMenuItem"; - resources.ApplyResources(this.verifyFileLocationToolStripMenuItem, "verifyFileLocationToolStripMenuItem"); - this.verifyFileLocationToolStripMenuItem.Click += new System.EventHandler(this.verifyFileLocationToolStripMenuItem_Click); - // - // playOverworldInCreative - // - resources.ApplyResources(this.playOverworldInCreative, "playOverworldInCreative"); - this.playOverworldInCreative.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.playOverworldInCreative.ForeColor = System.Drawing.SystemColors.Window; - this.playOverworldInCreative.Name = "playOverworldInCreative"; - this.playOverworldInCreative.Theme = MetroFramework.MetroThemeStyle.Dark; - this.playOverworldInCreative.UseCustomBackColor = true; - this.playOverworldInCreative.UseCustomForeColor = true; - this.playOverworldInCreative.UseSelectable = true; - // - // compressionUpDown - // - this.compressionUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.compressionUpDown.ForeColor = System.Drawing.SystemColors.Window; - resources.ApplyResources(this.compressionUpDown, "compressionUpDown"); - this.compressionUpDown.Maximum = new decimal(new int[] { + this.verifyFileLocationToolStripMenuItem, + this.convertToWAVToolStripMenuItem}); + this.contextMenuStrip2.Name = "contextMenuStrip1"; + resources.ApplyResources(this.contextMenuStrip2, "contextMenuStrip2"); + // + // addEntryMenuItem + // + resources.ApplyResources(this.addEntryMenuItem, "addEntryMenuItem"); + this.addEntryMenuItem.Name = "addEntryMenuItem"; + this.addEntryMenuItem.Click += new System.EventHandler(this.addEntryMenuItem_Click); + // + // removeEntryMenuItem + // + this.removeEntryMenuItem.Name = "removeEntryMenuItem"; + resources.ApplyResources(this.removeEntryMenuItem, "removeEntryMenuItem"); + this.removeEntryMenuItem.Click += new System.EventHandler(this.removeEntryMenuItem_Click); + // + // verifyFileLocationToolStripMenuItem + // + this.verifyFileLocationToolStripMenuItem.Name = "verifyFileLocationToolStripMenuItem"; + resources.ApplyResources(this.verifyFileLocationToolStripMenuItem, "verifyFileLocationToolStripMenuItem"); + this.verifyFileLocationToolStripMenuItem.Click += new System.EventHandler(this.verifyFileLocationToolStripMenuItem_Click); + // + // playOverworldInCreative + // + resources.ApplyResources(this.playOverworldInCreative, "playOverworldInCreative"); + this.playOverworldInCreative.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.playOverworldInCreative.ForeColor = System.Drawing.SystemColors.Window; + this.playOverworldInCreative.Name = "playOverworldInCreative"; + this.playOverworldInCreative.Theme = MetroFramework.MetroThemeStyle.Dark; + this.playOverworldInCreative.UseCustomBackColor = true; + this.playOverworldInCreative.UseCustomForeColor = true; + this.playOverworldInCreative.UseSelectable = true; + // + // compressionUpDown + // + this.compressionUpDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.compressionUpDown.ForeColor = System.Drawing.SystemColors.Window; + resources.ApplyResources(this.compressionUpDown, "compressionUpDown"); + this.compressionUpDown.Maximum = new decimal(new int[] { 9, 0, 0, 0}); - this.compressionUpDown.Minimum = new decimal(new int[] { + this.compressionUpDown.Minimum = new decimal(new int[] { 1, 0, 0, 0}); - this.compressionUpDown.Name = "compressionUpDown"; - this.compressionUpDown.Value = new decimal(new int[] { + this.compressionUpDown.Name = "compressionUpDown"; + this.compressionUpDown.Value = new decimal(new int[] { 4, 0, 0, 0}); - // - // metroLabel1 - // - resources.ApplyResources(this.metroLabel1, "metroLabel1"); - this.metroLabel1.Name = "metroLabel1"; - this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // AudioEditor - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.metroLabel1); - this.Controls.Add(this.compressionUpDown); - this.Controls.Add(this.playOverworldInCreative); - this.Controls.Add(this.treeView1); - this.Controls.Add(this.treeView2); - this.Controls.Add(this.menuStrip); - this.Name = "AudioEditor"; - this.Style = MetroFramework.MetroColorStyle.Silver; - this.Theme = MetroFramework.MetroThemeStyle.Dark; - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.AudioEditor_FormClosed); - this.Shown += new System.EventHandler(this.AudioEditor_Shown); - this.contextMenuStrip1.ResumeLayout(false); - this.menuStrip.ResumeLayout(false); - this.menuStrip.PerformLayout(); - this.contextMenuStrip2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.compressionUpDown)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + // + // metroLabel1 + // + resources.ApplyResources(this.metroLabel1, "metroLabel1"); + this.metroLabel1.Name = "metroLabel1"; + this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // convertToWAVToolStripMenuItem + // + this.convertToWAVToolStripMenuItem.Name = "convertToWAVToolStripMenuItem"; + resources.ApplyResources(this.convertToWAVToolStripMenuItem, "convertToWAVToolStripMenuItem"); + this.convertToWAVToolStripMenuItem.Click += new System.EventHandler(this.convertToWAVToolStripMenuItem_Click); + // + // AudioEditor + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.metroLabel1); + this.Controls.Add(this.compressionUpDown); + this.Controls.Add(this.playOverworldInCreative); + this.Controls.Add(this.treeView1); + this.Controls.Add(this.treeView2); + this.Controls.Add(this.menuStrip); + this.Name = "AudioEditor"; + this.Style = MetroFramework.MetroColorStyle.Silver; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.AudioEditor_FormClosed); + this.Shown += new System.EventHandler(this.AudioEditor_Shown); + this.contextMenuStrip1.ResumeLayout(false); + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); + this.contextMenuStrip2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.compressionUpDown)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -361,5 +369,6 @@ namespace PckStudio.Forms.Editor private System.Windows.Forms.ToolStripMenuItem bulkReplaceExistingTracksToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem changeCategoryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem organizeTracksToolStripMenuItem; - } + private System.Windows.Forms.ToolStripMenuItem convertToWAVToolStripMenuItem; + } } \ No newline at end of file diff --git a/PCK-Studio/Forms/Editor/AudioEditor.resx b/PCK-Studio/Forms/Editor/AudioEditor.resx index ea023737..e032d6ce 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.resx +++ b/PCK-Studio/Forms/Editor/AudioEditor.resx @@ -125,32 +125,6 @@ 127, 8 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x - DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5 - jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC - - - - 168, 22 - - - Add Category - - - 168, 22 - - - Remove Category - - - 168, 22 - - - Set Category - 169, 70 @@ -172,7 +146,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADk - MAAAAk1TRnQBSQFMAgEBCQEAAaABAAGgAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA + MAAAAk1TRnQBSQFMAgEBCQEAAagBAAGoAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA AwABMAMAAQEBAAEgBgABMBIAAzgB/wM1Af8DNQH/AzMB/wMwAf8DLwH/Ay0B/wMtAf8DJAH/AzsB/wM4 Af8DNQH/Ay0B/wMnAf8DNgH/AzIB/8AAAzgB/wN/Af8DeQH/A3kB/wN5Af8DcQH/A3EB/wN5Af8DeQH/ A3EB/wNxAf8DcQH/A3kB/wN5Af8DfwH/AzIB/8AAAzIB/wN2Af8DsAH/A7AB/wOvAf8DrwH/A68B/wOo @@ -410,12 +384,68 @@ 5 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x + DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5 + jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC + + + + 168, 22 + + + Add Category + + + 168, 22 + + + Remove Category + + + 168, 22 + + + Set Category + 19, 8 False + + 20, 60 + + + 410, 24 + + + 11 + + + menuStrip1 + + + menuStrip + + + System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + 37, 20 + + + File + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO @@ -432,11 +462,11 @@ Save - - 37, 20 + + 46, 20 - - File + + Tools 220, 22 @@ -468,11 +498,11 @@ Organize Tracks - - 46, 20 + + 44, 20 - - Tools + + Help 243, 22 @@ -504,36 +534,6 @@ BINKA Compression - - 44, 20 - - - Help - - - 20, 60 - - - 410, 24 - - - 11 - - - menuStrip1 - - - menuStrip - - - System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 7 - Top, Bottom, Left, Right @@ -549,25 +549,31 @@ - 173, 22 + 180, 22 Add Entry - 173, 22 + 180, 22 Remove Entry - 173, 22 + 180, 22 Verify File Location + + 180, 22 + + + Convert To WAV + - 174, 70 + 181, 114 contextMenuStrip2 @@ -821,6 +827,12 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + convertToWAVToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + AudioEditor diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 5d3cd260..cf4b9a7b 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -186,6 +186,7 @@ + @@ -764,6 +765,10 @@ {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB} OMI Filetype Library + + {e8d0b671-3ab1-48b6-a767-58df67bd5d11} + SharpMss32 + - $(IntermediateOutputPath)gitver - - - - - - - - - - @(GitVersion) - + + + + + + + + + + $(GitHash) + $(GitBranch) + - - + + $(IntermediateOutputPath)GitAssemblyInfo.cs - + - + <_Parameter1>GitHash <_Parameter2>$(BuildHash) + + <_Parameter1>GitBranch + <_Parameter2>$(BuildBranch) + - + @@ -82,14 +83,24 @@ AnyCPU - pdbonly - false + none + true bin\Release\ TRACE prompt 4 true + + AnyCPU + pdbonly + false + bin\Beta\ + BETA;TRACE + prompt + 4 + true + Resources\PCK-Studio_Logo.ico @@ -124,16 +135,6 @@ - - bin\ReleasePortable\ - TRACE - true - pdbonly - AnyCPU - preview - prompt - true - Properties\app.manifest diff --git a/PCK-Studio/Program.cs b/PCK-Studio/Program.cs index 51fce472..e84fa74f 100644 --- a/PCK-Studio/Program.cs +++ b/PCK-Studio/Program.cs @@ -15,7 +15,7 @@ namespace PckStudio private System.Globalization.Calendar BuildCalendar = new System.Globalization.CultureInfo("en-US").Calendar; private DateTime date = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime; - public string BuildVersion + public string BetaBuildVersion { get { @@ -27,12 +27,34 @@ namespace PckStudio BuildType); } } + } - public string LastCommitHash => - Assembly - .GetEntryAssembly() - .GetCustomAttributes() - .FirstOrDefault(attr => attr.Key == "GitHash")?.Value; + static class CommitInfo + { + private static string _branchName = null; + private static string _commitHash = null; + + public static string BranchName + { + get + { + return _branchName ??= Assembly + .GetEntryAssembly() + .GetCustomAttributes() + .FirstOrDefault(attr => attr.Key == "GitBranch")?.Value; + } + } + + public static string CommitHash + { + get + { + return _commitHash ??= Assembly + .GetEntryAssembly() + .GetCustomAttributes() + .FirstOrDefault(attr => attr.Key == "GitHash")?.Value; + } + } } static class Program diff --git a/PCK_Studio.sln b/PCK_Studio.sln index d40bfc93..8062268c 100644 --- a/PCK_Studio.sln +++ b/PCK_Studio.sln @@ -13,6 +13,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpMss32", "Vendor\SharpM EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Beta|Any CPU = Beta|Any CPU + Beta|x64 = Beta|x64 + Beta|x86 = Beta|x86 Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 @@ -21,6 +24,12 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Beta|Any CPU.ActiveCfg = Beta|Any CPU + {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Beta|Any CPU.Build.0 = Beta|Any CPU + {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Beta|x64.ActiveCfg = Beta|Any CPU + {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Beta|x64.Build.0 = Beta|Any CPU + {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Beta|x86.ActiveCfg = Beta|Any CPU + {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Beta|x86.Build.0 = Beta|Any CPU {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Debug|Any CPU.Build.0 = Debug|Any CPU {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -33,6 +42,12 @@ Global {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Release|x64.Build.0 = Release|Any CPU {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Release|x86.ActiveCfg = Release|Any CPU {0ACAAEDE-93F5-4B5D-B8D7-A0C43359C0D6}.Release|x86.Build.0 = Release|Any CPU + {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Beta|Any CPU.ActiveCfg = Release|Any CPU + {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Beta|Any CPU.Build.0 = Release|Any CPU + {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Beta|x64.ActiveCfg = Release|Any CPU + {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Beta|x64.Build.0 = Release|Any CPU + {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Beta|x86.ActiveCfg = Release|Any CPU + {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Beta|x86.Build.0 = Release|Any CPU {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Debug|Any CPU.Build.0 = Debug|Any CPU {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -45,6 +60,12 @@ Global {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Release|x64.Build.0 = Release|Any CPU {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Release|x86.ActiveCfg = Release|Any CPU {693AEBC1-293D-4DF0-BCAE-26A1099FE7BB}.Release|x86.Build.0 = Release|Any CPU + {E8D0B671-3AB1-48B6-A767-58DF67BD5D11}.Beta|Any CPU.ActiveCfg = Release|Any CPU + {E8D0B671-3AB1-48B6-A767-58DF67BD5D11}.Beta|Any CPU.Build.0 = Release|Any CPU + {E8D0B671-3AB1-48B6-A767-58DF67BD5D11}.Beta|x64.ActiveCfg = Release|Any CPU + {E8D0B671-3AB1-48B6-A767-58DF67BD5D11}.Beta|x64.Build.0 = Release|Any CPU + {E8D0B671-3AB1-48B6-A767-58DF67BD5D11}.Beta|x86.ActiveCfg = Release|Any CPU + {E8D0B671-3AB1-48B6-A767-58DF67BD5D11}.Beta|x86.Build.0 = Release|Any CPU {E8D0B671-3AB1-48B6-A767-58DF67BD5D11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E8D0B671-3AB1-48B6-A767-58DF67BD5D11}.Debug|Any CPU.Build.0 = Debug|Any CPU {E8D0B671-3AB1-48B6-A767-58DF67BD5D11}.Debug|x64.ActiveCfg = Debug|Any CPU From b37d75144479810d6e544d607773b52426869ef9 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 2 May 2023 17:09:09 +0200 Subject: [PATCH 64/80] Renamed and Moved pleaseWait.cs --- .../Audio/pleaseWait.Designer.cs | 62 ------------------ .../Additional-Popups/Audio/pleaseWait.cs | 12 ---- .../InProgressPrompt.Designer.cs | 63 +++++++++++++++++++ .../Additional-Popups/InProgressPrompt.cs | 12 ++++ .../pleaseWait.resx => InProgressPrompt.resx} | 0 PCK-Studio/Forms/Editor/AudioEditor.cs | 4 +- PCK-Studio/MainForm.cs | 7 ++- PCK-Studio/PckStudio.csproj | 10 +-- 8 files changed, 88 insertions(+), 82 deletions(-) delete mode 100644 PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.Designer.cs delete mode 100644 PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.cs create mode 100644 PCK-Studio/Forms/Additional-Popups/InProgressPrompt.Designer.cs create mode 100644 PCK-Studio/Forms/Additional-Popups/InProgressPrompt.cs rename PCK-Studio/Forms/Additional-Popups/{Audio/pleaseWait.resx => InProgressPrompt.resx} (100%) diff --git a/PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.Designer.cs b/PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.Designer.cs deleted file mode 100644 index e12e622c..00000000 --- a/PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.Designer.cs +++ /dev/null @@ -1,62 +0,0 @@ -namespace PckStudio.Forms.Additional_Popups.Audio -{ - partial class pleaseWait - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); - this.SuspendLayout(); - // - // metroLabel1 - // - this.metroLabel1.AutoSize = true; - this.metroLabel1.Location = new System.Drawing.Point(19, 20); - this.metroLabel1.Name = "metroLabel1"; - this.metroLabel1.Size = new System.Drawing.Size(359, 19); - this.metroLabel1.TabIndex = 0; - this.metroLabel1.Text = "Please wait while PCK Studio processes the requested files. (:"; - this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // pleaseWait - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(396, 59); - this.Controls.Add(this.metroLabel1); - this.Name = "pleaseWait"; - this.Style = MetroFramework.MetroColorStyle.White; - this.Theme = MetroFramework.MetroThemeStyle.Dark; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private MetroFramework.Controls.MetroLabel metroLabel1; - } -} \ No newline at end of file diff --git a/PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.cs b/PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.cs deleted file mode 100644 index b22e0044..00000000 --- a/PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.cs +++ /dev/null @@ -1,12 +0,0 @@ -using MetroFramework.Forms; - -namespace PckStudio.Forms.Additional_Popups.Audio -{ - public partial class pleaseWait : MetroForm - { - public pleaseWait() - { - InitializeComponent(); - } - } -} diff --git a/PCK-Studio/Forms/Additional-Popups/InProgressPrompt.Designer.cs b/PCK-Studio/Forms/Additional-Popups/InProgressPrompt.Designer.cs new file mode 100644 index 00000000..677b755c --- /dev/null +++ b/PCK-Studio/Forms/Additional-Popups/InProgressPrompt.Designer.cs @@ -0,0 +1,63 @@ +namespace PckStudio.Forms.Additional_Popups +{ + partial class InProgressPrompt + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); + this.SuspendLayout(); + // + // metroLabel1 + // + this.metroLabel1.AutoSize = true; + this.metroLabel1.Location = new System.Drawing.Point(43, 20); + this.metroLabel1.Name = "metroLabel1"; + this.metroLabel1.Size = new System.Drawing.Size(307, 19); + this.metroLabel1.TabIndex = 0; + this.metroLabel1.Text = "Please wait while PCK Studio processes the request."; + this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // InProgressPrompt + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(396, 59); + this.Controls.Add(this.metroLabel1); + this.Name = "InProgressPrompt"; + this.Resizable = false; + this.Style = MetroFramework.MetroColorStyle.Black; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private MetroFramework.Controls.MetroLabel metroLabel1; + } +} \ No newline at end of file diff --git a/PCK-Studio/Forms/Additional-Popups/InProgressPrompt.cs b/PCK-Studio/Forms/Additional-Popups/InProgressPrompt.cs new file mode 100644 index 00000000..570531ec --- /dev/null +++ b/PCK-Studio/Forms/Additional-Popups/InProgressPrompt.cs @@ -0,0 +1,12 @@ +using MetroFramework.Forms; + +namespace PckStudio.Forms.Additional_Popups +{ + public partial class InProgressPrompt : MetroForm + { + public InProgressPrompt() + { + InitializeComponent(); + } + } +} diff --git a/PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.resx b/PCK-Studio/Forms/Additional-Popups/InProgressPrompt.resx similarity index 100% rename from PCK-Studio/Forms/Additional-Popups/Audio/pleaseWait.resx rename to PCK-Studio/Forms/Additional-Popups/InProgressPrompt.resx diff --git a/PCK-Studio/Forms/Editor/AudioEditor.cs b/PCK-Studio/Forms/Editor/AudioEditor.cs index b6bebf67..309b9be6 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.cs +++ b/PCK-Studio/Forms/Editor/AudioEditor.cs @@ -217,7 +217,7 @@ namespace PckStudio.Forms.Editor { int success = 0; int exitCode = 0; - pleaseWait waitDiag = new pleaseWait(); + InProgressPrompt waitDiag = new InProgressPrompt(); waitDiag.Show(this); foreach (string file in FileList) { @@ -541,7 +541,7 @@ namespace PckStudio.Forms.Editor if (file_ext == ".wav") // Convert Wave to BINKA { Cursor.Current = Cursors.WaitCursor; - pleaseWait waitDiag = new pleaseWait(); + InProgressPrompt waitDiag = new InProgressPrompt(); waitDiag.Show(this); await Task.Run(() => diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 1f9f02fa..ac611120 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -71,6 +71,7 @@ namespace PckStudio labelVersion.Text = "PCK Studio: " + Application.ProductVersion; ChangelogRichTextBox.Text = Resources.CHANGELOG; + #if BETA labelVersion.Text += $"{Program.Info.BetaBuildVersion}"; #endif @@ -450,16 +451,19 @@ namespace PckStudio { MessageBox.Show("Models.bin support has not been implemented. You can use the Spark Editor for the time being to edit these files.", "Not implemented yet."); } + public void HandleBehavioursFile(PckFile.FileData file) { using BehaviourEditor edit = new BehaviourEditor(file); wasModified = edit.ShowDialog(this) == DialogResult.OK; } + public void HandleMaterialFile(PckFile.FileData file) { using MaterialsEditor edit = new MaterialsEditor(file); wasModified = edit.ShowDialog(this) == DialogResult.OK; } + private void selectNode(object sender, TreeViewEventArgs e) { ReloadMetaTreeView(); @@ -2270,7 +2274,7 @@ namespace PckStudio ofn.Dispose(); if (ofn.FileNames.Length < 1) return; // Return if empty or if the user cancels - Forms.Additional_Popups.Audio.pleaseWait waitDiag = new Forms.Additional_Popups.Audio.pleaseWait(); + InProgressPrompt waitDiag = new InProgressPrompt(); waitDiag.Show(this); foreach (string file in ofn.FileNames) { @@ -2321,6 +2325,7 @@ namespace PckStudio if (ofn.FileNames.Length < 1) return; // Return if empty or if the user cancels Forms.Additional_Popups.Audio.pleaseWait waitDiag = new Forms.Additional_Popups.Audio.pleaseWait(); + InProgressPrompt waitDiag = new InProgressPrompt(); waitDiag.Show(this); foreach (string file in ofn.FileNames) { diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index f2d11dc7..d3f98e2e 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -344,11 +344,11 @@ AddParameter.cs - + Form - - pleaseWait.cs + + InProgressPrompt.cs @@ -551,8 +551,8 @@ AddParameter.cs - - pleaseWait.cs + + InProgressPrompt.cs BoxEditor.cs From 7c66dd1f34c92281cd4ca538d832b737cae2dd7c Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 2 May 2023 17:10:35 +0200 Subject: [PATCH 65/80] Moved PckNodeSorter to its own file --- PCK-Studio/MainForm.cs | 363 ++++++++++++++++-------------------- PCK-Studio/PckNodeSorter.cs | 42 +++++ PCK-Studio/PckStudio.csproj | 45 ++--- 3 files changed, 229 insertions(+), 221 deletions(-) create mode 100644 PCK-Studio/PckNodeSorter.cs diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index ac611120..1948a7e9 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -30,7 +30,7 @@ using PckStudio.Classes.IO._3DST; namespace PckStudio { - public partial class MainForm : MetroFramework.Forms.MetroForm + public partial class MainForm : MetroFramework.Forms.MetroForm { string saveLocation = string.Empty; PckFile currentPCK = null; @@ -65,21 +65,21 @@ namespace PckStudio imageList.Images.Add(Resources.ENTITY_MATERIALS_ICON); // Icon for Entity Material files (entityMaterials.bin) pckOpen.AllowDrop = true; - isSelectingTab = true; + isSelectingTab = true; tabControl.SelectTab(0); - isSelectingTab = false; + isSelectingTab = false; labelVersion.Text = "PCK Studio: " + Application.ProductVersion; ChangelogRichTextBox.Text = Resources.CHANGELOG; #if BETA - labelVersion.Text += $"{Program.Info.BetaBuildVersion}"; + labelVersion.Text += $"{Program.Info.BetaBuildVersion}"; #endif #if DEBUG labelVersion.Text += $" (Debug build: {CommitInfo.BranchName}@{CommitInfo.CommitHash})"; #endif - pckFileTypeHandler = new Dictionary>(15) + pckFileTypeHandler = new Dictionary>(15) { [PckFile.FileData.FileType.SkinFile] = HandleSkinFile, [PckFile.FileData.FileType.CapeFile] = null, @@ -101,9 +101,9 @@ namespace PckStudio public void LoadPck(string filepath) { - checkSaveState(); + checkSaveState(); treeViewMain.Nodes.Clear(); - currentPCK = openPck(filepath); + currentPCK = openPck(filepath); if (currentPCK == null) { MessageBox.Show(string.Format("Failed to load {0}", Path.GetFileName(filepath)), "Error"); @@ -111,8 +111,8 @@ namespace PckStudio } CheckForPasswordAndRemove(); - LoadEditorTab(); - } + LoadEditorTab(); + } private void Form1_Load(object sender, EventArgs e) { @@ -193,7 +193,7 @@ namespace PckStudio pckFileLabel.Text = "Unsaved File!"; else pckFileLabel.Text = "Current PCK File: " + Path.GetFileName(saveLocation); - treeViewMain.Enabled = treeMeta.Enabled = true; + treeViewMain.Enabled = treeMeta.Enabled = true; closeToolStripMenuItem.Visible = true; saveToolStripMenuItem.Enabled = true; saveToolStripMenuItem1.Enabled = true; @@ -226,12 +226,12 @@ namespace PckStudio advancedMetaAddingToolStripMenuItem.Enabled = false; closeToolStripMenuItem.Visible = false; convertToBedrockToolStripMenuItem.Enabled = false; - addCustomPackImageToolStripMenuItem.Enabled = false; - fileEntryCountLabel.Text = string.Empty; - pckFileLabel.Text = string.Empty; - UpdateRPC(); + addCustomPackImageToolStripMenuItem.Enabled = false; + fileEntryCountLabel.Text = string.Empty; + pckFileLabel.Text = string.Empty; + UpdateRPC(); - } + } /// /// wrapper that allows the use of in TreeNode.Nodes.Find(, ...) and TreeNode.Nodes.ContainsKey() @@ -282,7 +282,7 @@ namespace PckStudio try { var writer = new PckFileReader(LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); - PckFile subPCKfile = writer.FromStream(stream); + PckFile subPCKfile = writer.FromStream(stream); // passes parent path to remove from sub pck filepaths BuildPckTreeView(node.Nodes, subPCKfile, file.Filename + "/"); } @@ -329,7 +329,7 @@ namespace PckStudio treeViewMain.Nodes.Find(Path.GetFileName(filepath), true).ToList() .Find(t => (t.Tag as PckFile.FileData).Filename == filepath); } - } + } bool IsFilePathMipMapped(string filepath) { @@ -395,34 +395,34 @@ namespace PckStudio private void HandleAudioFile(PckFile.FileData file) { - if (!TryGetLocFile(out LOCFile locFile)) - throw new Exception("No .loc File found."); - using AudioEditor audioEditor = new AudioEditor(file, locFile, LittleEndianCheckBox.Checked); + if (!TryGetLocFile(out LOCFile locFile)) + throw new Exception("No .loc File found."); + using AudioEditor audioEditor = new AudioEditor(file, locFile, LittleEndianCheckBox.Checked); if (audioEditor.ShowDialog(this) == DialogResult.OK) { wasModified = true; TrySetLocFile(locFile); } - } + } private void HandleLocalisationFile(PckFile.FileData file) { - using LOCEditor locedit = new LOCEditor(file); + using LOCEditor locedit = new LOCEditor(file); wasModified = locedit.ShowDialog(this) == DialogResult.OK; UpdateRPC(); - } + } private void HandleColourFile(PckFile.FileData file) { - if (file.Size == 0) - { - MessageBox.Show("No Color data found.", "Error", MessageBoxButtons.OK, - MessageBoxIcon.Error); - return; - } - using COLEditor diag = new COLEditor(file); + if (file.Size == 0) + { + MessageBox.Show("No Color data found.", "Error", MessageBoxButtons.OK, + MessageBoxIcon.Error); + return; + } + using COLEditor diag = new COLEditor(file); wasModified = diag.ShowDialog(this) == DialogResult.OK; - } + } public void HandleSkinFile(PckFile.FileData file) { @@ -446,7 +446,7 @@ namespace PckStudio frm.Dispose(); } } - } + } public void HandleModelsFile(PckFile.FileData file) { MessageBox.Show("Models.bin support has not been implemented. You can use the Spark Editor for the time being to edit these files.", "Not implemented yet."); @@ -688,16 +688,16 @@ namespace PckStudio MessageBox.Show("Can't replace a folder."); } - private void deleteFileToolStripMenuItem_Click(object sender, EventArgs e) - { - var node = treeViewMain.SelectedNode; - if (node == null) return; + private void deleteFileToolStripMenuItem_Click(object sender, EventArgs e) + { + var node = treeViewMain.SelectedNode; + if (node == null) return; string path = node.FullPath; - if (node.Tag is PckFile.FileData) - { - PckFile.FileData file = node.Tag as PckFile.FileData; + if (node.Tag is PckFile.FileData) + { + PckFile.FileData file = node.Tag as PckFile.FileData; string itemPath = "res/textures/items/"; @@ -709,33 +709,33 @@ namespace PckStudio MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) return; } - // remove loc key if its a skin/cape + // remove loc key if its a skin/cape if (file.Filetype == PckFile.FileData.FileType.SkinFile || file.Filetype == PckFile.FileData.FileType.CapeFile) - { - if (TryGetLocFile(out LOCFile locFile)) - { - foreach (var property in file.Properties) - { - if (property.Item1 == "THEMENAMEID" || property.Item1 == "DISPLAYNAMEID") - locFile.RemoveLocKey(property.Item2); - } - TrySetLocFile(locFile); - } - } - currentPCK.Files.Remove(file); - node.Remove(); - wasModified = true; - } - else if (MessageBox.Show("Are you sure want to delete this folder? All contents will be deleted", "Warning", - MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) - { - string pckFolderDir = node.FullPath; - currentPCK.Files.RemoveAll(file => file.Filename.StartsWith(pckFolderDir)); - node.Remove(); - wasModified = true; - } + { + if (TryGetLocFile(out LOCFile locFile)) + { + foreach (var property in file.Properties) + { + if (property.Item1 == "THEMENAMEID" || property.Item1 == "DISPLAYNAMEID") + locFile.RemoveLocKey(property.Item2); + } + TrySetLocFile(locFile); + } + } + currentPCK.Files.Remove(file); + node.Remove(); + wasModified = true; + } + else if (MessageBox.Show("Are you sure want to delete this folder? All contents will be deleted", "Warning", + MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) + { + string pckFolderDir = node.FullPath; + currentPCK.Files.RemoveAll(file => file.Filename.StartsWith(pckFolderDir)); + node.Remove(); + wasModified = true; + } if (IsSubPCKNode(path)) RebuildSubPCK(node); - } + } private void renameFileToolStripMenuItem_Click(object sender, EventArgs e) { @@ -823,13 +823,13 @@ namespace PckStudio } } - private PckFile.FileData CreateNewAudioFile(bool isLittle) - { - // create actual valid pck file structure - PckAudioFile audioPck = new PckAudioFile(); - audioPck.AddCategory(PckAudioFile.AudioCategory.EAudioType.Overworld); - audioPck.AddCategory(PckAudioFile.AudioCategory.EAudioType.Nether); - audioPck.AddCategory(PckAudioFile.AudioCategory.EAudioType.End); + private PckFile.FileData CreateNewAudioFile(bool isLittle) + { + // create actual valid pck file structure + PckAudioFile audioPck = new PckAudioFile(); + audioPck.AddCategory(PckAudioFile.AudioCategory.EAudioType.Overworld); + audioPck.AddCategory(PckAudioFile.AudioCategory.EAudioType.Nether); + audioPck.AddCategory(PckAudioFile.AudioCategory.EAudioType.End); PckFile.FileData pckFileData = currentPCK.CreateNewFile("audio.pck", PckFile.FileData.FileType.AudioFile, () => { using (var stream = new MemoryStream()) @@ -839,8 +839,8 @@ namespace PckStudio return stream.ToArray(); } }); - return pckFileData; - } + return pckFileData; + } private void audiopckToolStripMenuItem_Click(object sender, EventArgs e) { @@ -947,8 +947,8 @@ namespace PckStudio { parent = parent.Parent; Console.WriteLine(parent.Text); - if (parent.Tag is PckFile.FileData f && - (f.Filetype is PckFile.FileData.FileType.TexturePackInfoFile || + if (parent.Tag is PckFile.FileData f && + (f.Filetype is PckFile.FileData.FileType.TexturePackInfoFile || f.Filetype is PckFile.FileData.FileType.SkinDataFile)) return parent; } @@ -1112,18 +1112,18 @@ namespace PckStudio mf.Properties.Add(property); } - TreeNode newNode = new TreeNode(); - newNode.Text = newFileName; - newNode.Tag = mf; - newNode.ImageIndex = node.ImageIndex; - newNode.SelectedImageIndex = node.SelectedImageIndex; + TreeNode newNode = new TreeNode(); + newNode.Text = newFileName; + newNode.Tag = mf; + newNode.ImageIndex = node.ImageIndex; + newNode.SelectedImageIndex = node.SelectedImageIndex; - if (node.Parent == null) treeViewMain.Nodes.Insert(node.Index + 1, newNode); //adds generated minefile node - else node.Parent.Nodes.Insert(node.Index + 1, newNode);//adds generated minefile node to selected folder + if (node.Parent == null) treeViewMain.Nodes.Insert(node.Index + 1, newNode); //adds generated minefile node + else node.Parent.Nodes.Insert(node.Index + 1, newNode);//adds generated minefile node to selected folder if (!IsSubPCKNode(node.FullPath)) currentPCK.Files.Insert(node.Index + 1, mf); else RebuildSubPCK(node); - } + } private void deleteEntryToolStripMenuItem_Click(object sender, EventArgs e) { @@ -1233,13 +1233,13 @@ namespace PckStudio locFile.InitializeDefault(packName); using var stream = new MemoryStream(); var writer = new LOCFileWriter(locFile, 2); - writer.WriteToStream(stream); + writer.WriteToStream(stream); return stream.ToArray(); - }); + }); if (createSkinsPCK) { - PckFile.FileData skinsPCKFile = newPck.CreateNewFile("Skins.pck", PckFile.FileData.FileType.SkinDataFile, () => + PckFile.FileData skinsPCKFile = newPck.CreateNewFile("Skins.pck", PckFile.FileData.FileType.SkinDataFile, () => { using var stream = new MemoryStream(); var writer = new PckFileWriter(new PckFile(3) @@ -1250,26 +1250,26 @@ namespace PckStudio ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); writer.WriteToStream(stream); - return stream.ToArray(); - }); - } + return stream.ToArray(); + }); + } return newPck; } private PckFile InitializeTexturePack(int packId, int packVersion, string packName, string res, bool createSkinsPCK = false) { - var newPck = InitializePack(packId, packVersion, packName, createSkinsPCK); + var newPck = InitializePack(packId, packVersion, packName, createSkinsPCK); var texturepackInfo = newPck.CreateNewFile($"{res}/{res}Info.pck", PckFile.FileData.FileType.TexturePackInfoFile, () => { - using var ms = new MemoryStream(); - var writer = new PckFileWriter(new PckFile(3), - LittleEndianCheckBox.Checked - ? OMI.Endianness.LittleEndian - : OMI.Endianness.BigEndian); - writer.WriteToStream(ms); - return ms.ToArray(); - }); + using var ms = new MemoryStream(); + var writer = new PckFileWriter(new PckFile(3), + LittleEndianCheckBox.Checked + ? OMI.Endianness.LittleEndian + : OMI.Endianness.BigEndian); + writer.WriteToStream(ms); + return ms.ToArray(); + }); texturepackInfo.Properties.Add(("PACKID", "0")); texturepackInfo.Properties.Add(("DATAPATH", $"{res}Data.pck")); @@ -1294,7 +1294,7 @@ namespace PckStudio private PckFile InitializeMashUpPack(int packId, int packVersion, string packName, string res) { - var newPck = InitializeTexturePack(packId, packVersion, packName, res, true); + var newPck = InitializeTexturePack(packId, packVersion, packName, res, true); var gameRuleFile = newPck.CreateNewFile("GameRules.grf", PckFile.FileData.FileType.GameRulesFile); var grfFile = new GameRuleFile(); grfFile.AddRule("MapOptions", @@ -1312,7 +1312,7 @@ namespace PckStudio new KeyValuePair("spawnZ", "0") ); using (var stream = new MemoryStream()) - { + { var writer = new GameRuleFileWriter(grfFile); writer.WriteToStream(stream); gameRuleFile.SetData(stream.ToArray()); @@ -1329,31 +1329,31 @@ namespace PckStudio { currentPCK = InitializePack(new Random().Next(8000, int.MaxValue), 0, namePrompt.NewText, true); isTemplateFile = true; - wasModified = true; - LoadEditorTab(); + wasModified = true; + LoadEditorTab(); } } private void texturePackToolStripMenuItem_Click(object sender, EventArgs e) { - checkSaveState(); - CreateTexturePack packPrompt = new CreateTexturePack(); + checkSaveState(); + CreateTexturePack packPrompt = new CreateTexturePack(); if (packPrompt.ShowDialog() == DialogResult.OK) { - currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes); + currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes); isTemplateFile = true; - wasModified = true; - LoadEditorTab(); + wasModified = true; + LoadEditorTab(); } } private void mashUpPackToolStripMenuItem_Click(object sender, EventArgs e) { - checkSaveState(); - CreateTexturePack packPrompt = new CreateTexturePack(); + checkSaveState(); + CreateTexturePack packPrompt = new CreateTexturePack(); if (packPrompt.ShowDialog() == DialogResult.OK) { - currentPCK = InitializeMashUpPack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes); + currentPCK = InitializeMashUpPack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes); isTemplateFile = true; wasModified = false; LoadEditorTab(); @@ -1418,10 +1418,10 @@ namespace PckStudio { try { - var reader = new PckFileReader(LittleEndianCheckBox.Checked + var reader = new PckFileReader(LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); - pckfile = reader.FromStream(fs); + pckfile = reader.FromStream(fs); } catch (OverflowException ex) { @@ -1500,51 +1500,51 @@ namespace PckStudio { string filename = Path.GetFileNameWithoutExtension(fullfilename); // sets file type based on wether its a cape or skin - PckFile.FileData.FileType pckfiletype = filename.StartsWith("dlccape", StringComparison.OrdinalIgnoreCase) + PckFile.FileData.FileType pckfiletype = filename.StartsWith("dlccape", StringComparison.OrdinalIgnoreCase) ? PckFile.FileData.FileType.CapeFile : PckFile.FileData.FileType.SkinFile; string pckfilepath = (hasSkinsPck ? "Skins/" : string.Empty) + filename + ".png"; - PckFile.FileData newFile = new PckFile.FileData(pckfilepath, pckfiletype); + PckFile.FileData newFile = new PckFile.FileData(pckfilepath, pckfiletype); byte[] filedata = File.ReadAllBytes(fullfilename); - newFile.SetData(filedata); + newFile.SetData(filedata); if (File.Exists(fullfilename + ".txt")) { - string[] properties = File.ReadAllText(fullfilename + ".txt").Split(new string[]{ Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); + string[] properties = File.ReadAllText(fullfilename + ".txt").Split(new string[]{ Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); foreach (string property in properties) { - string[] param = property.Split(':'); - if (param.Length < 2) continue; - newFile.Properties.Add((param[0], param[1])); - //switch (param[0]) - //{ - // case "DISPLAYNAMEID": - // locNameId = param[1]; - // continue; + string[] param = property.Split(':'); + if (param.Length < 2) continue; + newFile.Properties.Add((param[0], param[1])); + //switch (param[0]) + //{ + // case "DISPLAYNAMEID": + // locNameId = param[1]; + // continue; - // case "DISPLAYNAME": - // locName = param[1]; - // continue; + // case "DISPLAYNAME": + // locName = param[1]; + // continue; - // case "THEMENAMEID": - // locThemeId = param[1]; - // continue; + // case "THEMENAMEID": + // locThemeId = param[1]; + // continue; - // case "THEMENAME": - // locTheme = param[1]; - // continue; - //} - } - } + // case "THEMENAME": + // locTheme = param[1]; + // continue; + //} + } + } if (hasSkinsPck) { var skinsfile = currentPCK.GetFile("Skins.pck", PckFile.FileData.FileType.SkinDataFile); - using (var ms = new MemoryStream(skinsfile.Data)) + using (var ms = new MemoryStream(skinsfile.Data)) { var reader = new PckFileReader(LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); - var skinspck = reader.FromStream(ms); + var skinspck = reader.FromStream(ms); skinspck.Files.Add(newFile); ms.Position = 0; var writer = new PckFileWriter(skinspck, LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian); @@ -1552,7 +1552,7 @@ namespace PckStudio skinsfile.SetData(ms.ToArray()); } continue; - } + } currentPCK.Files.Add(newFile); } BuildMainTreeView(); @@ -1575,7 +1575,7 @@ namespace PckStudio using (var stream = new MemoryStream(locdata.Data)) { var reader = new LOCFileReader(); - locFile = reader.FromStream(stream); + locFile = reader.FromStream(stream); } return true; } @@ -1589,18 +1589,18 @@ namespace PckStudio private bool TrySetLocFile(in LOCFile locFile) { - if (!currentPCK.TryGetFile("localisation.loc", PckFile.FileData.FileType.LocalisationFile, out PckFile.FileData locdata) && - !currentPCK.TryGetFile("languages.loc", PckFile.FileData.FileType.LocalisationFile, out locdata)) - { - return false; - } + if (!currentPCK.TryGetFile("localisation.loc", PckFile.FileData.FileType.LocalisationFile, out PckFile.FileData locdata) && + !currentPCK.TryGetFile("languages.loc", PckFile.FileData.FileType.LocalisationFile, out locdata)) + { + return false; + } - try + try { using (var stream = new MemoryStream()) { var writer = new LOCFileWriter(locFile, 2); - writer.WriteToStream(stream); + writer.WriteToStream(stream); locdata.SetData(stream.ToArray()); } return true; @@ -1682,7 +1682,7 @@ namespace PckStudio TreeNodeCollection nodeCollection = treeViewMain.Nodes; if (treeViewMain.SelectedNode is TreeNode node) { - if (node.Tag is PckFile.FileData fd && + if (node.Tag is PckFile.FileData fd && (fd.Filetype != PckFile.FileData.FileType.TexturePackInfoFile && fd.Filetype != PckFile.FileData.FileType.SkinDataFile)) { @@ -1692,7 +1692,7 @@ namespace PckStudio } } else nodeCollection = node.Nodes; - } + } nodeCollection.Add(folerNode); } } @@ -1715,8 +1715,8 @@ namespace PckStudio private void openToolStripMenuItem1_Click(object sender, EventArgs e) { DateTime Begin = DateTime.Now; - //pckCenter open = new pckCenter(); - PckCenterBeta open = new PckCenterBeta(); + //pckCenter open = new pckCenter(); + PckCenterBeta open = new PckCenterBeta(); open.Show(); TimeSpan duration = new TimeSpan(DateTime.Now.Ticks - Begin.Ticks); @@ -1893,7 +1893,7 @@ namespace PckStudio private void SetPckFileIcon(TreeNode node, PckFile.FileData.FileType type) { - switch (type) + switch (type) { case PckFile.FileData.FileType.AudioFile: node.ImageIndex = 1; @@ -2128,7 +2128,7 @@ namespace PckStudio private void addCustomPackIconToolStripMenuItem_Click(object sender, EventArgs e) { - if (!currentPCK.TryGetFile("0", PckFile.FileData.FileType.InfoFile, out PckFile.FileData file) || + if (!currentPCK.TryGetFile("0", PckFile.FileData.FileType.InfoFile, out PckFile.FileData file) || string.IsNullOrEmpty(file.Properties.GetPropertyValue("PACKID")) ) { @@ -2141,7 +2141,7 @@ namespace PckStudio if (dialog.ShowDialog(this) == DialogResult.OK) { string filepath = dialog.FileName; - dialog.Filter = "Pack Icon|*.png"; + dialog.Filter = "Pack Icon|*.png"; if (dialog.ShowDialog(this) == DialogResult.OK) { using (var fs = File.OpenRead(filepath)) @@ -2316,18 +2316,18 @@ namespace PckStudio { int success = 0; - OpenFileDialog ofn = new OpenFileDialog(); - ofn.Multiselect = true; - ofn.Filter = "BINKA files (*.binka)|*.binka"; - ofn.Title = "Please choose BINKA files to convert to WAV"; - ofn.ShowDialog(); - ofn.Dispose(); - if (ofn.FileNames.Length < 1) return; // Return if empty or if the user cancels + using OpenFileDialog fileDialog = new OpenFileDialog + { + Multiselect = true, + Filter = "BINKA files (*.binka)|*.binka", + Title = "Please choose BINKA files to convert to WAV" + }; + + if (fileDialog.ShowDialog() != DialogResult.OK) return; - Forms.Additional_Popups.Audio.pleaseWait waitDiag = new Forms.Additional_Popups.Audio.pleaseWait(); InProgressPrompt waitDiag = new InProgressPrompt(); waitDiag.Show(this); - foreach (string file in ofn.FileNames) + foreach (string file in fileDialog.FileNames) { Classes.Binka.ToWav(file, Path.Combine(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(file) + ".binka")); success++; @@ -2335,42 +2335,7 @@ namespace PckStudio waitDiag.Close(); waitDiag.Dispose(); - MessageBox.Show(this, $"Successfully converted {success}/{ofn.FileNames.Length} file{(ofn.FileNames.Length != 1 ? "s" : "")}", "Done!"); - } - } - - public class PckNodeSorter : System.Collections.IComparer, IComparer - { - private bool CheckForSkinAndCapeFiles(TreeNode node) - { - if (node.Tag is PckFile.FileData file) - { - return file.Filetype == PckFile.FileData.FileType.SkinFile || - file.Filetype == PckFile.FileData.FileType.CapeFile; - } - return false; - } - - public int Compare(TreeNode first, TreeNode second) - { - // ignore these files in order to preserve skin(and cape) files - if (CheckForSkinAndCapeFiles(first)) - { - return 0; - } - if (CheckForSkinAndCapeFiles(second)) - { - return 0; - } - - int result = first.Text.CompareTo(second.Text); - if (result != 0) return result; - return first.ImageIndex.CompareTo(second.ImageIndex); - } - - int System.Collections.IComparer.Compare(object x, object y) - { - return x is TreeNode NodeX && y is TreeNode NodeY ? Compare(NodeX, NodeY) : 0; + MessageBox.Show(this, $"Successfully converted {success}/{fileDialog.FileNames.Length} file{(fileDialog.FileNames.Length != 1 ? "s" : "")}", "Done!"); } } } \ No newline at end of file diff --git a/PCK-Studio/PckNodeSorter.cs b/PCK-Studio/PckNodeSorter.cs new file mode 100644 index 00000000..67ff8d37 --- /dev/null +++ b/PCK-Studio/PckNodeSorter.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Windows.Forms; + +using OMI.Formats.Pck; + +namespace PckStudio +{ + public class PckNodeSorter : System.Collections.IComparer, IComparer + { + private bool CheckForSkinAndCapeFiles(TreeNode node) + { + if (node.Tag is PckFile.FileData file) + { + return file.Filetype == PckFile.FileData.FileType.SkinFile || + file.Filetype == PckFile.FileData.FileType.CapeFile; + } + return false; + } + + public int Compare(TreeNode first, TreeNode second) + { + // ignore these files in order to preserve skin(and cape) files + if (CheckForSkinAndCapeFiles(first)) + { + return 0; + } + if (CheckForSkinAndCapeFiles(second)) + { + return 0; + } + + int result = first.Text.CompareTo(second.Text); + if (result != 0) return result; + return first.ImageIndex.CompareTo(second.ImageIndex); + } + + int System.Collections.IComparer.Compare(object x, object y) + { + return x is TreeNode NodeX && y is TreeNode NodeY ? Compare(NodeX, NodeY) : 0; + } + } +} \ No newline at end of file diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index d3f98e2e..c5fbddfb 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -19,28 +19,28 @@ true - + - - + + - - - - $(GitHash) - $(GitBranch) - + + + + $(GitHash) + $(GitBranch) + - + $(IntermediateOutputPath)GitAssemblyInfo.cs - + - + <_Parameter1>GitHash @@ -51,7 +51,7 @@ <_Parameter2>$(BuildBranch) - + @@ -83,7 +83,7 @@ AnyCPU - none + none true bin\Release\ TRACE @@ -92,14 +92,14 @@ true - AnyCPU - pdbonly - false - bin\Beta\ - BETA;TRACE - prompt - 4 - true + AnyCPU + pdbonly + false + bin\Beta\ + BETA;TRACE + prompt + 4 + true Resources\PCK-Studio_Logo.ico @@ -460,6 +460,7 @@ Component + Form From 85a3909a91786f6d0a412c8279d8efb7d001f0a1 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 2 May 2023 18:30:35 +0200 Subject: [PATCH 66/80] Program.cs - Updated 'ProgramInfo.BuildCalendar' to only initialize once --- PCK-Studio/Program.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PCK-Studio/Program.cs b/PCK-Studio/Program.cs index e84fa74f..f35c6e09 100644 --- a/PCK-Studio/Program.cs +++ b/PCK-Studio/Program.cs @@ -12,7 +12,7 @@ namespace PckStudio // this is to specify which build release this is. This is manually updated for now // TODO: add different chars for different configurations private const string BuildType = "b"; - private System.Globalization.Calendar BuildCalendar = new System.Globalization.CultureInfo("en-US").Calendar; + private static System.Globalization.Calendar _buildCalendar; private DateTime date = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime; public string BetaBuildVersion @@ -21,9 +21,10 @@ namespace PckStudio { // adopted Minecraft Java Edition Snapshot format (YYwWWn) // to keep better track of work in progress features and builds + _buildCalendar ??= new System.Globalization.CultureInfo("en-US").Calendar; return string.Format("#{0}w{1}{2}", date.ToString("yy"), - BuildCalendar.GetWeekOfYear(date, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday), + _buildCalendar.GetWeekOfYear(date, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday), BuildType); } } @@ -74,7 +75,7 @@ namespace PckStudio static void Main(string[] args) { System.Globalization.CultureInfo.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; - + var mainForm = new MainForm(); if (args.Length > 0 && File.Exists(args[0]) && args[0].EndsWith(".pck")) mainForm.LoadPck(args[0]); From 1e7db523e204272ebe0c575202a5d6d6ff41c338 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 2 May 2023 19:20:18 +0200 Subject: [PATCH 67/80] MainForm.cs - Removed convert PC TextrurePack ToolStrip --- PCK-Studio/MainForm.Designer.cs | 1979 +++++++++++++++---------------- PCK-Studio/MainForm.cs | 6 - PCK-Studio/MainForm.resx | 70 +- 3 files changed, 1011 insertions(+), 1044 deletions(-) diff --git a/PCK-Studio/MainForm.Designer.cs b/PCK-Studio/MainForm.Designer.cs index 4de6a5a9..d7939997 100644 --- a/PCK-Studio/MainForm.Designer.cs +++ b/PCK-Studio/MainForm.Designer.cs @@ -28,138 +28,137 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.contextMenuPCKEntries = new System.Windows.Forms.ContextMenuStrip(this.components); - this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.folderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.skinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.createAnimatedTextureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.audiopckToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.colourscolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.CreateSkinsPCKToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.behavioursbinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.entityMaterialsbinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.importSkinsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.importSkinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.importExtractedSkinsFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addTextureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.as3DSTextureFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.setFileTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.skinToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.capeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.textureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.languagesFileLOCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.gameRulesFileGRFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.audioPCKFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.coloursCOLFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.gameRulesHeaderGRHToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.skinsPCKToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.modelsFileBINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.behavioursFileBINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.entityMaterialsFileBINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.miscFunctionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.generateMipMapTextureToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.viewFileInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.correctSkinDecimalsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.extractToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.cloneFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.renameFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.replaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.menuStrip = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.skinPackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.texturePackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.mashUpPackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.extractToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.convertPCTextrurePackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.advancedMetaAddingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.convertToBedrockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.programInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.binkaConversionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.videosToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.howToMakeABasicSkinPackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.howToMakeACustomSkinModelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.howToMakeCustomSkinModelsbedrockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.howToMakeCustomMusicToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.howToInstallPcksDirectlyToWiiUToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pCKCenterReleaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.howPCKsWorkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.installationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.fAQToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.donateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toNobledezJackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toPhoenixARCDeveloperToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.forMattNLContributorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.administrativeToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.storeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.wiiUPCKInstallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.PS3PCKInstallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.VitaPCKInstallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.joinDevelopmentDiscordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.trelloBoardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.miscToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addCustomPackImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenuMetaTree = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addEntryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addMultipleEntriesToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteEntryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.editAllEntriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.tabControl = new MetroFramework.Controls.MetroTabControl(); - this.openTab = new MetroFramework.Controls.MetroTabPage(); - this.pckOpen = new System.Windows.Forms.PictureBox(); - this.label5 = new MetroFramework.Controls.MetroLabel(); - this.labelVersion = new MetroFramework.Controls.MetroLabel(); - this.ChangelogRichTextBox = new System.Windows.Forms.RichTextBox(); - this.editorTab = new MetroFramework.Controls.MetroTabPage(); - this.pckFileLabel = new MetroFramework.Controls.MetroLabel(); - this.labelImageSize = new MetroFramework.Controls.MetroLabel(); - this.fileEntryCountLabel = new MetroFramework.Controls.MetroLabel(); - this.PropertiesTabControl = new MetroFramework.Controls.MetroTabControl(); - this.MetaTab = new MetroFramework.Controls.MetroTabPage(); - this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); - this.treeMeta = new System.Windows.Forms.TreeView(); - this.entryTypeTextBox = new MetroFramework.Controls.MetroTextBox(); - this.entryDataTextBox = new MetroFramework.Controls.MetroTextBox(); - this.buttonEdit = new MetroFramework.Controls.MetroButton(); - this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); - this.label11 = new MetroFramework.Controls.MetroLabel(); - this.treeViewMain = new System.Windows.Forms.TreeView(); - this.imageList = new System.Windows.Forms.ImageList(this.components); - this.LittleEndianCheckBox = new MetroFramework.Controls.MetroCheckBox(); - this.convertMusicFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.wavBinkaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.binkaWavToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pictureBoxImagePreview = new PckStudio.PictureBoxWithInterpolationMode(); - this.contextMenuPCKEntries.SuspendLayout(); - this.menuStrip.SuspendLayout(); - this.contextMenuMetaTree.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - this.tabControl.SuspendLayout(); - this.openTab.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pckOpen)).BeginInit(); - this.editorTab.SuspendLayout(); - this.PropertiesTabControl.SuspendLayout(); - this.MetaTab.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImagePreview)).BeginInit(); - this.SuspendLayout(); - // - // contextMenuPCKEntries - // - this.contextMenuPCKEntries.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.contextMenuPCKEntries = new System.Windows.Forms.ContextMenuStrip(this.components); + this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.folderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.skinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.createAnimatedTextureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.audiopckToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.colourscolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.CreateSkinsPCKToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.behavioursbinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.entityMaterialsbinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importSkinsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importSkinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importExtractedSkinsFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addTextureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.as3DSTextureFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.setFileTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.skinToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.capeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.languagesFileLOCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.gameRulesFileGRFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.audioPCKFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.coloursCOLFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.gameRulesHeaderGRHToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.skinsPCKToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.modelsFileBINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.behavioursFileBINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.entityMaterialsFileBINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.miscFunctionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.generateMipMapTextureToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.viewFileInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.correctSkinDecimalsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.extractToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cloneFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.renameFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.replaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.deleteFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.skinPackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.texturePackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mashUpPackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.extractToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.advancedMetaAddingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.convertToBedrockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.programInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.binkaConversionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.videosToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.howToMakeABasicSkinPackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.howToMakeACustomSkinModelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.howToMakeCustomSkinModelsbedrockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.howToMakeCustomMusicToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.howToInstallPcksDirectlyToWiiUToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pCKCenterReleaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.howPCKsWorkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.installationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.fAQToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.donateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toNobledezJackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toPhoenixARCDeveloperToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.forMattNLContributorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.administrativeToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.storeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.wiiUPCKInstallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.PS3PCKInstallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.VitaPCKInstallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.joinDevelopmentDiscordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.trelloBoardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.miscToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addCustomPackImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.convertMusicFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.wavBinkaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.binkaWavToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuMetaTree = new System.Windows.Forms.ContextMenuStrip(this.components); + this.addEntryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addMultipleEntriesToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.deleteEntryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editAllEntriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.tabControl = new MetroFramework.Controls.MetroTabControl(); + this.openTab = new MetroFramework.Controls.MetroTabPage(); + this.pckOpen = new System.Windows.Forms.PictureBox(); + this.label5 = new MetroFramework.Controls.MetroLabel(); + this.labelVersion = new MetroFramework.Controls.MetroLabel(); + this.ChangelogRichTextBox = new System.Windows.Forms.RichTextBox(); + this.editorTab = new MetroFramework.Controls.MetroTabPage(); + this.pckFileLabel = new MetroFramework.Controls.MetroLabel(); + this.labelImageSize = new MetroFramework.Controls.MetroLabel(); + this.fileEntryCountLabel = new MetroFramework.Controls.MetroLabel(); + this.PropertiesTabControl = new MetroFramework.Controls.MetroTabControl(); + this.MetaTab = new MetroFramework.Controls.MetroTabPage(); + this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); + this.treeMeta = new System.Windows.Forms.TreeView(); + this.entryTypeTextBox = new MetroFramework.Controls.MetroTextBox(); + this.entryDataTextBox = new MetroFramework.Controls.MetroTextBox(); + this.buttonEdit = new MetroFramework.Controls.MetroButton(); + this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); + this.label11 = new MetroFramework.Controls.MetroLabel(); + this.treeViewMain = new System.Windows.Forms.TreeView(); + this.imageList = new System.Windows.Forms.ImageList(this.components); + this.pictureBoxImagePreview = new PckStudio.PictureBoxWithInterpolationMode(); + this.LittleEndianCheckBox = new MetroFramework.Controls.MetroCheckBox(); + this.contextMenuPCKEntries.SuspendLayout(); + this.menuStrip.SuspendLayout(); + this.contextMenuMetaTree.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + this.tabControl.SuspendLayout(); + this.openTab.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pckOpen)).BeginInit(); + this.editorTab.SuspendLayout(); + this.PropertiesTabControl.SuspendLayout(); + this.MetaTab.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImagePreview)).BeginInit(); + this.SuspendLayout(); + // + // contextMenuPCKEntries + // + this.contextMenuPCKEntries.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.createToolStripMenuItem, this.importSkinsToolStripMenuItem, this.exportToolStripMenuItem, @@ -170,12 +169,12 @@ this.renameFileToolStripMenuItem, this.replaceToolStripMenuItem, this.deleteFileToolStripMenuItem}); - this.contextMenuPCKEntries.Name = "contextMenuStrip1"; - resources.ApplyResources(this.contextMenuPCKEntries, "contextMenuPCKEntries"); - // - // createToolStripMenuItem - // - this.createToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.contextMenuPCKEntries.Name = "contextMenuStrip1"; + resources.ApplyResources(this.contextMenuPCKEntries, "contextMenuPCKEntries"); + // + // createToolStripMenuItem + // + this.createToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.folderToolStripMenuItem, this.skinToolStripMenuItem, this.createAnimatedTextureToolStripMenuItem, @@ -184,114 +183,114 @@ this.CreateSkinsPCKToolStripMenuItem1, this.behavioursbinToolStripMenuItem, this.entityMaterialsbinToolStripMenuItem}); - resources.ApplyResources(this.createToolStripMenuItem, "createToolStripMenuItem"); - this.createToolStripMenuItem.Name = "createToolStripMenuItem"; - // - // folderToolStripMenuItem - // - resources.ApplyResources(this.folderToolStripMenuItem, "folderToolStripMenuItem"); - this.folderToolStripMenuItem.Name = "folderToolStripMenuItem"; - this.folderToolStripMenuItem.Click += new System.EventHandler(this.folderToolStripMenuItem_Click); - // - // skinToolStripMenuItem - // - resources.ApplyResources(this.skinToolStripMenuItem, "skinToolStripMenuItem"); - this.skinToolStripMenuItem.Name = "skinToolStripMenuItem"; - this.skinToolStripMenuItem.Click += new System.EventHandler(this.createSkinToolStripMenuItem_Click); - // - // createAnimatedTextureToolStripMenuItem - // - resources.ApplyResources(this.createAnimatedTextureToolStripMenuItem, "createAnimatedTextureToolStripMenuItem"); - this.createAnimatedTextureToolStripMenuItem.Name = "createAnimatedTextureToolStripMenuItem"; - this.createAnimatedTextureToolStripMenuItem.Click += new System.EventHandler(this.createAnimatedTextureToolStripMenuItem_Click); - // - // audiopckToolStripMenuItem - // - this.audiopckToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BINKA_ICON; - this.audiopckToolStripMenuItem.Name = "audiopckToolStripMenuItem"; - resources.ApplyResources(this.audiopckToolStripMenuItem, "audiopckToolStripMenuItem"); - this.audiopckToolStripMenuItem.Click += new System.EventHandler(this.audiopckToolStripMenuItem_Click); - // - // colourscolToolStripMenuItem - // - this.colourscolToolStripMenuItem.Image = global::PckStudio.Properties.Resources.COL_ICON; - this.colourscolToolStripMenuItem.Name = "colourscolToolStripMenuItem"; - resources.ApplyResources(this.colourscolToolStripMenuItem, "colourscolToolStripMenuItem"); - this.colourscolToolStripMenuItem.Click += new System.EventHandler(this.colourscolToolStripMenuItem_Click); - // - // CreateSkinsPCKToolStripMenuItem1 - // - this.CreateSkinsPCKToolStripMenuItem1.Image = global::PckStudio.Properties.Resources.SKINS_ICON; - this.CreateSkinsPCKToolStripMenuItem1.Name = "CreateSkinsPCKToolStripMenuItem1"; - resources.ApplyResources(this.CreateSkinsPCKToolStripMenuItem1, "CreateSkinsPCKToolStripMenuItem1"); - this.CreateSkinsPCKToolStripMenuItem1.Click += new System.EventHandler(this.CreateSkinsPCKToolStripMenuItem1_Click); - // - // behavioursbinToolStripMenuItem - // - this.behavioursbinToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BEHAVIOURS_ICON; - this.behavioursbinToolStripMenuItem.Name = "behavioursbinToolStripMenuItem"; - resources.ApplyResources(this.behavioursbinToolStripMenuItem, "behavioursbinToolStripMenuItem"); - this.behavioursbinToolStripMenuItem.Click += new System.EventHandler(this.behavioursbinToolStripMenuItem_Click); - // - // entityMaterialsbinToolStripMenuItem - // - this.entityMaterialsbinToolStripMenuItem.Image = global::PckStudio.Properties.Resources.ENTITY_MATERIALS_ICON; - this.entityMaterialsbinToolStripMenuItem.Name = "entityMaterialsbinToolStripMenuItem"; - resources.ApplyResources(this.entityMaterialsbinToolStripMenuItem, "entityMaterialsbinToolStripMenuItem"); - this.entityMaterialsbinToolStripMenuItem.Click += new System.EventHandler(this.entityMaterialsbinToolStripMenuItem_Click); - // - // importSkinsToolStripMenuItem - // - this.importSkinsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + resources.ApplyResources(this.createToolStripMenuItem, "createToolStripMenuItem"); + this.createToolStripMenuItem.Name = "createToolStripMenuItem"; + // + // folderToolStripMenuItem + // + resources.ApplyResources(this.folderToolStripMenuItem, "folderToolStripMenuItem"); + this.folderToolStripMenuItem.Name = "folderToolStripMenuItem"; + this.folderToolStripMenuItem.Click += new System.EventHandler(this.folderToolStripMenuItem_Click); + // + // skinToolStripMenuItem + // + resources.ApplyResources(this.skinToolStripMenuItem, "skinToolStripMenuItem"); + this.skinToolStripMenuItem.Name = "skinToolStripMenuItem"; + this.skinToolStripMenuItem.Click += new System.EventHandler(this.createSkinToolStripMenuItem_Click); + // + // createAnimatedTextureToolStripMenuItem + // + resources.ApplyResources(this.createAnimatedTextureToolStripMenuItem, "createAnimatedTextureToolStripMenuItem"); + this.createAnimatedTextureToolStripMenuItem.Name = "createAnimatedTextureToolStripMenuItem"; + this.createAnimatedTextureToolStripMenuItem.Click += new System.EventHandler(this.createAnimatedTextureToolStripMenuItem_Click); + // + // audiopckToolStripMenuItem + // + this.audiopckToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BINKA_ICON; + this.audiopckToolStripMenuItem.Name = "audiopckToolStripMenuItem"; + resources.ApplyResources(this.audiopckToolStripMenuItem, "audiopckToolStripMenuItem"); + this.audiopckToolStripMenuItem.Click += new System.EventHandler(this.audiopckToolStripMenuItem_Click); + // + // colourscolToolStripMenuItem + // + this.colourscolToolStripMenuItem.Image = global::PckStudio.Properties.Resources.COL_ICON; + this.colourscolToolStripMenuItem.Name = "colourscolToolStripMenuItem"; + resources.ApplyResources(this.colourscolToolStripMenuItem, "colourscolToolStripMenuItem"); + this.colourscolToolStripMenuItem.Click += new System.EventHandler(this.colourscolToolStripMenuItem_Click); + // + // CreateSkinsPCKToolStripMenuItem1 + // + this.CreateSkinsPCKToolStripMenuItem1.Image = global::PckStudio.Properties.Resources.SKINS_ICON; + this.CreateSkinsPCKToolStripMenuItem1.Name = "CreateSkinsPCKToolStripMenuItem1"; + resources.ApplyResources(this.CreateSkinsPCKToolStripMenuItem1, "CreateSkinsPCKToolStripMenuItem1"); + this.CreateSkinsPCKToolStripMenuItem1.Click += new System.EventHandler(this.CreateSkinsPCKToolStripMenuItem1_Click); + // + // behavioursbinToolStripMenuItem + // + this.behavioursbinToolStripMenuItem.Image = global::PckStudio.Properties.Resources.BEHAVIOURS_ICON; + this.behavioursbinToolStripMenuItem.Name = "behavioursbinToolStripMenuItem"; + resources.ApplyResources(this.behavioursbinToolStripMenuItem, "behavioursbinToolStripMenuItem"); + this.behavioursbinToolStripMenuItem.Click += new System.EventHandler(this.behavioursbinToolStripMenuItem_Click); + // + // entityMaterialsbinToolStripMenuItem + // + this.entityMaterialsbinToolStripMenuItem.Image = global::PckStudio.Properties.Resources.ENTITY_MATERIALS_ICON; + this.entityMaterialsbinToolStripMenuItem.Name = "entityMaterialsbinToolStripMenuItem"; + resources.ApplyResources(this.entityMaterialsbinToolStripMenuItem, "entityMaterialsbinToolStripMenuItem"); + this.entityMaterialsbinToolStripMenuItem.Click += new System.EventHandler(this.entityMaterialsbinToolStripMenuItem_Click); + // + // importSkinsToolStripMenuItem + // + this.importSkinsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.importSkinToolStripMenuItem, this.importExtractedSkinsFolderToolStripMenuItem, this.addTextureToolStripMenuItem, this.addFileToolStripMenuItem}); - resources.ApplyResources(this.importSkinsToolStripMenuItem, "importSkinsToolStripMenuItem"); - this.importSkinsToolStripMenuItem.Name = "importSkinsToolStripMenuItem"; - // - // importSkinToolStripMenuItem - // - resources.ApplyResources(this.importSkinToolStripMenuItem, "importSkinToolStripMenuItem"); - this.importSkinToolStripMenuItem.Name = "importSkinToolStripMenuItem"; - this.importSkinToolStripMenuItem.Click += new System.EventHandler(this.importSkinToolStripMenuItem_Click); - // - // importExtractedSkinsFolderToolStripMenuItem - // - resources.ApplyResources(this.importExtractedSkinsFolderToolStripMenuItem, "importExtractedSkinsFolderToolStripMenuItem"); - this.importExtractedSkinsFolderToolStripMenuItem.Name = "importExtractedSkinsFolderToolStripMenuItem"; - this.importExtractedSkinsFolderToolStripMenuItem.Click += new System.EventHandler(this.importExtractedSkinsFolder); - // - // addTextureToolStripMenuItem - // - this.addTextureToolStripMenuItem.Image = global::PckStudio.Properties.Resources.AddTexture; - this.addTextureToolStripMenuItem.Name = "addTextureToolStripMenuItem"; - resources.ApplyResources(this.addTextureToolStripMenuItem, "addTextureToolStripMenuItem"); - this.addTextureToolStripMenuItem.Click += new System.EventHandler(this.addTextureToolStripMenuItem_Click); - // - // addFileToolStripMenuItem - // - this.addFileToolStripMenuItem.Image = global::PckStudio.Properties.Resources.blank; - this.addFileToolStripMenuItem.Name = "addFileToolStripMenuItem"; - resources.ApplyResources(this.addFileToolStripMenuItem, "addFileToolStripMenuItem"); - this.addFileToolStripMenuItem.Click += new System.EventHandler(this.addFileToolStripMenuItem_Click); - // - // exportToolStripMenuItem - // - this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + resources.ApplyResources(this.importSkinsToolStripMenuItem, "importSkinsToolStripMenuItem"); + this.importSkinsToolStripMenuItem.Name = "importSkinsToolStripMenuItem"; + // + // importSkinToolStripMenuItem + // + resources.ApplyResources(this.importSkinToolStripMenuItem, "importSkinToolStripMenuItem"); + this.importSkinToolStripMenuItem.Name = "importSkinToolStripMenuItem"; + this.importSkinToolStripMenuItem.Click += new System.EventHandler(this.importSkinToolStripMenuItem_Click); + // + // importExtractedSkinsFolderToolStripMenuItem + // + resources.ApplyResources(this.importExtractedSkinsFolderToolStripMenuItem, "importExtractedSkinsFolderToolStripMenuItem"); + this.importExtractedSkinsFolderToolStripMenuItem.Name = "importExtractedSkinsFolderToolStripMenuItem"; + this.importExtractedSkinsFolderToolStripMenuItem.Click += new System.EventHandler(this.importExtractedSkinsFolder); + // + // addTextureToolStripMenuItem + // + this.addTextureToolStripMenuItem.Image = global::PckStudio.Properties.Resources.AddTexture; + this.addTextureToolStripMenuItem.Name = "addTextureToolStripMenuItem"; + resources.ApplyResources(this.addTextureToolStripMenuItem, "addTextureToolStripMenuItem"); + this.addTextureToolStripMenuItem.Click += new System.EventHandler(this.addTextureToolStripMenuItem_Click); + // + // addFileToolStripMenuItem + // + this.addFileToolStripMenuItem.Image = global::PckStudio.Properties.Resources.blank; + this.addFileToolStripMenuItem.Name = "addFileToolStripMenuItem"; + resources.ApplyResources(this.addFileToolStripMenuItem, "addFileToolStripMenuItem"); + this.addFileToolStripMenuItem.Click += new System.EventHandler(this.addFileToolStripMenuItem_Click); + // + // exportToolStripMenuItem + // + this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.as3DSTextureFileToolStripMenuItem}); - this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; - resources.ApplyResources(this.exportToolStripMenuItem, "exportToolStripMenuItem"); - // - // as3DSTextureFileToolStripMenuItem - // - this.as3DSTextureFileToolStripMenuItem.Name = "as3DSTextureFileToolStripMenuItem"; - resources.ApplyResources(this.as3DSTextureFileToolStripMenuItem, "as3DSTextureFileToolStripMenuItem"); - this.as3DSTextureFileToolStripMenuItem.Click += new System.EventHandler(this.as3DSTextureFileToolStripMenuItem_Click); - // - // setFileTypeToolStripMenuItem - // - this.setFileTypeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; + resources.ApplyResources(this.exportToolStripMenuItem, "exportToolStripMenuItem"); + // + // as3DSTextureFileToolStripMenuItem + // + this.as3DSTextureFileToolStripMenuItem.Name = "as3DSTextureFileToolStripMenuItem"; + resources.ApplyResources(this.as3DSTextureFileToolStripMenuItem, "as3DSTextureFileToolStripMenuItem"); + this.as3DSTextureFileToolStripMenuItem.Click += new System.EventHandler(this.as3DSTextureFileToolStripMenuItem_Click); + // + // setFileTypeToolStripMenuItem + // + this.setFileTypeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.skinToolStripMenuItem1, this.capeToolStripMenuItem, this.textureToolStripMenuItem, @@ -304,240 +303,233 @@ this.modelsFileBINToolStripMenuItem, this.behavioursFileBINToolStripMenuItem, this.entityMaterialsFileBINToolStripMenuItem}); - this.setFileTypeToolStripMenuItem.Name = "setFileTypeToolStripMenuItem"; - resources.ApplyResources(this.setFileTypeToolStripMenuItem, "setFileTypeToolStripMenuItem"); - // - // skinToolStripMenuItem1 - // - this.skinToolStripMenuItem1.Name = "skinToolStripMenuItem1"; - resources.ApplyResources(this.skinToolStripMenuItem1, "skinToolStripMenuItem1"); - // - // capeToolStripMenuItem - // - this.capeToolStripMenuItem.Name = "capeToolStripMenuItem"; - resources.ApplyResources(this.capeToolStripMenuItem, "capeToolStripMenuItem"); - // - // textureToolStripMenuItem - // - this.textureToolStripMenuItem.Name = "textureToolStripMenuItem"; - resources.ApplyResources(this.textureToolStripMenuItem, "textureToolStripMenuItem"); - // - // languagesFileLOCToolStripMenuItem - // - this.languagesFileLOCToolStripMenuItem.Name = "languagesFileLOCToolStripMenuItem"; - resources.ApplyResources(this.languagesFileLOCToolStripMenuItem, "languagesFileLOCToolStripMenuItem"); - // - // gameRulesFileGRFToolStripMenuItem - // - this.gameRulesFileGRFToolStripMenuItem.Name = "gameRulesFileGRFToolStripMenuItem"; - resources.ApplyResources(this.gameRulesFileGRFToolStripMenuItem, "gameRulesFileGRFToolStripMenuItem"); - // - // audioPCKFileToolStripMenuItem - // - this.audioPCKFileToolStripMenuItem.Name = "audioPCKFileToolStripMenuItem"; - resources.ApplyResources(this.audioPCKFileToolStripMenuItem, "audioPCKFileToolStripMenuItem"); - // - // coloursCOLFileToolStripMenuItem - // - this.coloursCOLFileToolStripMenuItem.Name = "coloursCOLFileToolStripMenuItem"; - resources.ApplyResources(this.coloursCOLFileToolStripMenuItem, "coloursCOLFileToolStripMenuItem"); - // - // gameRulesHeaderGRHToolStripMenuItem - // - this.gameRulesHeaderGRHToolStripMenuItem.Name = "gameRulesHeaderGRHToolStripMenuItem"; - resources.ApplyResources(this.gameRulesHeaderGRHToolStripMenuItem, "gameRulesHeaderGRHToolStripMenuItem"); - // - // skinsPCKToolStripMenuItem - // - this.skinsPCKToolStripMenuItem.Name = "skinsPCKToolStripMenuItem"; - resources.ApplyResources(this.skinsPCKToolStripMenuItem, "skinsPCKToolStripMenuItem"); - // - // modelsFileBINToolStripMenuItem - // - this.modelsFileBINToolStripMenuItem.Name = "modelsFileBINToolStripMenuItem"; - resources.ApplyResources(this.modelsFileBINToolStripMenuItem, "modelsFileBINToolStripMenuItem"); - // - // behavioursFileBINToolStripMenuItem - // - this.behavioursFileBINToolStripMenuItem.Name = "behavioursFileBINToolStripMenuItem"; - resources.ApplyResources(this.behavioursFileBINToolStripMenuItem, "behavioursFileBINToolStripMenuItem"); - // - // entityMaterialsFileBINToolStripMenuItem - // - this.entityMaterialsFileBINToolStripMenuItem.Name = "entityMaterialsFileBINToolStripMenuItem"; - resources.ApplyResources(this.entityMaterialsFileBINToolStripMenuItem, "entityMaterialsFileBINToolStripMenuItem"); - // - // miscFunctionsToolStripMenuItem - // - this.miscFunctionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.setFileTypeToolStripMenuItem.Name = "setFileTypeToolStripMenuItem"; + resources.ApplyResources(this.setFileTypeToolStripMenuItem, "setFileTypeToolStripMenuItem"); + // + // skinToolStripMenuItem1 + // + this.skinToolStripMenuItem1.Name = "skinToolStripMenuItem1"; + resources.ApplyResources(this.skinToolStripMenuItem1, "skinToolStripMenuItem1"); + // + // capeToolStripMenuItem + // + this.capeToolStripMenuItem.Name = "capeToolStripMenuItem"; + resources.ApplyResources(this.capeToolStripMenuItem, "capeToolStripMenuItem"); + // + // textureToolStripMenuItem + // + this.textureToolStripMenuItem.Name = "textureToolStripMenuItem"; + resources.ApplyResources(this.textureToolStripMenuItem, "textureToolStripMenuItem"); + // + // languagesFileLOCToolStripMenuItem + // + this.languagesFileLOCToolStripMenuItem.Name = "languagesFileLOCToolStripMenuItem"; + resources.ApplyResources(this.languagesFileLOCToolStripMenuItem, "languagesFileLOCToolStripMenuItem"); + // + // gameRulesFileGRFToolStripMenuItem + // + this.gameRulesFileGRFToolStripMenuItem.Name = "gameRulesFileGRFToolStripMenuItem"; + resources.ApplyResources(this.gameRulesFileGRFToolStripMenuItem, "gameRulesFileGRFToolStripMenuItem"); + // + // audioPCKFileToolStripMenuItem + // + this.audioPCKFileToolStripMenuItem.Name = "audioPCKFileToolStripMenuItem"; + resources.ApplyResources(this.audioPCKFileToolStripMenuItem, "audioPCKFileToolStripMenuItem"); + // + // coloursCOLFileToolStripMenuItem + // + this.coloursCOLFileToolStripMenuItem.Name = "coloursCOLFileToolStripMenuItem"; + resources.ApplyResources(this.coloursCOLFileToolStripMenuItem, "coloursCOLFileToolStripMenuItem"); + // + // gameRulesHeaderGRHToolStripMenuItem + // + this.gameRulesHeaderGRHToolStripMenuItem.Name = "gameRulesHeaderGRHToolStripMenuItem"; + resources.ApplyResources(this.gameRulesHeaderGRHToolStripMenuItem, "gameRulesHeaderGRHToolStripMenuItem"); + // + // skinsPCKToolStripMenuItem + // + this.skinsPCKToolStripMenuItem.Name = "skinsPCKToolStripMenuItem"; + resources.ApplyResources(this.skinsPCKToolStripMenuItem, "skinsPCKToolStripMenuItem"); + // + // modelsFileBINToolStripMenuItem + // + this.modelsFileBINToolStripMenuItem.Name = "modelsFileBINToolStripMenuItem"; + resources.ApplyResources(this.modelsFileBINToolStripMenuItem, "modelsFileBINToolStripMenuItem"); + // + // behavioursFileBINToolStripMenuItem + // + this.behavioursFileBINToolStripMenuItem.Name = "behavioursFileBINToolStripMenuItem"; + resources.ApplyResources(this.behavioursFileBINToolStripMenuItem, "behavioursFileBINToolStripMenuItem"); + // + // entityMaterialsFileBINToolStripMenuItem + // + this.entityMaterialsFileBINToolStripMenuItem.Name = "entityMaterialsFileBINToolStripMenuItem"; + resources.ApplyResources(this.entityMaterialsFileBINToolStripMenuItem, "entityMaterialsFileBINToolStripMenuItem"); + // + // miscFunctionsToolStripMenuItem + // + this.miscFunctionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.generateMipMapTextureToolStripMenuItem1, this.viewFileInfoToolStripMenuItem, this.correctSkinDecimalsToolStripMenuItem}); - this.miscFunctionsToolStripMenuItem.Name = "miscFunctionsToolStripMenuItem"; - resources.ApplyResources(this.miscFunctionsToolStripMenuItem, "miscFunctionsToolStripMenuItem"); - // - // generateMipMapTextureToolStripMenuItem1 - // - this.generateMipMapTextureToolStripMenuItem1.Name = "generateMipMapTextureToolStripMenuItem1"; - resources.ApplyResources(this.generateMipMapTextureToolStripMenuItem1, "generateMipMapTextureToolStripMenuItem1"); - this.generateMipMapTextureToolStripMenuItem1.Click += new System.EventHandler(this.generateMipMapTextureToolStripMenuItem_Click); - // - // viewFileInfoToolStripMenuItem - // - this.viewFileInfoToolStripMenuItem.Name = "viewFileInfoToolStripMenuItem"; - resources.ApplyResources(this.viewFileInfoToolStripMenuItem, "viewFileInfoToolStripMenuItem"); - this.viewFileInfoToolStripMenuItem.Click += new System.EventHandler(this.viewFileInfoToolStripMenuItem_Click); - // - // correctSkinDecimalsToolStripMenuItem - // - this.correctSkinDecimalsToolStripMenuItem.Name = "correctSkinDecimalsToolStripMenuItem"; - resources.ApplyResources(this.correctSkinDecimalsToolStripMenuItem, "correctSkinDecimalsToolStripMenuItem"); - this.correctSkinDecimalsToolStripMenuItem.Click += new System.EventHandler(this.correctSkinDecimalsToolStripMenuItem_Click); - // - // extractToolStripMenuItem - // - resources.ApplyResources(this.extractToolStripMenuItem, "extractToolStripMenuItem"); - this.extractToolStripMenuItem.Name = "extractToolStripMenuItem"; - this.extractToolStripMenuItem.Click += new System.EventHandler(this.extractToolStripMenuItem_Click); - // - // cloneFileToolStripMenuItem - // - this.cloneFileToolStripMenuItem.Name = "cloneFileToolStripMenuItem"; - resources.ApplyResources(this.cloneFileToolStripMenuItem, "cloneFileToolStripMenuItem"); - this.cloneFileToolStripMenuItem.Click += new System.EventHandler(this.cloneFileToolStripMenuItem_Click); - // - // renameFileToolStripMenuItem - // - resources.ApplyResources(this.renameFileToolStripMenuItem, "renameFileToolStripMenuItem"); - this.renameFileToolStripMenuItem.Name = "renameFileToolStripMenuItem"; - this.renameFileToolStripMenuItem.Click += new System.EventHandler(this.renameFileToolStripMenuItem_Click); - // - // replaceToolStripMenuItem - // - resources.ApplyResources(this.replaceToolStripMenuItem, "replaceToolStripMenuItem"); - this.replaceToolStripMenuItem.Name = "replaceToolStripMenuItem"; - this.replaceToolStripMenuItem.Click += new System.EventHandler(this.replaceToolStripMenuItem_Click); - // - // deleteFileToolStripMenuItem - // - resources.ApplyResources(this.deleteFileToolStripMenuItem, "deleteFileToolStripMenuItem"); - this.deleteFileToolStripMenuItem.Name = "deleteFileToolStripMenuItem"; - this.deleteFileToolStripMenuItem.Click += new System.EventHandler(this.deleteFileToolStripMenuItem_Click); - // - // menuStrip - // - resources.ApplyResources(this.menuStrip, "menuStrip"); - this.menuStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(13)))), ((int)(((byte)(13))))); - this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miscFunctionsToolStripMenuItem.Name = "miscFunctionsToolStripMenuItem"; + resources.ApplyResources(this.miscFunctionsToolStripMenuItem, "miscFunctionsToolStripMenuItem"); + // + // generateMipMapTextureToolStripMenuItem1 + // + this.generateMipMapTextureToolStripMenuItem1.Name = "generateMipMapTextureToolStripMenuItem1"; + resources.ApplyResources(this.generateMipMapTextureToolStripMenuItem1, "generateMipMapTextureToolStripMenuItem1"); + this.generateMipMapTextureToolStripMenuItem1.Click += new System.EventHandler(this.generateMipMapTextureToolStripMenuItem_Click); + // + // viewFileInfoToolStripMenuItem + // + this.viewFileInfoToolStripMenuItem.Name = "viewFileInfoToolStripMenuItem"; + resources.ApplyResources(this.viewFileInfoToolStripMenuItem, "viewFileInfoToolStripMenuItem"); + this.viewFileInfoToolStripMenuItem.Click += new System.EventHandler(this.viewFileInfoToolStripMenuItem_Click); + // + // correctSkinDecimalsToolStripMenuItem + // + this.correctSkinDecimalsToolStripMenuItem.Name = "correctSkinDecimalsToolStripMenuItem"; + resources.ApplyResources(this.correctSkinDecimalsToolStripMenuItem, "correctSkinDecimalsToolStripMenuItem"); + this.correctSkinDecimalsToolStripMenuItem.Click += new System.EventHandler(this.correctSkinDecimalsToolStripMenuItem_Click); + // + // extractToolStripMenuItem + // + resources.ApplyResources(this.extractToolStripMenuItem, "extractToolStripMenuItem"); + this.extractToolStripMenuItem.Name = "extractToolStripMenuItem"; + this.extractToolStripMenuItem.Click += new System.EventHandler(this.extractToolStripMenuItem_Click); + // + // cloneFileToolStripMenuItem + // + this.cloneFileToolStripMenuItem.Name = "cloneFileToolStripMenuItem"; + resources.ApplyResources(this.cloneFileToolStripMenuItem, "cloneFileToolStripMenuItem"); + this.cloneFileToolStripMenuItem.Click += new System.EventHandler(this.cloneFileToolStripMenuItem_Click); + // + // renameFileToolStripMenuItem + // + resources.ApplyResources(this.renameFileToolStripMenuItem, "renameFileToolStripMenuItem"); + this.renameFileToolStripMenuItem.Name = "renameFileToolStripMenuItem"; + this.renameFileToolStripMenuItem.Click += new System.EventHandler(this.renameFileToolStripMenuItem_Click); + // + // replaceToolStripMenuItem + // + resources.ApplyResources(this.replaceToolStripMenuItem, "replaceToolStripMenuItem"); + this.replaceToolStripMenuItem.Name = "replaceToolStripMenuItem"; + this.replaceToolStripMenuItem.Click += new System.EventHandler(this.replaceToolStripMenuItem_Click); + // + // deleteFileToolStripMenuItem + // + resources.ApplyResources(this.deleteFileToolStripMenuItem, "deleteFileToolStripMenuItem"); + this.deleteFileToolStripMenuItem.Name = "deleteFileToolStripMenuItem"; + this.deleteFileToolStripMenuItem.Click += new System.EventHandler(this.deleteFileToolStripMenuItem_Click); + // + // menuStrip + // + resources.ApplyResources(this.menuStrip, "menuStrip"); + this.menuStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(13)))), ((int)(((byte)(13))))); + this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.editToolStripMenuItem, this.helpToolStripMenuItem, this.storeToolStripMenuItem, this.miscToolStripMenuItem}); - this.menuStrip.Name = "menuStrip"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(13)))), ((int)(((byte)(13))))); - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuStrip.Name = "menuStrip"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(13)))), ((int)(((byte)(13))))); + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.newToolStripMenuItem, this.openToolStripMenuItem, this.extractToolStripMenuItem1, this.saveToolStripMenuItem1, this.saveToolStripMenuItem, - this.convertPCTextrurePackToolStripMenuItem, this.closeToolStripMenuItem}); - this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem"); - // - // newToolStripMenuItem - // - this.newToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem"); + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.skinPackToolStripMenuItem, this.texturePackToolStripMenuItem, this.mashUpPackToolStripMenuItem}); - resources.ApplyResources(this.newToolStripMenuItem, "newToolStripMenuItem"); - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - // - // skinPackToolStripMenuItem - // - this.skinPackToolStripMenuItem.Name = "skinPackToolStripMenuItem"; - resources.ApplyResources(this.skinPackToolStripMenuItem, "skinPackToolStripMenuItem"); - this.skinPackToolStripMenuItem.Click += new System.EventHandler(this.skinPackToolStripMenuItem_Click); - // - // texturePackToolStripMenuItem - // - this.texturePackToolStripMenuItem.Name = "texturePackToolStripMenuItem"; - resources.ApplyResources(this.texturePackToolStripMenuItem, "texturePackToolStripMenuItem"); - this.texturePackToolStripMenuItem.Click += new System.EventHandler(this.texturePackToolStripMenuItem_Click); - // - // mashUpPackToolStripMenuItem - // - this.mashUpPackToolStripMenuItem.Name = "mashUpPackToolStripMenuItem"; - resources.ApplyResources(this.mashUpPackToolStripMenuItem, "mashUpPackToolStripMenuItem"); - this.mashUpPackToolStripMenuItem.Click += new System.EventHandler(this.mashUpPackToolStripMenuItem_Click); - // - // openToolStripMenuItem - // - resources.ApplyResources(this.openToolStripMenuItem, "openToolStripMenuItem"); - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - // - // extractToolStripMenuItem1 - // - resources.ApplyResources(this.extractToolStripMenuItem1, "extractToolStripMenuItem1"); - this.extractToolStripMenuItem1.Name = "extractToolStripMenuItem1"; - this.extractToolStripMenuItem1.Click += new System.EventHandler(this.extractToolStripMenuItem1_Click); - // - // saveToolStripMenuItem1 - // - resources.ApplyResources(this.saveToolStripMenuItem1, "saveToolStripMenuItem1"); - this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1"; - this.saveToolStripMenuItem1.Click += new System.EventHandler(this.savePCK); - // - // saveToolStripMenuItem - // - resources.ApplyResources(this.saveToolStripMenuItem, "saveToolStripMenuItem"); - this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveAsPCK); - // - // convertPCTextrurePackToolStripMenuItem - // - resources.ApplyResources(this.convertPCTextrurePackToolStripMenuItem, "convertPCTextrurePackToolStripMenuItem"); - this.convertPCTextrurePackToolStripMenuItem.Name = "convertPCTextrurePackToolStripMenuItem"; - this.convertPCTextrurePackToolStripMenuItem.Click += new System.EventHandler(this.convertPCTextrurePackToolStripMenuItem_Click); - // - // closeToolStripMenuItem - // - this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - resources.ApplyResources(this.closeToolStripMenuItem, "closeToolStripMenuItem"); - this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); - // - // editToolStripMenuItem - // - this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + resources.ApplyResources(this.newToolStripMenuItem, "newToolStripMenuItem"); + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + // + // skinPackToolStripMenuItem + // + this.skinPackToolStripMenuItem.Name = "skinPackToolStripMenuItem"; + resources.ApplyResources(this.skinPackToolStripMenuItem, "skinPackToolStripMenuItem"); + this.skinPackToolStripMenuItem.Click += new System.EventHandler(this.skinPackToolStripMenuItem_Click); + // + // texturePackToolStripMenuItem + // + this.texturePackToolStripMenuItem.Name = "texturePackToolStripMenuItem"; + resources.ApplyResources(this.texturePackToolStripMenuItem, "texturePackToolStripMenuItem"); + this.texturePackToolStripMenuItem.Click += new System.EventHandler(this.texturePackToolStripMenuItem_Click); + // + // mashUpPackToolStripMenuItem + // + this.mashUpPackToolStripMenuItem.Name = "mashUpPackToolStripMenuItem"; + resources.ApplyResources(this.mashUpPackToolStripMenuItem, "mashUpPackToolStripMenuItem"); + this.mashUpPackToolStripMenuItem.Click += new System.EventHandler(this.mashUpPackToolStripMenuItem_Click); + // + // openToolStripMenuItem + // + resources.ApplyResources(this.openToolStripMenuItem, "openToolStripMenuItem"); + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // extractToolStripMenuItem1 + // + resources.ApplyResources(this.extractToolStripMenuItem1, "extractToolStripMenuItem1"); + this.extractToolStripMenuItem1.Name = "extractToolStripMenuItem1"; + this.extractToolStripMenuItem1.Click += new System.EventHandler(this.extractToolStripMenuItem1_Click); + // + // saveToolStripMenuItem1 + // + resources.ApplyResources(this.saveToolStripMenuItem1, "saveToolStripMenuItem1"); + this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1"; + this.saveToolStripMenuItem1.Click += new System.EventHandler(this.savePCK); + // + // saveToolStripMenuItem + // + resources.ApplyResources(this.saveToolStripMenuItem, "saveToolStripMenuItem"); + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveAsPCK); + // + // closeToolStripMenuItem + // + this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; + resources.ApplyResources(this.closeToolStripMenuItem, "closeToolStripMenuItem"); + this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); + // + // editToolStripMenuItem + // + this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.advancedMetaAddingToolStripMenuItem, this.convertToBedrockToolStripMenuItem}); - this.editToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.editToolStripMenuItem.Name = "editToolStripMenuItem"; - resources.ApplyResources(this.editToolStripMenuItem, "editToolStripMenuItem"); - // - // advancedMetaAddingToolStripMenuItem - // - resources.ApplyResources(this.advancedMetaAddingToolStripMenuItem, "advancedMetaAddingToolStripMenuItem"); - this.advancedMetaAddingToolStripMenuItem.Name = "advancedMetaAddingToolStripMenuItem"; - this.advancedMetaAddingToolStripMenuItem.Click += new System.EventHandler(this.advancedMetaAddingToolStripMenuItem_Click); - // - // convertToBedrockToolStripMenuItem - // - resources.ApplyResources(this.convertToBedrockToolStripMenuItem, "convertToBedrockToolStripMenuItem"); - this.convertToBedrockToolStripMenuItem.Name = "convertToBedrockToolStripMenuItem"; - this.convertToBedrockToolStripMenuItem.Click += new System.EventHandler(this.convertToBedrockToolStripMenuItem_Click); - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.editToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.editToolStripMenuItem.Name = "editToolStripMenuItem"; + resources.ApplyResources(this.editToolStripMenuItem, "editToolStripMenuItem"); + // + // advancedMetaAddingToolStripMenuItem + // + resources.ApplyResources(this.advancedMetaAddingToolStripMenuItem, "advancedMetaAddingToolStripMenuItem"); + this.advancedMetaAddingToolStripMenuItem.Name = "advancedMetaAddingToolStripMenuItem"; + this.advancedMetaAddingToolStripMenuItem.Click += new System.EventHandler(this.advancedMetaAddingToolStripMenuItem_Click); + // + // convertToBedrockToolStripMenuItem + // + resources.ApplyResources(this.convertToBedrockToolStripMenuItem, "convertToBedrockToolStripMenuItem"); + this.convertToBedrockToolStripMenuItem.Name = "convertToBedrockToolStripMenuItem"; + this.convertToBedrockToolStripMenuItem.Click += new System.EventHandler(this.convertToBedrockToolStripMenuItem_Click); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.programInfoToolStripMenuItem, this.binkaConversionToolStripMenuItem, this.videosToolStripMenuItem, @@ -546,25 +538,25 @@ this.donateToolStripMenuItem, this.settingsToolStripMenuItem, this.administrativeToolsToolStripMenuItem}); - this.helpToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - resources.ApplyResources(this.helpToolStripMenuItem, "helpToolStripMenuItem"); - // - // programInfoToolStripMenuItem - // - resources.ApplyResources(this.programInfoToolStripMenuItem, "programInfoToolStripMenuItem"); - this.programInfoToolStripMenuItem.Name = "programInfoToolStripMenuItem"; - this.programInfoToolStripMenuItem.Click += new System.EventHandler(this.programInfoToolStripMenuItem_Click); - // - // binkaConversionToolStripMenuItem - // - resources.ApplyResources(this.binkaConversionToolStripMenuItem, "binkaConversionToolStripMenuItem"); - this.binkaConversionToolStripMenuItem.Name = "binkaConversionToolStripMenuItem"; - this.binkaConversionToolStripMenuItem.Click += new System.EventHandler(this.binkaConversionToolStripMenuItem_Click); - // - // videosToolStripMenuItem - // - this.videosToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.helpToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + resources.ApplyResources(this.helpToolStripMenuItem, "helpToolStripMenuItem"); + // + // programInfoToolStripMenuItem + // + resources.ApplyResources(this.programInfoToolStripMenuItem, "programInfoToolStripMenuItem"); + this.programInfoToolStripMenuItem.Name = "programInfoToolStripMenuItem"; + this.programInfoToolStripMenuItem.Click += new System.EventHandler(this.programInfoToolStripMenuItem_Click); + // + // binkaConversionToolStripMenuItem + // + resources.ApplyResources(this.binkaConversionToolStripMenuItem, "binkaConversionToolStripMenuItem"); + this.binkaConversionToolStripMenuItem.Name = "binkaConversionToolStripMenuItem"; + this.binkaConversionToolStripMenuItem.Click += new System.EventHandler(this.binkaConversionToolStripMenuItem_Click); + // + // videosToolStripMenuItem + // + this.videosToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.howToMakeABasicSkinPackToolStripMenuItem, this.howToMakeACustomSkinModelToolStripMenuItem, this.howToMakeCustomSkinModelsbedrockToolStripMenuItem, @@ -572,539 +564,539 @@ this.howToInstallPcksDirectlyToWiiUToolStripMenuItem, this.pCKCenterReleaseToolStripMenuItem, this.howPCKsWorkToolStripMenuItem}); - this.videosToolStripMenuItem.ForeColor = System.Drawing.Color.Black; - resources.ApplyResources(this.videosToolStripMenuItem, "videosToolStripMenuItem"); - this.videosToolStripMenuItem.Name = "videosToolStripMenuItem"; - // - // howToMakeABasicSkinPackToolStripMenuItem - // - resources.ApplyResources(this.howToMakeABasicSkinPackToolStripMenuItem, "howToMakeABasicSkinPackToolStripMenuItem"); - this.howToMakeABasicSkinPackToolStripMenuItem.Name = "howToMakeABasicSkinPackToolStripMenuItem"; - this.howToMakeABasicSkinPackToolStripMenuItem.Click += new System.EventHandler(this.howToMakeABasicSkinPackToolStripMenuItem_Click); - // - // howToMakeACustomSkinModelToolStripMenuItem - // - resources.ApplyResources(this.howToMakeACustomSkinModelToolStripMenuItem, "howToMakeACustomSkinModelToolStripMenuItem"); - this.howToMakeACustomSkinModelToolStripMenuItem.Name = "howToMakeACustomSkinModelToolStripMenuItem"; - this.howToMakeACustomSkinModelToolStripMenuItem.Click += new System.EventHandler(this.howToMakeACustomSkinModelToolStripMenuItem_Click); - // - // howToMakeCustomSkinModelsbedrockToolStripMenuItem - // - resources.ApplyResources(this.howToMakeCustomSkinModelsbedrockToolStripMenuItem, "howToMakeCustomSkinModelsbedrockToolStripMenuItem"); - this.howToMakeCustomSkinModelsbedrockToolStripMenuItem.Name = "howToMakeCustomSkinModelsbedrockToolStripMenuItem"; - this.howToMakeCustomSkinModelsbedrockToolStripMenuItem.Click += new System.EventHandler(this.howToMakeCustomSkinModelsbedrockToolStripMenuItem_Click); - // - // howToMakeCustomMusicToolStripMenuItem - // - resources.ApplyResources(this.howToMakeCustomMusicToolStripMenuItem, "howToMakeCustomMusicToolStripMenuItem"); - this.howToMakeCustomMusicToolStripMenuItem.Name = "howToMakeCustomMusicToolStripMenuItem"; - this.howToMakeCustomMusicToolStripMenuItem.Click += new System.EventHandler(this.howToMakeCustomMusicToolStripMenuItem_Click); - // - // howToInstallPcksDirectlyToWiiUToolStripMenuItem - // - resources.ApplyResources(this.howToInstallPcksDirectlyToWiiUToolStripMenuItem, "howToInstallPcksDirectlyToWiiUToolStripMenuItem"); - this.howToInstallPcksDirectlyToWiiUToolStripMenuItem.Name = "howToInstallPcksDirectlyToWiiUToolStripMenuItem"; - this.howToInstallPcksDirectlyToWiiUToolStripMenuItem.Click += new System.EventHandler(this.howToInstallPcksDirectlyToWiiUToolStripMenuItem_Click); - // - // pCKCenterReleaseToolStripMenuItem - // - resources.ApplyResources(this.pCKCenterReleaseToolStripMenuItem, "pCKCenterReleaseToolStripMenuItem"); - this.pCKCenterReleaseToolStripMenuItem.Name = "pCKCenterReleaseToolStripMenuItem"; - this.pCKCenterReleaseToolStripMenuItem.Click += new System.EventHandler(this.pCKCenterReleaseToolStripMenuItem_Click); - // - // howPCKsWorkToolStripMenuItem - // - resources.ApplyResources(this.howPCKsWorkToolStripMenuItem, "howPCKsWorkToolStripMenuItem"); - this.howPCKsWorkToolStripMenuItem.Name = "howPCKsWorkToolStripMenuItem"; - this.howPCKsWorkToolStripMenuItem.Click += new System.EventHandler(this.howPCKsWorkToolStripMenuItem_Click); - // - // installationToolStripMenuItem - // - resources.ApplyResources(this.installationToolStripMenuItem, "installationToolStripMenuItem"); - this.installationToolStripMenuItem.Name = "installationToolStripMenuItem"; - // - // fAQToolStripMenuItem1 - // - resources.ApplyResources(this.fAQToolStripMenuItem1, "fAQToolStripMenuItem1"); - this.fAQToolStripMenuItem1.Name = "fAQToolStripMenuItem1"; - this.fAQToolStripMenuItem1.Click += new System.EventHandler(this.fAQToolStripMenuItem1_Click); - // - // donateToolStripMenuItem - // - this.donateToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.videosToolStripMenuItem.ForeColor = System.Drawing.Color.Black; + resources.ApplyResources(this.videosToolStripMenuItem, "videosToolStripMenuItem"); + this.videosToolStripMenuItem.Name = "videosToolStripMenuItem"; + // + // howToMakeABasicSkinPackToolStripMenuItem + // + resources.ApplyResources(this.howToMakeABasicSkinPackToolStripMenuItem, "howToMakeABasicSkinPackToolStripMenuItem"); + this.howToMakeABasicSkinPackToolStripMenuItem.Name = "howToMakeABasicSkinPackToolStripMenuItem"; + this.howToMakeABasicSkinPackToolStripMenuItem.Click += new System.EventHandler(this.howToMakeABasicSkinPackToolStripMenuItem_Click); + // + // howToMakeACustomSkinModelToolStripMenuItem + // + resources.ApplyResources(this.howToMakeACustomSkinModelToolStripMenuItem, "howToMakeACustomSkinModelToolStripMenuItem"); + this.howToMakeACustomSkinModelToolStripMenuItem.Name = "howToMakeACustomSkinModelToolStripMenuItem"; + this.howToMakeACustomSkinModelToolStripMenuItem.Click += new System.EventHandler(this.howToMakeACustomSkinModelToolStripMenuItem_Click); + // + // howToMakeCustomSkinModelsbedrockToolStripMenuItem + // + resources.ApplyResources(this.howToMakeCustomSkinModelsbedrockToolStripMenuItem, "howToMakeCustomSkinModelsbedrockToolStripMenuItem"); + this.howToMakeCustomSkinModelsbedrockToolStripMenuItem.Name = "howToMakeCustomSkinModelsbedrockToolStripMenuItem"; + this.howToMakeCustomSkinModelsbedrockToolStripMenuItem.Click += new System.EventHandler(this.howToMakeCustomSkinModelsbedrockToolStripMenuItem_Click); + // + // howToMakeCustomMusicToolStripMenuItem + // + resources.ApplyResources(this.howToMakeCustomMusicToolStripMenuItem, "howToMakeCustomMusicToolStripMenuItem"); + this.howToMakeCustomMusicToolStripMenuItem.Name = "howToMakeCustomMusicToolStripMenuItem"; + this.howToMakeCustomMusicToolStripMenuItem.Click += new System.EventHandler(this.howToMakeCustomMusicToolStripMenuItem_Click); + // + // howToInstallPcksDirectlyToWiiUToolStripMenuItem + // + resources.ApplyResources(this.howToInstallPcksDirectlyToWiiUToolStripMenuItem, "howToInstallPcksDirectlyToWiiUToolStripMenuItem"); + this.howToInstallPcksDirectlyToWiiUToolStripMenuItem.Name = "howToInstallPcksDirectlyToWiiUToolStripMenuItem"; + this.howToInstallPcksDirectlyToWiiUToolStripMenuItem.Click += new System.EventHandler(this.howToInstallPcksDirectlyToWiiUToolStripMenuItem_Click); + // + // pCKCenterReleaseToolStripMenuItem + // + resources.ApplyResources(this.pCKCenterReleaseToolStripMenuItem, "pCKCenterReleaseToolStripMenuItem"); + this.pCKCenterReleaseToolStripMenuItem.Name = "pCKCenterReleaseToolStripMenuItem"; + this.pCKCenterReleaseToolStripMenuItem.Click += new System.EventHandler(this.pCKCenterReleaseToolStripMenuItem_Click); + // + // howPCKsWorkToolStripMenuItem + // + resources.ApplyResources(this.howPCKsWorkToolStripMenuItem, "howPCKsWorkToolStripMenuItem"); + this.howPCKsWorkToolStripMenuItem.Name = "howPCKsWorkToolStripMenuItem"; + this.howPCKsWorkToolStripMenuItem.Click += new System.EventHandler(this.howPCKsWorkToolStripMenuItem_Click); + // + // installationToolStripMenuItem + // + resources.ApplyResources(this.installationToolStripMenuItem, "installationToolStripMenuItem"); + this.installationToolStripMenuItem.Name = "installationToolStripMenuItem"; + // + // fAQToolStripMenuItem1 + // + resources.ApplyResources(this.fAQToolStripMenuItem1, "fAQToolStripMenuItem1"); + this.fAQToolStripMenuItem1.Name = "fAQToolStripMenuItem1"; + this.fAQToolStripMenuItem1.Click += new System.EventHandler(this.fAQToolStripMenuItem1_Click); + // + // donateToolStripMenuItem + // + this.donateToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toNobledezJackToolStripMenuItem, this.toPhoenixARCDeveloperToolStripMenuItem, this.forMattNLContributorToolStripMenuItem}); - this.donateToolStripMenuItem.Name = "donateToolStripMenuItem"; - resources.ApplyResources(this.donateToolStripMenuItem, "donateToolStripMenuItem"); - // - // toNobledezJackToolStripMenuItem - // - this.toNobledezJackToolStripMenuItem.Name = "toNobledezJackToolStripMenuItem"; - resources.ApplyResources(this.toNobledezJackToolStripMenuItem, "toNobledezJackToolStripMenuItem"); - this.toNobledezJackToolStripMenuItem.Click += new System.EventHandler(this.toNobledezJackToolStripMenuItem_Click); - // - // toPhoenixARCDeveloperToolStripMenuItem - // - this.toPhoenixARCDeveloperToolStripMenuItem.Name = "toPhoenixARCDeveloperToolStripMenuItem"; - resources.ApplyResources(this.toPhoenixARCDeveloperToolStripMenuItem, "toPhoenixARCDeveloperToolStripMenuItem"); - this.toPhoenixARCDeveloperToolStripMenuItem.Click += new System.EventHandler(this.toPhoenixARCDeveloperToolStripMenuItem_Click); - // - // forMattNLContributorToolStripMenuItem - // - this.forMattNLContributorToolStripMenuItem.Name = "forMattNLContributorToolStripMenuItem"; - resources.ApplyResources(this.forMattNLContributorToolStripMenuItem, "forMattNLContributorToolStripMenuItem"); - this.forMattNLContributorToolStripMenuItem.Click += new System.EventHandler(this.forMattNLContributorToolStripMenuItem_Click); - // - // settingsToolStripMenuItem - // - this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; - resources.ApplyResources(this.settingsToolStripMenuItem, "settingsToolStripMenuItem"); - this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click); - // - // administrativeToolsToolStripMenuItem - // - resources.ApplyResources(this.administrativeToolsToolStripMenuItem, "administrativeToolsToolStripMenuItem"); - this.administrativeToolsToolStripMenuItem.Name = "administrativeToolsToolStripMenuItem"; - this.administrativeToolsToolStripMenuItem.Click += new System.EventHandler(this.administrativeToolsToolStripMenuItem_Click); - // - // storeToolStripMenuItem - // - this.storeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.donateToolStripMenuItem.Name = "donateToolStripMenuItem"; + resources.ApplyResources(this.donateToolStripMenuItem, "donateToolStripMenuItem"); + // + // toNobledezJackToolStripMenuItem + // + this.toNobledezJackToolStripMenuItem.Name = "toNobledezJackToolStripMenuItem"; + resources.ApplyResources(this.toNobledezJackToolStripMenuItem, "toNobledezJackToolStripMenuItem"); + this.toNobledezJackToolStripMenuItem.Click += new System.EventHandler(this.toNobledezJackToolStripMenuItem_Click); + // + // toPhoenixARCDeveloperToolStripMenuItem + // + this.toPhoenixARCDeveloperToolStripMenuItem.Name = "toPhoenixARCDeveloperToolStripMenuItem"; + resources.ApplyResources(this.toPhoenixARCDeveloperToolStripMenuItem, "toPhoenixARCDeveloperToolStripMenuItem"); + this.toPhoenixARCDeveloperToolStripMenuItem.Click += new System.EventHandler(this.toPhoenixARCDeveloperToolStripMenuItem_Click); + // + // forMattNLContributorToolStripMenuItem + // + this.forMattNLContributorToolStripMenuItem.Name = "forMattNLContributorToolStripMenuItem"; + resources.ApplyResources(this.forMattNLContributorToolStripMenuItem, "forMattNLContributorToolStripMenuItem"); + this.forMattNLContributorToolStripMenuItem.Click += new System.EventHandler(this.forMattNLContributorToolStripMenuItem_Click); + // + // settingsToolStripMenuItem + // + this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; + resources.ApplyResources(this.settingsToolStripMenuItem, "settingsToolStripMenuItem"); + this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click); + // + // administrativeToolsToolStripMenuItem + // + resources.ApplyResources(this.administrativeToolsToolStripMenuItem, "administrativeToolsToolStripMenuItem"); + this.administrativeToolsToolStripMenuItem.Name = "administrativeToolsToolStripMenuItem"; + this.administrativeToolsToolStripMenuItem.Click += new System.EventHandler(this.administrativeToolsToolStripMenuItem_Click); + // + // storeToolStripMenuItem + // + this.storeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.openToolStripMenuItem1, this.wiiUPCKInstallerToolStripMenuItem, this.PS3PCKInstallerToolStripMenuItem, this.VitaPCKInstallerToolStripMenuItem, this.joinDevelopmentDiscordToolStripMenuItem, this.trelloBoardToolStripMenuItem}); - this.storeToolStripMenuItem.ForeColor = System.Drawing.Color.White; - resources.ApplyResources(this.storeToolStripMenuItem, "storeToolStripMenuItem"); - this.storeToolStripMenuItem.Name = "storeToolStripMenuItem"; - // - // openToolStripMenuItem1 - // - resources.ApplyResources(this.openToolStripMenuItem1, "openToolStripMenuItem1"); - this.openToolStripMenuItem1.Name = "openToolStripMenuItem1"; - this.openToolStripMenuItem1.Click += new System.EventHandler(this.openToolStripMenuItem1_Click); - // - // wiiUPCKInstallerToolStripMenuItem - // - resources.ApplyResources(this.wiiUPCKInstallerToolStripMenuItem, "wiiUPCKInstallerToolStripMenuItem"); - this.wiiUPCKInstallerToolStripMenuItem.Name = "wiiUPCKInstallerToolStripMenuItem"; - this.wiiUPCKInstallerToolStripMenuItem.Click += new System.EventHandler(this.wiiUPCKInstallerToolStripMenuItem_Click); - // - // PS3PCKInstallerToolStripMenuItem - // - resources.ApplyResources(this.PS3PCKInstallerToolStripMenuItem, "PS3PCKInstallerToolStripMenuItem"); - this.PS3PCKInstallerToolStripMenuItem.Name = "PS3PCKInstallerToolStripMenuItem"; - this.PS3PCKInstallerToolStripMenuItem.Click += new System.EventHandler(this.PS3PCKInstallerToolStripMenuItem_Click); - // - // VitaPCKInstallerToolStripMenuItem - // - resources.ApplyResources(this.VitaPCKInstallerToolStripMenuItem, "VitaPCKInstallerToolStripMenuItem"); - this.VitaPCKInstallerToolStripMenuItem.Name = "VitaPCKInstallerToolStripMenuItem"; - this.VitaPCKInstallerToolStripMenuItem.Click += new System.EventHandler(this.VitaPCKInstallerToolStripMenuItem_Click); - // - // joinDevelopmentDiscordToolStripMenuItem - // - resources.ApplyResources(this.joinDevelopmentDiscordToolStripMenuItem, "joinDevelopmentDiscordToolStripMenuItem"); - this.joinDevelopmentDiscordToolStripMenuItem.Name = "joinDevelopmentDiscordToolStripMenuItem"; - this.joinDevelopmentDiscordToolStripMenuItem.Click += new System.EventHandler(this.joinDevelopmentDiscordToolStripMenuItem_Click); - // - // trelloBoardToolStripMenuItem - // - this.trelloBoardToolStripMenuItem.Name = "trelloBoardToolStripMenuItem"; - resources.ApplyResources(this.trelloBoardToolStripMenuItem, "trelloBoardToolStripMenuItem"); - this.trelloBoardToolStripMenuItem.Click += new System.EventHandler(this.trelloBoardToolStripMenuItem_Click); - // - // miscToolStripMenuItem - // - this.miscToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.storeToolStripMenuItem.ForeColor = System.Drawing.Color.White; + resources.ApplyResources(this.storeToolStripMenuItem, "storeToolStripMenuItem"); + this.storeToolStripMenuItem.Name = "storeToolStripMenuItem"; + // + // openToolStripMenuItem1 + // + resources.ApplyResources(this.openToolStripMenuItem1, "openToolStripMenuItem1"); + this.openToolStripMenuItem1.Name = "openToolStripMenuItem1"; + this.openToolStripMenuItem1.Click += new System.EventHandler(this.openToolStripMenuItem1_Click); + // + // wiiUPCKInstallerToolStripMenuItem + // + resources.ApplyResources(this.wiiUPCKInstallerToolStripMenuItem, "wiiUPCKInstallerToolStripMenuItem"); + this.wiiUPCKInstallerToolStripMenuItem.Name = "wiiUPCKInstallerToolStripMenuItem"; + this.wiiUPCKInstallerToolStripMenuItem.Click += new System.EventHandler(this.wiiUPCKInstallerToolStripMenuItem_Click); + // + // PS3PCKInstallerToolStripMenuItem + // + resources.ApplyResources(this.PS3PCKInstallerToolStripMenuItem, "PS3PCKInstallerToolStripMenuItem"); + this.PS3PCKInstallerToolStripMenuItem.Name = "PS3PCKInstallerToolStripMenuItem"; + this.PS3PCKInstallerToolStripMenuItem.Click += new System.EventHandler(this.PS3PCKInstallerToolStripMenuItem_Click); + // + // VitaPCKInstallerToolStripMenuItem + // + resources.ApplyResources(this.VitaPCKInstallerToolStripMenuItem, "VitaPCKInstallerToolStripMenuItem"); + this.VitaPCKInstallerToolStripMenuItem.Name = "VitaPCKInstallerToolStripMenuItem"; + this.VitaPCKInstallerToolStripMenuItem.Click += new System.EventHandler(this.VitaPCKInstallerToolStripMenuItem_Click); + // + // joinDevelopmentDiscordToolStripMenuItem + // + resources.ApplyResources(this.joinDevelopmentDiscordToolStripMenuItem, "joinDevelopmentDiscordToolStripMenuItem"); + this.joinDevelopmentDiscordToolStripMenuItem.Name = "joinDevelopmentDiscordToolStripMenuItem"; + this.joinDevelopmentDiscordToolStripMenuItem.Click += new System.EventHandler(this.joinDevelopmentDiscordToolStripMenuItem_Click); + // + // trelloBoardToolStripMenuItem + // + this.trelloBoardToolStripMenuItem.Name = "trelloBoardToolStripMenuItem"; + resources.ApplyResources(this.trelloBoardToolStripMenuItem, "trelloBoardToolStripMenuItem"); + this.trelloBoardToolStripMenuItem.Click += new System.EventHandler(this.trelloBoardToolStripMenuItem_Click); + // + // miscToolStripMenuItem + // + this.miscToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addCustomPackImageToolStripMenuItem, this.convertMusicFilesToolStripMenuItem}); - this.miscToolStripMenuItem.ForeColor = System.Drawing.Color.White; - this.miscToolStripMenuItem.Name = "miscToolStripMenuItem"; - resources.ApplyResources(this.miscToolStripMenuItem, "miscToolStripMenuItem"); - // - // addCustomPackImageToolStripMenuItem - // - resources.ApplyResources(this.addCustomPackImageToolStripMenuItem, "addCustomPackImageToolStripMenuItem"); - this.addCustomPackImageToolStripMenuItem.Name = "addCustomPackImageToolStripMenuItem"; - this.addCustomPackImageToolStripMenuItem.Click += new System.EventHandler(this.addCustomPackIconToolStripMenuItem_Click); - // - // contextMenuMetaTree - // - this.contextMenuMetaTree.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miscToolStripMenuItem.ForeColor = System.Drawing.Color.White; + this.miscToolStripMenuItem.Name = "miscToolStripMenuItem"; + resources.ApplyResources(this.miscToolStripMenuItem, "miscToolStripMenuItem"); + // + // addCustomPackImageToolStripMenuItem + // + resources.ApplyResources(this.addCustomPackImageToolStripMenuItem, "addCustomPackImageToolStripMenuItem"); + this.addCustomPackImageToolStripMenuItem.Name = "addCustomPackImageToolStripMenuItem"; + this.addCustomPackImageToolStripMenuItem.Click += new System.EventHandler(this.addCustomPackIconToolStripMenuItem_Click); + // + // convertMusicFilesToolStripMenuItem + // + this.convertMusicFilesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.wavBinkaToolStripMenuItem, + this.binkaWavToolStripMenuItem}); + this.convertMusicFilesToolStripMenuItem.Name = "convertMusicFilesToolStripMenuItem"; + resources.ApplyResources(this.convertMusicFilesToolStripMenuItem, "convertMusicFilesToolStripMenuItem"); + // + // wavBinkaToolStripMenuItem + // + this.wavBinkaToolStripMenuItem.Name = "wavBinkaToolStripMenuItem"; + resources.ApplyResources(this.wavBinkaToolStripMenuItem, "wavBinkaToolStripMenuItem"); + this.wavBinkaToolStripMenuItem.Click += new System.EventHandler(this.wavBinkaToolStripMenuItem_Click); + // + // binkaWavToolStripMenuItem + // + this.binkaWavToolStripMenuItem.Name = "binkaWavToolStripMenuItem"; + resources.ApplyResources(this.binkaWavToolStripMenuItem, "binkaWavToolStripMenuItem"); + this.binkaWavToolStripMenuItem.Click += new System.EventHandler(this.binkaWavToolStripMenuItem_Click); + // + // contextMenuMetaTree + // + this.contextMenuMetaTree.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addEntryToolStripMenuItem, this.addMultipleEntriesToolStripMenuItem1, this.deleteEntryToolStripMenuItem, this.editAllEntriesToolStripMenuItem}); - this.contextMenuMetaTree.Name = "contextMenuStrip1"; - resources.ApplyResources(this.contextMenuMetaTree, "contextMenuMetaTree"); - // - // addEntryToolStripMenuItem - // - resources.ApplyResources(this.addEntryToolStripMenuItem, "addEntryToolStripMenuItem"); - this.addEntryToolStripMenuItem.Name = "addEntryToolStripMenuItem"; - this.addEntryToolStripMenuItem.Click += new System.EventHandler(this.addEntryToolStripMenuItem_Click_1); - // - // addMultipleEntriesToolStripMenuItem1 - // - resources.ApplyResources(this.addMultipleEntriesToolStripMenuItem1, "addMultipleEntriesToolStripMenuItem1"); - this.addMultipleEntriesToolStripMenuItem1.Name = "addMultipleEntriesToolStripMenuItem1"; - this.addMultipleEntriesToolStripMenuItem1.Click += new System.EventHandler(this.addMultipleEntriesToolStripMenuItem1_Click); - // - // deleteEntryToolStripMenuItem - // - resources.ApplyResources(this.deleteEntryToolStripMenuItem, "deleteEntryToolStripMenuItem"); - this.deleteEntryToolStripMenuItem.Name = "deleteEntryToolStripMenuItem"; - this.deleteEntryToolStripMenuItem.Click += new System.EventHandler(this.deleteEntryToolStripMenuItem_Click); - // - // editAllEntriesToolStripMenuItem - // - this.editAllEntriesToolStripMenuItem.Name = "editAllEntriesToolStripMenuItem"; - resources.ApplyResources(this.editAllEntriesToolStripMenuItem, "editAllEntriesToolStripMenuItem"); - this.editAllEntriesToolStripMenuItem.Click += new System.EventHandler(this.editAllEntriesToolStripMenuItem_Click); - // - // pictureBox2 - // - resources.ApplyResources(this.pictureBox2, "pictureBox2"); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.TabStop = false; - // - // tabControl - // - this.tabControl.Controls.Add(this.openTab); - this.tabControl.Controls.Add(this.editorTab); - resources.ApplyResources(this.tabControl, "tabControl"); - this.tabControl.Name = "tabControl"; - this.tabControl.SelectedIndex = 0; - this.tabControl.Style = MetroFramework.MetroColorStyle.Silver; - this.tabControl.TabStop = false; - this.tabControl.Theme = MetroFramework.MetroThemeStyle.Dark; - this.tabControl.UseSelectable = true; - this.tabControl.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.tabControl_Selecting); - // - // openTab - // - this.openTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18))))); - this.openTab.Controls.Add(this.pckOpen); - this.openTab.Controls.Add(this.label5); - this.openTab.Controls.Add(this.labelVersion); - this.openTab.Controls.Add(this.ChangelogRichTextBox); - this.openTab.ForeColor = System.Drawing.Color.Transparent; - this.openTab.HorizontalScrollbarBarColor = true; - this.openTab.HorizontalScrollbarHighlightOnWheel = false; - this.openTab.HorizontalScrollbarSize = 10; - resources.ApplyResources(this.openTab, "openTab"); - this.openTab.Name = "openTab"; - this.openTab.Style = MetroFramework.MetroColorStyle.Black; - this.openTab.Theme = MetroFramework.MetroThemeStyle.Dark; - this.openTab.UseStyleColors = true; - this.openTab.VerticalScrollbarBarColor = false; - this.openTab.VerticalScrollbarHighlightOnWheel = false; - this.openTab.VerticalScrollbarSize = 10; - // - // pckOpen - // - this.pckOpen.BackColor = System.Drawing.Color.Transparent; - resources.ApplyResources(this.pckOpen, "pckOpen"); - this.pckOpen.Name = "pckOpen"; - this.pckOpen.TabStop = false; - this.pckOpen.Click += new System.EventHandler(this.OpenPck_Click); - this.pckOpen.DragDrop += new System.Windows.Forms.DragEventHandler(this.OpenPck_DragDrop); - this.pckOpen.DragEnter += new System.Windows.Forms.DragEventHandler(this.OpenPck_DragEnter); - this.pckOpen.DragLeave += new System.EventHandler(this.OpenPck_DragLeave); - this.pckOpen.MouseEnter += new System.EventHandler(this.OpenPck_MouseEnter); - this.pckOpen.MouseLeave += new System.EventHandler(this.OpenPck_MouseLeave); - // - // label5 - // - resources.ApplyResources(this.label5, "label5"); - this.label5.BackColor = System.Drawing.Color.Transparent; - this.label5.ForeColor = System.Drawing.Color.White; - this.label5.Name = "label5"; - this.label5.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // labelVersion - // - resources.ApplyResources(this.labelVersion, "labelVersion"); - this.labelVersion.ForeColor = System.Drawing.Color.White; - this.labelVersion.Name = "labelVersion"; - this.labelVersion.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // ChangelogRichTextBox - // - this.ChangelogRichTextBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(13)))), ((int)(((byte)(13))))); - this.ChangelogRichTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - resources.ApplyResources(this.ChangelogRichTextBox, "ChangelogRichTextBox"); - this.ChangelogRichTextBox.ForeColor = System.Drawing.Color.White; - this.ChangelogRichTextBox.Name = "ChangelogRichTextBox"; - this.ChangelogRichTextBox.ReadOnly = true; - // - // editorTab - // - this.editorTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18))))); - resources.ApplyResources(this.editorTab, "editorTab"); - this.editorTab.Controls.Add(this.pckFileLabel); - this.editorTab.Controls.Add(this.labelImageSize); - this.editorTab.Controls.Add(this.fileEntryCountLabel); - this.editorTab.Controls.Add(this.PropertiesTabControl); - this.editorTab.Controls.Add(this.label11); - this.editorTab.Controls.Add(this.treeViewMain); - this.editorTab.Controls.Add(this.pictureBox2); - this.editorTab.Controls.Add(this.pictureBoxImagePreview); - this.editorTab.ForeColor = System.Drawing.Color.Transparent; - this.editorTab.HorizontalScrollbarBarColor = true; - this.editorTab.HorizontalScrollbarHighlightOnWheel = false; - this.editorTab.HorizontalScrollbarSize = 0; - this.editorTab.Name = "editorTab"; - this.editorTab.Style = MetroFramework.MetroColorStyle.White; - this.editorTab.Theme = MetroFramework.MetroThemeStyle.Dark; - this.editorTab.VerticalScrollbarBarColor = true; - this.editorTab.VerticalScrollbarHighlightOnWheel = false; - this.editorTab.VerticalScrollbarSize = 0; - // - // pckFileLabel - // - resources.ApplyResources(this.pckFileLabel, "pckFileLabel"); - this.pckFileLabel.Name = "pckFileLabel"; - this.pckFileLabel.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // labelImageSize - // - resources.ApplyResources(this.labelImageSize, "labelImageSize"); - this.labelImageSize.Name = "labelImageSize"; - this.labelImageSize.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // fileEntryCountLabel - // - resources.ApplyResources(this.fileEntryCountLabel, "fileEntryCountLabel"); - this.fileEntryCountLabel.Name = "fileEntryCountLabel"; - this.fileEntryCountLabel.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // PropertiesTabControl - // - resources.ApplyResources(this.PropertiesTabControl, "PropertiesTabControl"); - this.PropertiesTabControl.Controls.Add(this.MetaTab); - this.PropertiesTabControl.Name = "PropertiesTabControl"; - this.PropertiesTabControl.SelectedIndex = 0; - this.PropertiesTabControl.Style = MetroFramework.MetroColorStyle.Silver; - this.PropertiesTabControl.Theme = MetroFramework.MetroThemeStyle.Dark; - this.PropertiesTabControl.UseSelectable = true; - // - // MetaTab - // - this.MetaTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.MetaTab.Controls.Add(this.metroLabel2); - this.MetaTab.Controls.Add(this.treeMeta); - this.MetaTab.Controls.Add(this.entryTypeTextBox); - this.MetaTab.Controls.Add(this.entryDataTextBox); - this.MetaTab.Controls.Add(this.buttonEdit); - this.MetaTab.Controls.Add(this.metroLabel1); - this.MetaTab.HorizontalScrollbarBarColor = true; - this.MetaTab.HorizontalScrollbarHighlightOnWheel = false; - this.MetaTab.HorizontalScrollbarSize = 10; - resources.ApplyResources(this.MetaTab, "MetaTab"); - this.MetaTab.Name = "MetaTab"; - this.MetaTab.Theme = MetroFramework.MetroThemeStyle.Dark; - this.MetaTab.VerticalScrollbarBarColor = true; - this.MetaTab.VerticalScrollbarHighlightOnWheel = false; - this.MetaTab.VerticalScrollbarSize = 10; - // - // metroLabel2 - // - resources.ApplyResources(this.metroLabel2, "metroLabel2"); - this.metroLabel2.Name = "metroLabel2"; - this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // treeMeta - // - this.treeMeta.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(13)))), ((int)(((byte)(13))))); - this.treeMeta.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.treeMeta.ContextMenuStrip = this.contextMenuMetaTree; - resources.ApplyResources(this.treeMeta, "treeMeta"); - this.treeMeta.ForeColor = System.Drawing.SystemColors.Window; - this.treeMeta.Name = "treeMeta"; - this.treeMeta.PathSeparator = "/"; - this.treeMeta.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMeta_AfterSelect); - this.treeMeta.DoubleClick += new System.EventHandler(this.treeMeta_DoubleClick); - this.treeMeta.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeMeta_KeyDown); - // - // entryTypeTextBox - // - resources.ApplyResources(this.entryTypeTextBox, "entryTypeTextBox"); - // - // - // - this.entryTypeTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image"))); - this.entryTypeTextBox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode"))); - this.entryTypeTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location"))); - this.entryTypeTextBox.CustomButton.Name = ""; - this.entryTypeTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size"))); - this.entryTypeTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; - this.entryTypeTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex"))); - this.entryTypeTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; - this.entryTypeTextBox.CustomButton.UseSelectable = true; - this.entryTypeTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible"))); - this.entryTypeTextBox.Lines = new string[0]; - this.entryTypeTextBox.MaxLength = 32767; - this.entryTypeTextBox.Name = "entryTypeTextBox"; - this.entryTypeTextBox.PasswordChar = '\0'; - this.entryTypeTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; - this.entryTypeTextBox.SelectedText = ""; - this.entryTypeTextBox.SelectionLength = 0; - this.entryTypeTextBox.SelectionStart = 0; - this.entryTypeTextBox.ShortcutsEnabled = true; - this.entryTypeTextBox.Theme = MetroFramework.MetroThemeStyle.Dark; - this.entryTypeTextBox.UseSelectable = true; - this.entryTypeTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); - this.entryTypeTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); - // - // entryDataTextBox - // - resources.ApplyResources(this.entryDataTextBox, "entryDataTextBox"); - // - // - // - this.entryDataTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image1"))); - this.entryDataTextBox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode1"))); - this.entryDataTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location1"))); - this.entryDataTextBox.CustomButton.Name = ""; - this.entryDataTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size1"))); - this.entryDataTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; - this.entryDataTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex1"))); - this.entryDataTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; - this.entryDataTextBox.CustomButton.UseSelectable = true; - this.entryDataTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible1"))); - this.entryDataTextBox.Lines = new string[0]; - this.entryDataTextBox.MaxLength = 32767; - this.entryDataTextBox.Name = "entryDataTextBox"; - this.entryDataTextBox.PasswordChar = '\0'; - this.entryDataTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; - this.entryDataTextBox.SelectedText = ""; - this.entryDataTextBox.SelectionLength = 0; - this.entryDataTextBox.SelectionStart = 0; - this.entryDataTextBox.ShortcutsEnabled = true; - this.entryDataTextBox.Theme = MetroFramework.MetroThemeStyle.Dark; - this.entryDataTextBox.UseSelectable = true; - this.entryDataTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); - this.entryDataTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); - // - // buttonEdit - // - resources.ApplyResources(this.buttonEdit, "buttonEdit"); - this.buttonEdit.Name = "buttonEdit"; - this.buttonEdit.Theme = MetroFramework.MetroThemeStyle.Dark; - this.buttonEdit.UseSelectable = true; - this.buttonEdit.Click += new System.EventHandler(this.treeViewMain_DoubleClick); - // - // metroLabel1 - // - resources.ApplyResources(this.metroLabel1, "metroLabel1"); - this.metroLabel1.Name = "metroLabel1"; - this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark; - // - // label11 - // - resources.ApplyResources(this.label11, "label11"); - this.label11.Name = "label11"; - // - // treeViewMain - // - this.treeViewMain.AllowDrop = true; - resources.ApplyResources(this.treeViewMain, "treeViewMain"); - this.treeViewMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(12)))), ((int)(((byte)(12)))), ((int)(((byte)(12))))); - this.treeViewMain.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.treeViewMain.ContextMenuStrip = this.contextMenuPCKEntries; - this.treeViewMain.ForeColor = System.Drawing.Color.White; - this.treeViewMain.ImageList = this.imageList; - this.treeViewMain.LabelEdit = true; - this.treeViewMain.Name = "treeViewMain"; - this.treeViewMain.PathSeparator = "/"; - this.treeViewMain.BeforeLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.treeViewMain_BeforeLabelEdit); - this.treeViewMain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.selectNode); - this.treeViewMain.DoubleClick += new System.EventHandler(this.treeViewMain_DoubleClick); - this.treeViewMain.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeViewMain_KeyDown); - // - // imageList - // - this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; - resources.ApplyResources(this.imageList, "imageList"); - this.imageList.TransparentColor = System.Drawing.Color.Transparent; - // - // LittleEndianCheckBox - // - resources.ApplyResources(this.LittleEndianCheckBox, "LittleEndianCheckBox"); - this.LittleEndianCheckBox.BackColor = System.Drawing.Color.Transparent; - this.LittleEndianCheckBox.Name = "LittleEndianCheckBox"; - this.LittleEndianCheckBox.Style = MetroFramework.MetroColorStyle.White; - this.LittleEndianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; - this.LittleEndianCheckBox.UseSelectable = true; - // - // convertMusicFilesToolStripMenuItem - // - this.convertMusicFilesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.wavBinkaToolStripMenuItem, - this.binkaWavToolStripMenuItem}); - this.convertMusicFilesToolStripMenuItem.Name = "convertMusicFilesToolStripMenuItem"; - resources.ApplyResources(this.convertMusicFilesToolStripMenuItem, "convertMusicFilesToolStripMenuItem"); - // - // wavBinkaToolStripMenuItem - // - this.wavBinkaToolStripMenuItem.Name = "wavBinkaToolStripMenuItem"; - resources.ApplyResources(this.wavBinkaToolStripMenuItem, "wavBinkaToolStripMenuItem"); - this.wavBinkaToolStripMenuItem.Click += new System.EventHandler(this.wavBinkaToolStripMenuItem_Click); - // - // binkaWavToolStripMenuItem - // - this.binkaWavToolStripMenuItem.Name = "binkaWavToolStripMenuItem"; - resources.ApplyResources(this.binkaWavToolStripMenuItem, "binkaWavToolStripMenuItem"); - this.binkaWavToolStripMenuItem.Click += new System.EventHandler(this.binkaWavToolStripMenuItem_Click); - // - // pictureBoxImagePreview - // - resources.ApplyResources(this.pictureBoxImagePreview, "pictureBoxImagePreview"); - this.pictureBoxImagePreview.BackColor = System.Drawing.Color.Transparent; - this.pictureBoxImagePreview.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; - this.pictureBoxImagePreview.Name = "pictureBoxImagePreview"; - this.pictureBoxImagePreview.TabStop = false; - // - // MainForm - // - this.ApplyImageInvert = true; - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.LittleEndianCheckBox); - this.Controls.Add(this.menuStrip); - this.Controls.Add(this.tabControl); - this.DisplayHeader = false; - this.ForeColor = System.Drawing.Color.Silver; - this.MainMenuStrip = this.menuStrip; - this.Name = "MainForm"; - this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; - this.Style = MetroFramework.MetroColorStyle.Black; - this.Theme = MetroFramework.MetroThemeStyle.Dark; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing); - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormMain_FormClosed); - this.Load += new System.EventHandler(this.Form1_Load); - this.contextMenuPCKEntries.ResumeLayout(false); - this.menuStrip.ResumeLayout(false); - this.menuStrip.PerformLayout(); - this.contextMenuMetaTree.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - this.tabControl.ResumeLayout(false); - this.openTab.ResumeLayout(false); - this.openTab.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pckOpen)).EndInit(); - this.editorTab.ResumeLayout(false); - this.editorTab.PerformLayout(); - this.PropertiesTabControl.ResumeLayout(false); - this.MetaTab.ResumeLayout(false); - this.MetaTab.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImagePreview)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.contextMenuMetaTree.Name = "contextMenuStrip1"; + resources.ApplyResources(this.contextMenuMetaTree, "contextMenuMetaTree"); + // + // addEntryToolStripMenuItem + // + resources.ApplyResources(this.addEntryToolStripMenuItem, "addEntryToolStripMenuItem"); + this.addEntryToolStripMenuItem.Name = "addEntryToolStripMenuItem"; + this.addEntryToolStripMenuItem.Click += new System.EventHandler(this.addEntryToolStripMenuItem_Click_1); + // + // addMultipleEntriesToolStripMenuItem1 + // + resources.ApplyResources(this.addMultipleEntriesToolStripMenuItem1, "addMultipleEntriesToolStripMenuItem1"); + this.addMultipleEntriesToolStripMenuItem1.Name = "addMultipleEntriesToolStripMenuItem1"; + this.addMultipleEntriesToolStripMenuItem1.Click += new System.EventHandler(this.addMultipleEntriesToolStripMenuItem1_Click); + // + // deleteEntryToolStripMenuItem + // + resources.ApplyResources(this.deleteEntryToolStripMenuItem, "deleteEntryToolStripMenuItem"); + this.deleteEntryToolStripMenuItem.Name = "deleteEntryToolStripMenuItem"; + this.deleteEntryToolStripMenuItem.Click += new System.EventHandler(this.deleteEntryToolStripMenuItem_Click); + // + // editAllEntriesToolStripMenuItem + // + this.editAllEntriesToolStripMenuItem.Name = "editAllEntriesToolStripMenuItem"; + resources.ApplyResources(this.editAllEntriesToolStripMenuItem, "editAllEntriesToolStripMenuItem"); + this.editAllEntriesToolStripMenuItem.Click += new System.EventHandler(this.editAllEntriesToolStripMenuItem_Click); + // + // pictureBox2 + // + resources.ApplyResources(this.pictureBox2, "pictureBox2"); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.TabStop = false; + // + // tabControl + // + this.tabControl.Controls.Add(this.openTab); + this.tabControl.Controls.Add(this.editorTab); + resources.ApplyResources(this.tabControl, "tabControl"); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Style = MetroFramework.MetroColorStyle.Silver; + this.tabControl.TabStop = false; + this.tabControl.Theme = MetroFramework.MetroThemeStyle.Dark; + this.tabControl.UseSelectable = true; + this.tabControl.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.tabControl_Selecting); + // + // openTab + // + this.openTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18))))); + this.openTab.Controls.Add(this.pckOpen); + this.openTab.Controls.Add(this.label5); + this.openTab.Controls.Add(this.labelVersion); + this.openTab.Controls.Add(this.ChangelogRichTextBox); + this.openTab.ForeColor = System.Drawing.Color.Transparent; + this.openTab.HorizontalScrollbarBarColor = true; + this.openTab.HorizontalScrollbarHighlightOnWheel = false; + this.openTab.HorizontalScrollbarSize = 10; + resources.ApplyResources(this.openTab, "openTab"); + this.openTab.Name = "openTab"; + this.openTab.Style = MetroFramework.MetroColorStyle.Black; + this.openTab.Theme = MetroFramework.MetroThemeStyle.Dark; + this.openTab.UseStyleColors = true; + this.openTab.VerticalScrollbarBarColor = false; + this.openTab.VerticalScrollbarHighlightOnWheel = false; + this.openTab.VerticalScrollbarSize = 10; + // + // pckOpen + // + this.pckOpen.BackColor = System.Drawing.Color.Transparent; + resources.ApplyResources(this.pckOpen, "pckOpen"); + this.pckOpen.Name = "pckOpen"; + this.pckOpen.TabStop = false; + this.pckOpen.Click += new System.EventHandler(this.OpenPck_Click); + this.pckOpen.DragDrop += new System.Windows.Forms.DragEventHandler(this.OpenPck_DragDrop); + this.pckOpen.DragEnter += new System.Windows.Forms.DragEventHandler(this.OpenPck_DragEnter); + this.pckOpen.DragLeave += new System.EventHandler(this.OpenPck_DragLeave); + this.pckOpen.MouseEnter += new System.EventHandler(this.OpenPck_MouseEnter); + this.pckOpen.MouseLeave += new System.EventHandler(this.OpenPck_MouseLeave); + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.BackColor = System.Drawing.Color.Transparent; + this.label5.ForeColor = System.Drawing.Color.White; + this.label5.Name = "label5"; + this.label5.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // labelVersion + // + resources.ApplyResources(this.labelVersion, "labelVersion"); + this.labelVersion.ForeColor = System.Drawing.Color.White; + this.labelVersion.Name = "labelVersion"; + this.labelVersion.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // ChangelogRichTextBox + // + this.ChangelogRichTextBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(13)))), ((int)(((byte)(13))))); + this.ChangelogRichTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + resources.ApplyResources(this.ChangelogRichTextBox, "ChangelogRichTextBox"); + this.ChangelogRichTextBox.ForeColor = System.Drawing.Color.White; + this.ChangelogRichTextBox.Name = "ChangelogRichTextBox"; + this.ChangelogRichTextBox.ReadOnly = true; + // + // editorTab + // + this.editorTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18))))); + resources.ApplyResources(this.editorTab, "editorTab"); + this.editorTab.Controls.Add(this.pckFileLabel); + this.editorTab.Controls.Add(this.labelImageSize); + this.editorTab.Controls.Add(this.fileEntryCountLabel); + this.editorTab.Controls.Add(this.PropertiesTabControl); + this.editorTab.Controls.Add(this.label11); + this.editorTab.Controls.Add(this.treeViewMain); + this.editorTab.Controls.Add(this.pictureBox2); + this.editorTab.Controls.Add(this.pictureBoxImagePreview); + this.editorTab.ForeColor = System.Drawing.Color.Transparent; + this.editorTab.HorizontalScrollbarBarColor = true; + this.editorTab.HorizontalScrollbarHighlightOnWheel = false; + this.editorTab.HorizontalScrollbarSize = 0; + this.editorTab.Name = "editorTab"; + this.editorTab.Style = MetroFramework.MetroColorStyle.White; + this.editorTab.Theme = MetroFramework.MetroThemeStyle.Dark; + this.editorTab.VerticalScrollbarBarColor = true; + this.editorTab.VerticalScrollbarHighlightOnWheel = false; + this.editorTab.VerticalScrollbarSize = 0; + // + // pckFileLabel + // + resources.ApplyResources(this.pckFileLabel, "pckFileLabel"); + this.pckFileLabel.Name = "pckFileLabel"; + this.pckFileLabel.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // labelImageSize + // + resources.ApplyResources(this.labelImageSize, "labelImageSize"); + this.labelImageSize.Name = "labelImageSize"; + this.labelImageSize.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // fileEntryCountLabel + // + resources.ApplyResources(this.fileEntryCountLabel, "fileEntryCountLabel"); + this.fileEntryCountLabel.Name = "fileEntryCountLabel"; + this.fileEntryCountLabel.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // PropertiesTabControl + // + resources.ApplyResources(this.PropertiesTabControl, "PropertiesTabControl"); + this.PropertiesTabControl.Controls.Add(this.MetaTab); + this.PropertiesTabControl.Name = "PropertiesTabControl"; + this.PropertiesTabControl.SelectedIndex = 0; + this.PropertiesTabControl.Style = MetroFramework.MetroColorStyle.Silver; + this.PropertiesTabControl.Theme = MetroFramework.MetroThemeStyle.Dark; + this.PropertiesTabControl.UseSelectable = true; + // + // MetaTab + // + this.MetaTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.MetaTab.Controls.Add(this.metroLabel2); + this.MetaTab.Controls.Add(this.treeMeta); + this.MetaTab.Controls.Add(this.entryTypeTextBox); + this.MetaTab.Controls.Add(this.entryDataTextBox); + this.MetaTab.Controls.Add(this.buttonEdit); + this.MetaTab.Controls.Add(this.metroLabel1); + this.MetaTab.HorizontalScrollbarBarColor = true; + this.MetaTab.HorizontalScrollbarHighlightOnWheel = false; + this.MetaTab.HorizontalScrollbarSize = 10; + resources.ApplyResources(this.MetaTab, "MetaTab"); + this.MetaTab.Name = "MetaTab"; + this.MetaTab.Theme = MetroFramework.MetroThemeStyle.Dark; + this.MetaTab.VerticalScrollbarBarColor = true; + this.MetaTab.VerticalScrollbarHighlightOnWheel = false; + this.MetaTab.VerticalScrollbarSize = 10; + // + // metroLabel2 + // + resources.ApplyResources(this.metroLabel2, "metroLabel2"); + this.metroLabel2.Name = "metroLabel2"; + this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // treeMeta + // + this.treeMeta.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(13)))), ((int)(((byte)(13))))); + this.treeMeta.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.treeMeta.ContextMenuStrip = this.contextMenuMetaTree; + resources.ApplyResources(this.treeMeta, "treeMeta"); + this.treeMeta.ForeColor = System.Drawing.SystemColors.Window; + this.treeMeta.Name = "treeMeta"; + this.treeMeta.PathSeparator = "/"; + this.treeMeta.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMeta_AfterSelect); + this.treeMeta.DoubleClick += new System.EventHandler(this.treeMeta_DoubleClick); + this.treeMeta.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeMeta_KeyDown); + // + // entryTypeTextBox + // + resources.ApplyResources(this.entryTypeTextBox, "entryTypeTextBox"); + // + // + // + this.entryTypeTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image"))); + this.entryTypeTextBox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode"))); + this.entryTypeTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location"))); + this.entryTypeTextBox.CustomButton.Name = ""; + this.entryTypeTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size"))); + this.entryTypeTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.entryTypeTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex"))); + this.entryTypeTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.entryTypeTextBox.CustomButton.UseSelectable = true; + this.entryTypeTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible"))); + this.entryTypeTextBox.Lines = new string[0]; + this.entryTypeTextBox.MaxLength = 32767; + this.entryTypeTextBox.Name = "entryTypeTextBox"; + this.entryTypeTextBox.PasswordChar = '\0'; + this.entryTypeTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.entryTypeTextBox.SelectedText = ""; + this.entryTypeTextBox.SelectionLength = 0; + this.entryTypeTextBox.SelectionStart = 0; + this.entryTypeTextBox.ShortcutsEnabled = true; + this.entryTypeTextBox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.entryTypeTextBox.UseSelectable = true; + this.entryTypeTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.entryTypeTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // entryDataTextBox + // + resources.ApplyResources(this.entryDataTextBox, "entryDataTextBox"); + // + // + // + this.entryDataTextBox.CustomButton.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image1"))); + this.entryDataTextBox.CustomButton.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("resource.ImeMode1"))); + this.entryDataTextBox.CustomButton.Location = ((System.Drawing.Point)(resources.GetObject("resource.Location1"))); + this.entryDataTextBox.CustomButton.Name = ""; + this.entryDataTextBox.CustomButton.Size = ((System.Drawing.Size)(resources.GetObject("resource.Size1"))); + this.entryDataTextBox.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; + this.entryDataTextBox.CustomButton.TabIndex = ((int)(resources.GetObject("resource.TabIndex1"))); + this.entryDataTextBox.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; + this.entryDataTextBox.CustomButton.UseSelectable = true; + this.entryDataTextBox.CustomButton.Visible = ((bool)(resources.GetObject("resource.Visible1"))); + this.entryDataTextBox.Lines = new string[0]; + this.entryDataTextBox.MaxLength = 32767; + this.entryDataTextBox.Name = "entryDataTextBox"; + this.entryDataTextBox.PasswordChar = '\0'; + this.entryDataTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None; + this.entryDataTextBox.SelectedText = ""; + this.entryDataTextBox.SelectionLength = 0; + this.entryDataTextBox.SelectionStart = 0; + this.entryDataTextBox.ShortcutsEnabled = true; + this.entryDataTextBox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.entryDataTextBox.UseSelectable = true; + this.entryDataTextBox.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); + this.entryDataTextBox.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); + // + // buttonEdit + // + resources.ApplyResources(this.buttonEdit, "buttonEdit"); + this.buttonEdit.Name = "buttonEdit"; + this.buttonEdit.Theme = MetroFramework.MetroThemeStyle.Dark; + this.buttonEdit.UseSelectable = true; + this.buttonEdit.Click += new System.EventHandler(this.treeViewMain_DoubleClick); + // + // metroLabel1 + // + resources.ApplyResources(this.metroLabel1, "metroLabel1"); + this.metroLabel1.Name = "metroLabel1"; + this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark; + // + // label11 + // + resources.ApplyResources(this.label11, "label11"); + this.label11.Name = "label11"; + // + // treeViewMain + // + this.treeViewMain.AllowDrop = true; + resources.ApplyResources(this.treeViewMain, "treeViewMain"); + this.treeViewMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(12)))), ((int)(((byte)(12)))), ((int)(((byte)(12))))); + this.treeViewMain.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.treeViewMain.ContextMenuStrip = this.contextMenuPCKEntries; + this.treeViewMain.ForeColor = System.Drawing.Color.White; + this.treeViewMain.ImageList = this.imageList; + this.treeViewMain.LabelEdit = true; + this.treeViewMain.Name = "treeViewMain"; + this.treeViewMain.PathSeparator = "/"; + this.treeViewMain.BeforeLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.treeViewMain_BeforeLabelEdit); + this.treeViewMain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.selectNode); + this.treeViewMain.DoubleClick += new System.EventHandler(this.treeViewMain_DoubleClick); + this.treeViewMain.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeViewMain_KeyDown); + // + // imageList + // + this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; + resources.ApplyResources(this.imageList, "imageList"); + this.imageList.TransparentColor = System.Drawing.Color.Transparent; + // + // pictureBoxImagePreview + // + resources.ApplyResources(this.pictureBoxImagePreview, "pictureBoxImagePreview"); + this.pictureBoxImagePreview.BackColor = System.Drawing.Color.Transparent; + this.pictureBoxImagePreview.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; + this.pictureBoxImagePreview.Name = "pictureBoxImagePreview"; + this.pictureBoxImagePreview.TabStop = false; + // + // LittleEndianCheckBox + // + resources.ApplyResources(this.LittleEndianCheckBox, "LittleEndianCheckBox"); + this.LittleEndianCheckBox.BackColor = System.Drawing.Color.Transparent; + this.LittleEndianCheckBox.Name = "LittleEndianCheckBox"; + this.LittleEndianCheckBox.Style = MetroFramework.MetroColorStyle.White; + this.LittleEndianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.LittleEndianCheckBox.UseSelectable = true; + // + // MainForm + // + this.ApplyImageInvert = true; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.LittleEndianCheckBox); + this.Controls.Add(this.menuStrip); + this.Controls.Add(this.tabControl); + this.DisplayHeader = false; + this.ForeColor = System.Drawing.Color.Silver; + this.MainMenuStrip = this.menuStrip; + this.Name = "MainForm"; + this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; + this.Style = MetroFramework.MetroColorStyle.Black; + this.Theme = MetroFramework.MetroThemeStyle.Dark; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing); + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormMain_FormClosed); + this.Load += new System.EventHandler(this.Form1_Load); + this.contextMenuPCKEntries.ResumeLayout(false); + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); + this.contextMenuMetaTree.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + this.tabControl.ResumeLayout(false); + this.openTab.ResumeLayout(false); + this.openTab.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pckOpen)).EndInit(); + this.editorTab.ResumeLayout(false); + this.editorTab.PerformLayout(); + this.PropertiesTabControl.ResumeLayout(false); + this.MetaTab.ResumeLayout(false); + this.MetaTab.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImagePreview)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -1157,7 +1149,6 @@ private System.Windows.Forms.ToolStripMenuItem toNobledezJackToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toPhoenixARCDeveloperToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem joinDevelopmentDiscordToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem convertPCTextrurePackToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem forMattNLContributorToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem audiopckToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem videosToolStripMenuItem; diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 1948a7e9..7aea44c6 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -1804,12 +1804,6 @@ namespace PckStudio Process.Start("https://discord.gg/aJtZNFVQTv"); } - private void convertPCTextrurePackToolStripMenuItem_Click(object sender, EventArgs e) - { - TextureConverterUtility tex = new TextureConverterUtility(treeViewMain, currentPCK); - tex.ShowDialog(); - } - private void OpenPck_MouseEnter(object sender, EventArgs e) { pckOpen.Image = Resources.pckOpen; diff --git a/PCK-Studio/MainForm.resx b/PCK-Studio/MainForm.resx index 609a7665..089dc3aa 100644 --- a/PCK-Studio/MainForm.resx +++ b/PCK-Studio/MainForm.resx @@ -522,7 +522,7 @@ - 217, 22 + 180, 22 New @@ -536,7 +536,7 @@ - 217, 22 + 180, 22 Open @@ -550,7 +550,7 @@ - 217, 22 + 180, 22 Extract @@ -569,7 +569,7 @@ - 217, 22 + 180, 22 Save @@ -588,22 +588,13 @@ - 217, 22 + 180, 22 Save As - - False - - - 217, 22 - - - Convert to PC Texture pack - - 217, 22 + 180, 22 Close @@ -28512,13 +28503,13 @@ Add Custom Pack Icon - 180, 22 + 145, 22 Wav -> Binka - 180, 22 + 145, 22 Binka -> Wav @@ -33474,9 +33465,6 @@ AP//AAA= - - NoControl - 1064, 660 @@ -33768,12 +33756,6 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - convertPCTextrurePackToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - closeToolStripMenuItem @@ -33966,6 +33948,24 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + convertMusicFilesToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + wavBinkaToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + binkaWavToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + addEntryToolStripMenuItem @@ -33996,24 +33996,6 @@ System.Windows.Forms.ImageList, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - convertMusicFilesToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - wavBinkaToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - binkaWavToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - MainForm From e6641ff7fe309697f89e897876d2ea0ed0ec039d Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 2 May 2023 19:24:59 +0200 Subject: [PATCH 68/80] TextureConverterUtility.cs - Marked as Obsolete --- PCK-Studio/Forms/Utilities/TextureConverterUtility.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCK-Studio/Forms/Utilities/TextureConverterUtility.cs b/PCK-Studio/Forms/Utilities/TextureConverterUtility.cs index 0fc5cedc..806ce52b 100644 --- a/PCK-Studio/Forms/Utilities/TextureConverterUtility.cs +++ b/PCK-Studio/Forms/Utilities/TextureConverterUtility.cs @@ -5,11 +5,11 @@ using System.Drawing.Imaging; using System.Windows.Forms; using MetroFramework.Forms; using PckStudio.Properties; -using PckStudio.Classes.FileTypes; using OMI.Formats.Pck; namespace PckStudio.Forms.Utilities { + [Obsolete()] public partial class TextureConverterUtility : MetroForm { public TextureConverterUtility(TreeView tv0, PckFile pck) From 26ecaa0c0220e22c4658715926eac1f965d81b30 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 2 May 2023 20:24:29 +0200 Subject: [PATCH 69/80] FileCacher.cs - Added copyright notice --- PCK-Studio/Classes/Misc/FileCacher.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/PCK-Studio/Classes/Misc/FileCacher.cs b/PCK-Studio/Classes/Misc/FileCacher.cs index e2fb623a..23712fed 100644 --- a/PCK-Studio/Classes/Misc/FileCacher.cs +++ b/PCK-Studio/Classes/Misc/FileCacher.cs @@ -1,4 +1,21 @@ -using System; +/* Copyright (c) 2023-present miku-666, MattNL + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ +using System; using System.IO; namespace PckStudio.Classes.Misc From 4a54baa37b8e9f3b2644bddef90f8d4de5782258 Mon Sep 17 00:00:00 2001 From: MattNL Date: Wed, 3 May 2023 07:21:26 -0400 Subject: [PATCH 70/80] Removed invalid box types --- PCK-Studio/Forms/Editor/BoxEditor.Designer.cs | 118 +++++++++--------- 1 file changed, 56 insertions(+), 62 deletions(-) diff --git a/PCK-Studio/Forms/Editor/BoxEditor.Designer.cs b/PCK-Studio/Forms/Editor/BoxEditor.Designer.cs index 4fdcdbc3..0e7aa614 100644 --- a/PCK-Studio/Forms/Editor/BoxEditor.Designer.cs +++ b/PCK-Studio/Forms/Editor/BoxEditor.Designer.cs @@ -28,25 +28,30 @@ /// private void InitializeComponent() { + MetroFramework.Controls.MetroLabel parentLabel; + MetroFramework.Controls.MetroLabel positionLabel; + MetroFramework.Controls.MetroLabel sizeLabel; + MetroFramework.Controls.MetroLabel uvLabel; + MetroFramework.Controls.MetroLabel inflationLabel; this.closeButton = new MetroFramework.Controls.MetroButton(); this.toolTip = new MetroFramework.Components.MetroToolTip(); - this.parentLabel = new MetroFramework.Controls.MetroLabel(); this.parentComboBox = new MetroFramework.Controls.MetroComboBox(); - this.positionLabel = new MetroFramework.Controls.MetroLabel(); this.PosXUpDown = new System.Windows.Forms.NumericUpDown(); this.PosYUpDown = new System.Windows.Forms.NumericUpDown(); this.PosZUpDown = new System.Windows.Forms.NumericUpDown(); this.SizeZUpDown = new System.Windows.Forms.NumericUpDown(); this.SizeYUpDown = new System.Windows.Forms.NumericUpDown(); this.SizeXUpDown = new System.Windows.Forms.NumericUpDown(); - this.sizeLabel = new MetroFramework.Controls.MetroLabel(); this.uvYUpDown = new System.Windows.Forms.NumericUpDown(); this.uvXUpDown = new System.Windows.Forms.NumericUpDown(); - this.uvLabel = new MetroFramework.Controls.MetroLabel(); this.armorCheckBox = new MetroFramework.Controls.MetroCheckBox(); this.mirrorCheckBox = new MetroFramework.Controls.MetroCheckBox(); this.inflationUpDown = new System.Windows.Forms.NumericUpDown(); - this.inflationLabel = new MetroFramework.Controls.MetroLabel(); + parentLabel = new MetroFramework.Controls.MetroLabel(); + positionLabel = new MetroFramework.Controls.MetroLabel(); + sizeLabel = new MetroFramework.Controls.MetroLabel(); + uvLabel = new MetroFramework.Controls.MetroLabel(); + inflationLabel = new MetroFramework.Controls.MetroLabel(); ((System.ComponentModel.ISupportInitialize)(this.PosXUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PosYUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PosZUpDown)).BeginInit(); @@ -78,14 +83,14 @@ // // parentLabel // - this.parentLabel.AutoSize = true; - this.parentLabel.FontSize = MetroFramework.MetroLabelSize.Tall; - this.parentLabel.Location = new System.Drawing.Point(357, 72); - this.parentLabel.Name = "parentLabel"; - this.parentLabel.Size = new System.Drawing.Size(64, 25); - this.parentLabel.TabIndex = 2; - this.parentLabel.Text = "Parent:"; - this.parentLabel.Theme = MetroFramework.MetroThemeStyle.Dark; + parentLabel.AutoSize = true; + parentLabel.FontSize = MetroFramework.MetroLabelSize.Tall; + parentLabel.Location = new System.Drawing.Point(357, 72); + parentLabel.Name = "parentLabel"; + parentLabel.Size = new System.Drawing.Size(64, 25); + parentLabel.TabIndex = 2; + parentLabel.Text = "Parent:"; + parentLabel.Theme = MetroFramework.MetroThemeStyle.Dark; // // parentComboBox // @@ -114,13 +119,7 @@ "ARMARMOR1", "ARMARMOR0", "BODYARMOR", - "BELT", - "TOOL0", - "TOOL1", - "HELMET", - "SHOULDER0", - "SHOULDER1", - "CHEST"}); + "BELT"}); this.parentComboBox.Location = new System.Drawing.Point(417, 72); this.parentComboBox.Name = "parentComboBox"; this.parentComboBox.Size = new System.Drawing.Size(163, 29); @@ -130,14 +129,14 @@ // // positionLabel // - this.positionLabel.AutoSize = true; - this.positionLabel.FontSize = MetroFramework.MetroLabelSize.Tall; - this.positionLabel.Location = new System.Drawing.Point(33, 72); - this.positionLabel.Name = "positionLabel"; - this.positionLabel.Size = new System.Drawing.Size(75, 25); - this.positionLabel.TabIndex = 4; - this.positionLabel.Text = "Position:"; - this.positionLabel.Theme = MetroFramework.MetroThemeStyle.Dark; + positionLabel.AutoSize = true; + positionLabel.FontSize = MetroFramework.MetroLabelSize.Tall; + positionLabel.Location = new System.Drawing.Point(33, 72); + positionLabel.Name = "positionLabel"; + positionLabel.Size = new System.Drawing.Size(75, 25); + positionLabel.TabIndex = 4; + positionLabel.Text = "Position:"; + positionLabel.Theme = MetroFramework.MetroThemeStyle.Dark; // // PosXUpDown // @@ -276,14 +275,14 @@ // // sizeLabel // - this.sizeLabel.AutoSize = true; - this.sizeLabel.FontSize = MetroFramework.MetroLabelSize.Tall; - this.sizeLabel.Location = new System.Drawing.Point(33, 97); - this.sizeLabel.Name = "sizeLabel"; - this.sizeLabel.Size = new System.Drawing.Size(46, 25); - this.sizeLabel.TabIndex = 22; - this.sizeLabel.Text = "Size:"; - this.sizeLabel.Theme = MetroFramework.MetroThemeStyle.Dark; + sizeLabel.AutoSize = true; + sizeLabel.FontSize = MetroFramework.MetroLabelSize.Tall; + sizeLabel.Location = new System.Drawing.Point(33, 97); + sizeLabel.Name = "sizeLabel"; + sizeLabel.Size = new System.Drawing.Size(46, 25); + sizeLabel.TabIndex = 22; + sizeLabel.Text = "Size:"; + sizeLabel.Theme = MetroFramework.MetroThemeStyle.Dark; // // uvYUpDown // @@ -337,14 +336,14 @@ // // uvLabel // - this.uvLabel.AutoSize = true; - this.uvLabel.FontSize = MetroFramework.MetroLabelSize.Tall; - this.uvLabel.Location = new System.Drawing.Point(33, 123); - this.uvLabel.Name = "uvLabel"; - this.uvLabel.Size = new System.Drawing.Size(39, 25); - this.uvLabel.TabIndex = 26; - this.uvLabel.Text = "UV:"; - this.uvLabel.Theme = MetroFramework.MetroThemeStyle.Dark; + uvLabel.AutoSize = true; + uvLabel.FontSize = MetroFramework.MetroLabelSize.Tall; + uvLabel.Location = new System.Drawing.Point(33, 123); + uvLabel.Name = "uvLabel"; + uvLabel.Size = new System.Drawing.Size(39, 25); + uvLabel.TabIndex = 26; + uvLabel.Text = "UV:"; + uvLabel.Theme = MetroFramework.MetroThemeStyle.Dark; // // armorCheckBox // @@ -394,14 +393,14 @@ // // inflationLabel // - this.inflationLabel.AutoSize = true; - this.inflationLabel.FontSize = MetroFramework.MetroLabelSize.Tall; - this.inflationLabel.Location = new System.Drawing.Point(33, 149); - this.inflationLabel.Name = "inflationLabel"; - this.inflationLabel.Size = new System.Drawing.Size(55, 25); - this.inflationLabel.TabIndex = 31; - this.inflationLabel.Text = "Scale:"; - this.inflationLabel.Theme = MetroFramework.MetroThemeStyle.Dark; + inflationLabel.AutoSize = true; + inflationLabel.FontSize = MetroFramework.MetroLabelSize.Tall; + inflationLabel.Location = new System.Drawing.Point(33, 149); + inflationLabel.Name = "inflationLabel"; + inflationLabel.Size = new System.Drawing.Size(55, 25); + inflationLabel.TabIndex = 31; + inflationLabel.Text = "Scale:"; + inflationLabel.Theme = MetroFramework.MetroThemeStyle.Dark; // // BoxEditor // @@ -417,14 +416,14 @@ this.Controls.Add(this.PosZUpDown); this.Controls.Add(this.PosYUpDown); this.Controls.Add(this.PosXUpDown); - this.Controls.Add(this.inflationLabel); + this.Controls.Add(inflationLabel); this.Controls.Add(this.parentComboBox); this.Controls.Add(this.mirrorCheckBox); this.Controls.Add(this.armorCheckBox); - this.Controls.Add(this.uvLabel); - this.Controls.Add(this.sizeLabel); - this.Controls.Add(this.positionLabel); - this.Controls.Add(this.parentLabel); + this.Controls.Add(uvLabel); + this.Controls.Add(sizeLabel); + this.Controls.Add(positionLabel); + this.Controls.Add(parentLabel); this.Controls.Add(this.closeButton); this.MaximumSize = new System.Drawing.Size(630, 554); this.MinimizeBox = false; @@ -450,22 +449,17 @@ #endregion private MetroFramework.Controls.MetroButton closeButton; private MetroFramework.Components.MetroToolTip toolTip; - private MetroFramework.Controls.MetroLabel parentLabel; private MetroFramework.Controls.MetroComboBox parentComboBox; - private MetroFramework.Controls.MetroLabel positionLabel; private System.Windows.Forms.NumericUpDown PosXUpDown; private System.Windows.Forms.NumericUpDown PosYUpDown; private System.Windows.Forms.NumericUpDown PosZUpDown; private System.Windows.Forms.NumericUpDown SizeZUpDown; private System.Windows.Forms.NumericUpDown SizeYUpDown; private System.Windows.Forms.NumericUpDown SizeXUpDown; - private MetroFramework.Controls.MetroLabel sizeLabel; private System.Windows.Forms.NumericUpDown uvYUpDown; private System.Windows.Forms.NumericUpDown uvXUpDown; - private MetroFramework.Controls.MetroLabel uvLabel; private MetroFramework.Controls.MetroCheckBox armorCheckBox; private MetroFramework.Controls.MetroCheckBox mirrorCheckBox; private System.Windows.Forms.NumericUpDown inflationUpDown; - private MetroFramework.Controls.MetroLabel inflationLabel; } } \ No newline at end of file From 17096c0bc0c3e1be93277ba75bd9932e4cec5e36 Mon Sep 17 00:00:00 2001 From: MattNL Date: Wed, 3 May 2023 07:22:11 -0400 Subject: [PATCH 71/80] Corrected helmet checkbox name --- PCK-Studio/Forms/Editor/BoxEditor.Designer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PCK-Studio/Forms/Editor/BoxEditor.Designer.cs b/PCK-Studio/Forms/Editor/BoxEditor.Designer.cs index 0e7aa614..441d6a7f 100644 --- a/PCK-Studio/Forms/Editor/BoxEditor.Designer.cs +++ b/PCK-Studio/Forms/Editor/BoxEditor.Designer.cs @@ -352,9 +352,9 @@ this.armorCheckBox.FontWeight = MetroFramework.MetroCheckBoxWeight.Light; this.armorCheckBox.Location = new System.Drawing.Point(363, 101); this.armorCheckBox.Name = "armorCheckBox"; - this.armorCheckBox.Size = new System.Drawing.Size(225, 25); + this.armorCheckBox.Size = new System.Drawing.Size(245, 25); this.armorCheckBox.TabIndex = 29; - this.armorCheckBox.Text = "Hide when wearing armor"; + this.armorCheckBox.Text = "Hide when wearing a helmet"; this.armorCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; this.armorCheckBox.UseSelectable = true; // From 8f51c8b32eb5a38aab9ef9925b38d39eb1c510ea Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 3 May 2023 15:53:34 +0200 Subject: [PATCH 72/80] MainForm.cs - Marked 'MainForm.needsUpdate' as Obsolete --- PCK-Studio/MainForm.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 7aea44c6..815a8979 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -37,7 +37,9 @@ namespace PckStudio bool wasModified = false; bool isTemplateFile = false; + [Obsolete] bool needsUpdate = false; + bool isSelectingTab = false; readonly Dictionary> pckFileTypeHandler; From 81b487022634d8fa0d0f02bf26310b0b59057df8 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 3 May 2023 15:55:22 +0200 Subject: [PATCH 73/80] MainForm.cs - PckCenter Tool strip now only opens on debug and beta builds --- PCK-Studio/MainForm.Designer.cs | 14 +++++++------- PCK-Studio/MainForm.cs | 4 +++- PCK-Studio/MainForm.resx | 16 ++++++++-------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/PCK-Studio/MainForm.Designer.cs b/PCK-Studio/MainForm.Designer.cs index d7939997..aa69779c 100644 --- a/PCK-Studio/MainForm.Designer.cs +++ b/PCK-Studio/MainForm.Designer.cs @@ -103,7 +103,7 @@ this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.administrativeToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.storeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.openPckCenterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.wiiUPCKInstallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.PS3PCKInstallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.VitaPCKInstallerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -663,7 +663,7 @@ // storeToolStripMenuItem // this.storeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openToolStripMenuItem1, + this.openPckCenterToolStripMenuItem, this.wiiUPCKInstallerToolStripMenuItem, this.PS3PCKInstallerToolStripMenuItem, this.VitaPCKInstallerToolStripMenuItem, @@ -673,11 +673,11 @@ resources.ApplyResources(this.storeToolStripMenuItem, "storeToolStripMenuItem"); this.storeToolStripMenuItem.Name = "storeToolStripMenuItem"; // - // openToolStripMenuItem1 + // openPckCenterToolStripMenuItem // - resources.ApplyResources(this.openToolStripMenuItem1, "openToolStripMenuItem1"); - this.openToolStripMenuItem1.Name = "openToolStripMenuItem1"; - this.openToolStripMenuItem1.Click += new System.EventHandler(this.openToolStripMenuItem1_Click); + resources.ApplyResources(this.openPckCenterToolStripMenuItem, "openPckCenterToolStripMenuItem"); + this.openPckCenterToolStripMenuItem.Name = "openPckCenterToolStripMenuItem"; + this.openPckCenterToolStripMenuItem.Click += new System.EventHandler(this.openPckCenterToolStripMenuItem_Click); // // wiiUPCKInstallerToolStripMenuItem // @@ -1136,7 +1136,7 @@ private System.Windows.Forms.ToolStripMenuItem donateToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem convertToBedrockToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem storeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem openPckCenterToolStripMenuItem; private MetroFramework.Controls.MetroTabControl tabControl; private MetroFramework.Controls.MetroTabPage editorTab; private MetroFramework.Controls.MetroCheckBox LittleEndianCheckBox; diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 815a8979..63938557 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -1714,8 +1714,9 @@ namespace PckStudio MessageBox.Show("This feature is currently being reworked.", "Currently unavailable", MessageBoxButtons.OK, MessageBoxIcon.Information); } - private void openToolStripMenuItem1_Click(object sender, EventArgs e) + private void openPckCenterToolStripMenuItem_Click(object sender, EventArgs e) { +#if BETA || DEBUG DateTime Begin = DateTime.Now; //pckCenter open = new pckCenter(); PckCenterBeta open = new PckCenterBeta(); @@ -1723,6 +1724,7 @@ namespace PckStudio TimeSpan duration = new TimeSpan(DateTime.Now.Ticks - Begin.Ticks); Debug.WriteLine("Completed in: " + duration); +#endif } private void wiiUPCKInstallerToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/PCK-Studio/MainForm.resx b/PCK-Studio/MainForm.resx index 089dc3aa..656d3e81 100644 --- a/PCK-Studio/MainForm.resx +++ b/PCK-Studio/MainForm.resx @@ -621,7 +621,7 @@ - 176, 22 + 180, 22 Advanced Bulk @@ -647,7 +647,7 @@ - 176, 22 + 180, 22 Convert to Bedrock @@ -25777,7 +25777,7 @@ Help - + iVBORw0KGgoAAAANSUhEUgAAA+gAAAPoCAYAAABNo9TkAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAP+NSURBVHhe7P0H @@ -27612,10 +27612,10 @@ nDU2AQAAgLPGJgAAAHDW2AQAAABOevQh/w2VkWR8zwQAigAAAABJRU5ErkJggg== - + 212, 22 - + Open PCK Center @@ -33900,10 +33900,10 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - openToolStripMenuItem1 + + openPckCenterToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 From b1589811080c8916f8a4d0c5dc4bb1a91c0590b9 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 3 May 2023 16:07:19 +0200 Subject: [PATCH 74/80] Added 'Internals' folder to project and moved SkinANIM, SkinBox, CommitInfo and ProgramInfo(ApplicationBuildInfo now) into 'Internals' --- .../Models/DefaultModels/Steve64x64Model.cs | 6 +- PCK-Studio/Classes/Models/SkinBox.cs | 64 --------- PCK-Studio/Forms/Editor/ANIMEditor.cs | 2 +- PCK-Studio/Forms/Editor/BoxEditor.cs | 8 +- .../Forms/Skins-And-Textures/SkinPreview.cs | 2 +- .../Forms/Skins-And-Textures/addnewskin.cs | 2 +- .../Forms/Skins-And-Textures/generateModel.cs | 130 ++++++++---------- PCK-Studio/Internals/ApplicationBuildInfo.cs | 47 +++++++ PCK-Studio/Internals/CommitInfo.cs | 50 +++++++ .../{Classes/Utils => Internals}/SkinANIM.cs | 2 +- PCK-Studio/Internals/SkinBOX.cs | 90 ++++++++++++ PCK-Studio/MainForm.cs | 3 +- PCK-Studio/PckStudio.csproj | 6 +- PCK-Studio/Program.cs | 55 -------- 14 files changed, 263 insertions(+), 204 deletions(-) delete mode 100644 PCK-Studio/Classes/Models/SkinBox.cs create mode 100644 PCK-Studio/Internals/ApplicationBuildInfo.cs create mode 100644 PCK-Studio/Internals/CommitInfo.cs rename PCK-Studio/{Classes/Utils => Internals}/SkinANIM.cs (99%) create mode 100644 PCK-Studio/Internals/SkinBOX.cs diff --git a/PCK-Studio/Classes/Models/DefaultModels/Steve64x64Model.cs b/PCK-Studio/Classes/Models/DefaultModels/Steve64x64Model.cs index 481f5877..34bd557e 100644 --- a/PCK-Studio/Classes/Models/DefaultModels/Steve64x64Model.cs +++ b/PCK-Studio/Classes/Models/DefaultModels/Steve64x64Model.cs @@ -1,12 +1,12 @@ -using PckStudio.Classes.Utils; -using PckStudio.Models; -using System; +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Security.Policy; using System.Text; using System.Threading.Tasks; +using PckStudio.Internal; +using PckStudio.Models; namespace PckStudio.Classes.Models.DefaultModels { diff --git a/PCK-Studio/Classes/Models/SkinBox.cs b/PCK-Studio/Classes/Models/SkinBox.cs deleted file mode 100644 index e27587cd..00000000 --- a/PCK-Studio/Classes/Models/SkinBox.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Numerics; -using System.Text.RegularExpressions; -using System.Windows.Forms; - -namespace PckStudio.Classes.Models -{ - public class SkinBox - { - public string Type; - public Vector3 Pos; - public Vector3 Size; - public float U, V; - public bool HideWithArmor; - public bool Mirror; - public float Scale; - public SkinBox(string input) - { - try - { - string[] arguments = Regex.Split(input, @"\s+"); // split by whitespace - - int old_length = arguments.Length - 1; - - Array.Resize(ref arguments, 12); - - for (int x = 11; x > old_length; x--) - { - arguments[x] = "0"; // set any missing arguments to '0' - } - - Type = arguments[0].ToUpper(); // just in case a box has all lower, the editor still parses correctly - - Pos = new Vector3(float.Parse(arguments[1]), float.Parse(arguments[2]), float.Parse(arguments[3])); - Size = new Vector3(float.Parse(arguments[4]), float.Parse(arguments[5]), float.Parse(arguments[6])); - U = float.Parse(arguments[7]); - V = float.Parse(arguments[8]); - HideWithArmor = Convert.ToBoolean(int.Parse(arguments[9])); - Mirror = Convert.ToBoolean(int.Parse(arguments[10])); - Scale = float.Parse(arguments[11]); - } - catch (FormatException fex) - { - MessageBox.Show($"A Format Exception was thrown\nFailed to parse BOX value\n{fex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - catch (IndexOutOfRangeException iex) // this should be MUCH more rare now - { - MessageBox.Show($"A box paramater was out of range\nFailed to parse BOX value\n{iex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - catch (Exception ex) - { - Type = string.Empty; - } - } - - public ValueTuple ToProperty() - { - string value = $"{Type} {Pos.X} {Pos.Y} {Pos.Z} {Size.X} {Size.Y} {Size.Z} {U} {V} {Convert.ToInt32(HideWithArmor)} {Convert.ToInt32(Mirror)} {Scale}"; - return new ValueTuple("BOX", value.Replace(',', '.')); - } - } -} diff --git a/PCK-Studio/Forms/Editor/ANIMEditor.cs b/PCK-Studio/Forms/Editor/ANIMEditor.cs index d13f2863..643cbf9b 100644 --- a/PCK-Studio/Forms/Editor/ANIMEditor.cs +++ b/PCK-Studio/Forms/Editor/ANIMEditor.cs @@ -5,7 +5,7 @@ using System.Diagnostics; using System.Windows.Forms; using System.Collections.Generic; -using PckStudio.Classes.Utils; +using PckStudio.Internal; using PckStudio.Forms.Additional_Popups; namespace PckStudio.Forms.Editor diff --git a/PCK-Studio/Forms/Editor/BoxEditor.cs b/PCK-Studio/Forms/Editor/BoxEditor.cs index 771f3bc6..ac1bbfef 100644 --- a/PCK-Studio/Forms/Editor/BoxEditor.cs +++ b/PCK-Studio/Forms/Editor/BoxEditor.cs @@ -1,6 +1,6 @@ using System; using System.Windows.Forms; -using PckStudio.Classes.Models; +using PckStudio.Internal; namespace PckStudio.Forms.Editor { @@ -14,7 +14,7 @@ namespace PckStudio.Forms.Editor inflationUpDown.Enabled = hasInflation; - SkinBox box = new SkinBox(inBOX); + var box = SkinBOX.FromString(inBOX); if (string.IsNullOrEmpty(box.Type) || !parentComboBox.Items.Contains(box.Type)) { @@ -28,8 +28,8 @@ namespace PckStudio.Forms.Editor SizeXUpDown.Value = (decimal)box.Size.X; SizeYUpDown.Value = (decimal)box.Size.Y; SizeZUpDown.Value = (decimal)box.Size.Z; - uvXUpDown.Value = (decimal)box.U; - uvYUpDown.Value = (decimal)box.V; + uvXUpDown.Value = (decimal)box.UV.X; + uvYUpDown.Value = (decimal)box.UV.Y; armorCheckBox.Checked = box.HideWithArmor; mirrorCheckBox.Checked = box.Mirror; inflationUpDown.Value = (decimal)box.Scale; diff --git a/PCK-Studio/Forms/Skins-And-Textures/SkinPreview.cs b/PCK-Studio/Forms/Skins-And-Textures/SkinPreview.cs index d24c9df4..e3ce8ed0 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/SkinPreview.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/SkinPreview.cs @@ -2,7 +2,7 @@ using System.Drawing; using System.Windows.Forms; using PckStudio.Classes.Models.DefaultModels; -using PckStudio.Classes.Utils; +using PckStudio.Internal; using PckStudio.Models; namespace PckStudio.Forms diff --git a/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs b/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs index b45db1c7..f4a8a77d 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/addnewskin.cs @@ -4,9 +4,9 @@ using System.IO; using System.Windows.Forms; using System.Drawing.Drawing2D; using System.Drawing.Imaging; -using PckStudio.Classes.Utils; using OMI.Formats.Languages; using OMI.Formats.Pck; +using PckStudio.Internal; using PckStudio.Forms.Editor; using PckStudio.Classes.IO._3DST; diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index f5ea6374..b49a4938 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -4,15 +4,15 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Linq; -using System.Numerics; using System.Windows.Forms; using System.Collections; using System.IO; +using System.Text.RegularExpressions; + using Newtonsoft.Json; using MetroFramework.Forms; -using PckStudio.Classes.Models; -using System.Text.RegularExpressions; using OMI.Formats.Pck; +using PckStudio.Internal; namespace PckStudio { @@ -93,7 +93,7 @@ namespace PckStudio "TOOL1", }; - List modelBoxes = new List(); + List modelBoxes = new List(); List modelOffsets = new List(); class ModelOffset @@ -137,7 +137,7 @@ namespace PckStudio { case "BOX": { - SkinBox box = new SkinBox(property.Item2); + var box = SkinBOX.FromString(property.Item2); string name = box.Type; if (ValidModelBoxTypes.Contains(name)) @@ -208,8 +208,8 @@ namespace PckStudio // Chooses Render settings based on current direction foreach (ListViewItem listViewItem in listViewBoxes.Items) { - if (!(listViewItem.Tag is SkinBox)) continue; - SkinBox part = listViewItem.Tag as SkinBox; + if (!(listViewItem.Tag is SkinBOX part)) + continue; float x = displayBox.Width / 2; float y = 0; @@ -287,8 +287,8 @@ namespace PckStudio part.Size.X * 5, part.Size.Y * 5); RectangleF srcRect = new RectangleF( - (part.U + part.Size.Z) * gfx_scale, - (part.V + part.Size.Z) * gfx_scale, + (part.UV.X + part.Size.Z) * gfx_scale, + (part.UV.Y + part.Size.Z) * gfx_scale, part.Size.X * gfx_scale, part.Size.Y * gfx_scale); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); @@ -360,8 +360,8 @@ namespace PckStudio part.Size.Z * 5, part.Size.Y * 5); RectangleF srcRect = new RectangleF( - (part.U + part.Size.Z + part.Size.X) * gfx_scale, - (part.V + part.Size.Z) * gfx_scale, + (part.UV.X + part.Size.Z + part.Size.X) * gfx_scale, + (part.UV.Y + part.Size.Z) * gfx_scale, part.Size.Z * gfx_scale, part.Size.Y * gfx_scale); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); @@ -438,8 +438,8 @@ namespace PckStudio part.Size.X * 5, part.Size.Y * 5); RectangleF srcRect = new RectangleF( - (part.U + part.Size.Z * 2 + part.Size.X) * gfx_scale, - (part.V + part.Size.Z) * gfx_scale, + (part.UV.X + part.Size.Z * 2 + part.Size.X) * gfx_scale, + (part.UV.Y + part.Size.Z) * gfx_scale, part.Size.X * gfx_scale, part.Size.Y * gfx_scale); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); @@ -510,8 +510,8 @@ namespace PckStudio part.Size.Z * 5, part.Size.Y * 5); RectangleF srcRect = new RectangleF( - (part.U + part.Size.Z + part.Size.X) * gfx_scale, - (part.V + part.Size.Z) * gfx_scale, + (part.UV.X + part.Size.Z + part.Size.X) * gfx_scale, + (part.UV.Y + part.Size.Z) * gfx_scale, part.Size.Z * gfx_scale, part.Size.Y * gfx_scale); graphics.DrawImage(texturePreview.Image, destRect, srcRect, GraphicsUnit.Pixel); @@ -546,8 +546,8 @@ namespace PckStudio float width = part.Size.X * 2; float height = part.Size.Y * 2; float length = part.Size.Z * 2; - float u = part.U * 2; - float v = part.V * 2; + float u = part.UV.X * 2; + float v = part.UV.Y * 2; Random r = new Random(); Brush brush = new SolidBrush(Color.FromArgb(r.Next(int.MinValue, int.MaxValue))); graphics.FillRectangle(brush, u + length, v, width, length); @@ -873,7 +873,7 @@ namespace PckStudio //Creates Item private void createToolStripMenuItem_Click(object sender, EventArgs e) { - modelBoxes.Add(new SkinBox("NEW_BOX 0 0 0 1 1 1 0 0 0 0 0")); + modelBoxes.Add(SkinBOX.FromString("NEW_BOX 0 0 0 1 1 1 0 0 0 0 0")); updateListView(); render(); } @@ -883,10 +883,10 @@ namespace PckStudio private void listView1_SelectedIndexChanged(object sender, EventArgs e) { changeColorToolStripMenuItem.Visible = false; - if (listViewBoxes.SelectedItems.Count != 0 && listViewBoxes.SelectedItems[0].Tag is SkinBox) + if (listViewBoxes.SelectedItems.Count != 0 && listViewBoxes.SelectedItems[0].Tag is SkinBOX) { changeColorToolStripMenuItem.Visible = true; - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; + var part = listViewBoxes.SelectedItems[0].Tag as SkinBOX; //graphics.DrawRectangle(Pens.Yellow, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5 - 1, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5 - 1, (float)double.Parse(this.selected.SubItems[6].Text) * 5 + 2, (float)double.Parse(this.selected.SubItems[5].Text) * 5 + 2); //graphics.DrawRectangle(Pens.Black, x + (float)double.Parse(this.selected.SubItems[3].Text) * 5, y + (float)double.Parse(this.selected.SubItems[2].Text) * 5, (float)double.Parse(this.selected.SubItems[6].Text) * 5, (float)double.Parse(this.selected.SubItems[5].Text) * 5); comboParent.Text = part.Type; @@ -896,8 +896,8 @@ namespace PckStudio SizeXUpDown.Value = (decimal)part.Size.X; SizeYUpDown.Value = (decimal)part.Size.Y; SizeZUpDown.Value = (decimal)part.Size.Z; - TextureXUpDown.Value = (decimal)part.U; - TextureYUpDown.Value = (decimal)part.V; + TextureXUpDown.Value = (decimal)part.UV.X; + TextureYUpDown.Value = (decimal)part.UV.Y; render(); } } @@ -907,9 +907,8 @@ namespace PckStudio private void comboParent_SelectedIndexChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.Type = comboParent.Text; buttonIMPORT.Enabled = true; buttonEXPORT.Enabled = true; @@ -928,9 +927,8 @@ namespace PckStudio private void SizeXUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.Size.X = (float)SizeXUpDown.Value; } updateListView(); @@ -940,9 +938,8 @@ namespace PckStudio private void SizeYUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.Size.Y = (float)SizeYUpDown.Value; } updateListView(); @@ -952,9 +949,8 @@ namespace PckStudio private void SizeZUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.Size.Z = (float)SizeZUpDown.Value; } updateListView(); @@ -964,9 +960,8 @@ namespace PckStudio private void PosXUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.Pos.X = (float)PosXUpDown.Value; } updateListView(); @@ -977,9 +972,8 @@ namespace PckStudio private void PosYUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.Pos.Y = (float)PosYUpDown.Value; } updateListView(); @@ -990,9 +984,8 @@ namespace PckStudio private void PosZUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; part.Pos.Z = (float)PosZUpDown.Value; } updateListView(); @@ -1032,10 +1025,9 @@ namespace PckStudio private void TextureXUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; - part.U = (int)TextureXUpDown.Value; + part.UV.X = (int)TextureXUpDown.Value; } updateListView(); render(); @@ -1046,10 +1038,9 @@ namespace PckStudio private void TextureYUpDown_ValueChanged(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; - part.V = (int)TextureXUpDown.Value; + part.UV.Y = (int)TextureYUpDown.Value; } updateListView(); render(); @@ -1155,12 +1146,12 @@ namespace PckStudio //Loads in model template(Steve) private void buttonTemplate_Click(object sender, EventArgs e) { - modelBoxes.Add(new SkinBox("HEAD -4 -8 -4 8 8 8 0 0 0 0 0")); - modelBoxes.Add(new SkinBox("BODY -4 0 -2 8 12 4 16 16 0 0 0")); - modelBoxes.Add(new SkinBox("ARM0 -3 -2 -2 4 12 4 40 16 0 0 0")); - modelBoxes.Add(new SkinBox("ARM1 -1 -2 -2 4 12 4 40 16 0 1 0")); - modelBoxes.Add(new SkinBox("LEG0 -2 0 -2 4 12 4 0 16 0 0 0")); - modelBoxes.Add(new SkinBox("LEG1 -2 0 -2 4 12 4 0 16 0 1 0")); + modelBoxes.Add(SkinBOX.FromString("HEAD -4 -8 -4 8 8 8 0 0 0 0 0")); + modelBoxes.Add(SkinBOX.FromString("BODY -4 0 -2 8 12 4 16 16 0 0 0")); + modelBoxes.Add(SkinBOX.FromString("ARM0 -3 -2 -2 4 12 4 40 16 0 0 0")); + modelBoxes.Add(SkinBOX.FromString("ARM1 -1 -2 -2 4 12 4 40 16 0 1 0")); + modelBoxes.Add(SkinBOX.FromString("LEG0 -2 0 -2 4 12 4 0 16 0 0 0")); + modelBoxes.Add(SkinBOX.FromString("LEG1 -2 0 -2 4 12 4 0 16 0 1 0")); comboParent.Enabled = true; updateListView(); render(); @@ -1179,8 +1170,8 @@ namespace PckStudio listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Size.X.ToString())); listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Size.Y.ToString())); listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.Size.Z.ToString())); - listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.U.ToString())); - listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.V.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.UV.X.ToString())); + listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem(listViewItem, part.UV.Y.ToString())); listViewBoxes.Items.Add(listViewItem); } } @@ -1223,23 +1214,21 @@ namespace PckStudio List lines = str1.Split(new[] { "\n\r", "\n" }, StringSplitOptions.None).ToList(); if (string.IsNullOrEmpty(lines[lines.Count - 1])) lines.RemoveAt(lines.Count - 1); - int passedlines = 0; - for (int i = 0; i < lines.Count;) + for (int i = 0; i < lines.Count; i += 11) { - string name = lines[0 + passedlines]; - string parent = lines[1 + passedlines]; - float PosX = float.Parse(lines[3 + passedlines]); - float PosY = float.Parse(lines[4 + passedlines]); - float PosZ = float.Parse(lines[5 + passedlines]); - float SizeX = float.Parse(lines[6 + passedlines]); - float SizeY = float.Parse(lines[7 + passedlines]); - float SizeZ = float.Parse(lines[8 + passedlines]); - float UvX = float.Parse(lines[9 + passedlines]); - float UvY = float.Parse(lines[10 + passedlines]); - passedlines += 11; - i += 11; + string name = lines[0 + i]; + string parent = lines[1 + i]; + float PosX = float.Parse(lines[3 + i]); + float PosY = float.Parse(lines[4 + i]); + float PosZ = float.Parse(lines[5 + i]); + float SizeX = float.Parse(lines[6 + i]); + float SizeY = float.Parse(lines[7 + i]); + float SizeZ = float.Parse(lines[8 + i]); + float UvX = float.Parse(lines[9 + i]); + float UvY = float.Parse(lines[10 + i]); + // CSM doesn't support armor, mirror, or scale values as far as I know of - May - modelBoxes.Add(new SkinBox($"{parent} {PosX} {PosY} {PosZ} {SizeX} {SizeY} {SizeZ} {UvX} {UvY} {false} {false} {0}")); + modelBoxes.Add(SkinBOX.FromString($"{parent} {PosX} {PosY} {PosZ} {SizeX} {SizeY} {SizeZ} {UvX} {UvY} {false} {false} {0}")); } } comboParent.Enabled = true; @@ -1326,9 +1315,8 @@ namespace PckStudio private void listView1_Click(object sender, EventArgs e) { if (listViewBoxes.SelectedItems.Count != 0 && listViewBoxes.SelectedItems[0] != null && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - var part = listViewBoxes.SelectedItems[0].Tag as SkinBox; comboParent.Text = part.Type; PosXUpDown.Value = (decimal)part.Pos.X; PosYUpDown.Value = (decimal)part.Pos.Y; @@ -1336,8 +1324,8 @@ namespace PckStudio SizeXUpDown.Value = (decimal)part.Size.X; SizeYUpDown.Value = (decimal)part.Size.Y; SizeZUpDown.Value = (decimal)part.Size.Z; - TextureXUpDown.Value = (decimal)part.U; - TextureYUpDown.Value = (decimal)part.V; + TextureXUpDown.Value = (decimal)part.UV.X; + TextureYUpDown.Value = (decimal)part.UV.Y; SizeXUpDown.Enabled = true; SizeYUpDown.Enabled = true; SizeZUpDown.Enabled = true; @@ -1376,9 +1364,9 @@ namespace PckStudio private void delStuffUsingDelKey(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && listViewBoxes.SelectedItems.Count != 0 && - listViewBoxes.SelectedItems[0].Tag is SkinBox) + listViewBoxes.SelectedItems[0].Tag is SkinBOX part) { - if (modelBoxes.Remove(listViewBoxes.SelectedItems[0].Tag as SkinBox)) + if (modelBoxes.Remove(part)) listViewBoxes.SelectedItems[0].Remove(); render(); } diff --git a/PCK-Studio/Internals/ApplicationBuildInfo.cs b/PCK-Studio/Internals/ApplicationBuildInfo.cs new file mode 100644 index 00000000..54c29118 --- /dev/null +++ b/PCK-Studio/Internals/ApplicationBuildInfo.cs @@ -0,0 +1,47 @@ +/* Copyright (c) 2023-present miku-666, MattNL + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ +using System; +using System.IO; +using System.Reflection; + +namespace PckStudio.Internal +{ + static class ApplicationBuildInfo + { + // this is to specify which build release this is. This is manually updated for now + // TODO: add different chars for different configurations + private const string BuildType = "b"; + private static System.Globalization.Calendar _buildCalendar; + private static DateTime date = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime; + private static string _betaBuildVersion; + + public static string BetaBuildVersion + { + get + { + // adopted Minecraft Java Edition Snapshot format (YYwWWn) + // to keep better track of work in progress features and builds + _buildCalendar ??= new System.Globalization.CultureInfo("en-US").Calendar; + return _betaBuildVersion ??= string.Format("#{0}w{1}{2}", + date.ToString("yy"), + _buildCalendar.GetWeekOfYear(date, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday), + BuildType); + } + } + } +} diff --git a/PCK-Studio/Internals/CommitInfo.cs b/PCK-Studio/Internals/CommitInfo.cs new file mode 100644 index 00000000..47ca025e --- /dev/null +++ b/PCK-Studio/Internals/CommitInfo.cs @@ -0,0 +1,50 @@ +/* Copyright (c) 2023-present miku-666 + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ +using System.Linq; +using System.Reflection; + +namespace PckStudio.Internal +{ + static class CommitInfo + { + private static string _branchName = null; + private static string _commitHash = null; + + public static string BranchName + { + get + { + return _branchName ??= Assembly + .GetEntryAssembly() + .GetCustomAttributes() + .FirstOrDefault(attr => attr.Key == "GitBranch")?.Value; + } + } + + public static string CommitHash + { + get + { + return _commitHash ??= Assembly + .GetEntryAssembly() + .GetCustomAttributes() + .FirstOrDefault(attr => attr.Key == "GitHash")?.Value; + } + } + } +} diff --git a/PCK-Studio/Classes/Utils/SkinANIM.cs b/PCK-Studio/Internals/SkinANIM.cs similarity index 99% rename from PCK-Studio/Classes/Utils/SkinANIM.cs rename to PCK-Studio/Internals/SkinANIM.cs index 58f56a2e..13fd332e 100644 --- a/PCK-Studio/Classes/Utils/SkinANIM.cs +++ b/PCK-Studio/Internals/SkinANIM.cs @@ -18,7 +18,7 @@ using System; using System.Text.RegularExpressions; -namespace PckStudio.Classes.Utils +namespace PckStudio.Internal { /// /// For usage see diff --git a/PCK-Studio/Internals/SkinBOX.cs b/PCK-Studio/Internals/SkinBOX.cs new file mode 100644 index 00000000..d32948e8 --- /dev/null +++ b/PCK-Studio/Internals/SkinBOX.cs @@ -0,0 +1,90 @@ +/* Copyright (c) 2023-present miku-666, MattNL + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1.The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. +**/ +using System; +using System.Numerics; + +namespace PckStudio.Internal +{ + public class SkinBOX + { + public string Type; + public Vector3 Pos; + public Vector3 Size; + public Vector2 UV; + public bool HideWithArmor; + public bool Mirror; + public float Scale; + + public SkinBOX(string type, Vector3 pos, Vector3 size, Vector2 uv, + bool hideWithArmor = false, bool mirror = false, float scale = 0.0f) + { + Type = type; + Pos = pos; + Size = size; + UV = uv; + HideWithArmor = hideWithArmor; + Mirror = mirror; + Scale = scale; + } + + public static SkinBOX FromString(string value) + { + var arguments = value.Split(' '); + if (arguments.Length < 9) + { + throw new ArgumentException("Arguments must have at least a length of 9"); + } + var type = arguments[0]; + var pos = TryGetVector3(arguments, 1); + var size = TryGetVector3(arguments, 4); + var uv = TryGetVector2(arguments, 7); + var skinBox = new SkinBOX(type, pos, size, uv); + if (arguments.Length >= 10) + skinBox.HideWithArmor = arguments[9] == "1"; + if (arguments.Length >= 11) + skinBox.Mirror = arguments[10] == "1"; + if (arguments.Length >= 12) + float.TryParse(arguments[11], out skinBox.Scale); + return skinBox; + } + + public ValueTuple ToProperty() + { + return new ValueTuple("BOX", ToString().Replace(',', '.')); + } + + public override string ToString() + { + return $"{Type} {Pos.X} {Pos.Y} {Pos.Z} {Size.X} {Size.Y} {Size.Z} {UV.X} {UV.Y} {Convert.ToInt32(HideWithArmor)} {Convert.ToInt32(Mirror)} {Scale}"; + } + + private static Vector2 TryGetVector2(string[] arguments, int startIndex) + { + float.TryParse(arguments[startIndex], out float x); + float.TryParse(arguments[startIndex + 1], out float y); + return new Vector2(x, y); + } + + private static Vector3 TryGetVector3(string[] arguments, int startIndex) + { + var vec2 = TryGetVector2(arguments, startIndex); + float.TryParse(arguments[startIndex + 2], out float z); + return new Vector3(vec2, z); + } + } +} diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 63938557..e0ee7a34 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -27,6 +27,7 @@ using PckStudio.Forms.Additional_Popups; using PckStudio.Classes.Misc; using PckStudio.Classes.IO.PCK; using PckStudio.Classes.IO._3DST; +using PckStudio.Internal; namespace PckStudio { @@ -75,7 +76,7 @@ namespace PckStudio ChangelogRichTextBox.Text = Resources.CHANGELOG; #if BETA - labelVersion.Text += $"{Program.Info.BetaBuildVersion}"; + labelVersion.Text += $"{ApplicationBuildInfo.BetaBuildVersion}"; #endif #if DEBUG labelVersion.Text += $" (Debug build: {CommitInfo.BranchName}@{CommitInfo.CommitHash})"; diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index c5fbddfb..7c3c8638 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -167,6 +167,7 @@ + @@ -189,10 +190,10 @@ - + - + @@ -222,6 +223,7 @@ + Form diff --git a/PCK-Studio/Program.cs b/PCK-Studio/Program.cs index f35c6e09..bcac4a6f 100644 --- a/PCK-Studio/Program.cs +++ b/PCK-Studio/Program.cs @@ -1,63 +1,10 @@ using System; using System.Diagnostics; using System.IO; -using System.Linq; -using System.Reflection; using System.Windows.Forms; namespace PckStudio { - sealed class ProgramInfo - { - // this is to specify which build release this is. This is manually updated for now - // TODO: add different chars for different configurations - private const string BuildType = "b"; - private static System.Globalization.Calendar _buildCalendar; - private DateTime date = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime; - - public string BetaBuildVersion - { - get - { - // adopted Minecraft Java Edition Snapshot format (YYwWWn) - // to keep better track of work in progress features and builds - _buildCalendar ??= new System.Globalization.CultureInfo("en-US").Calendar; - return string.Format("#{0}w{1}{2}", - date.ToString("yy"), - _buildCalendar.GetWeekOfYear(date, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday), - BuildType); - } - } - } - - static class CommitInfo - { - private static string _branchName = null; - private static string _commitHash = null; - - public static string BranchName - { - get - { - return _branchName ??= Assembly - .GetEntryAssembly() - .GetCustomAttributes() - .FirstOrDefault(attr => attr.Key == "GitBranch")?.Value; - } - } - - public static string CommitHash - { - get - { - return _commitHash ??= Assembly - .GetEntryAssembly() - .GetCustomAttributes() - .FirstOrDefault(attr => attr.Key == "GitHash")?.Value; - } - } - } - static class Program { public static readonly string ProjectUrl = "https://github.com/PhoenixARC/-PCK-Studio"; @@ -66,8 +13,6 @@ namespace PckStudio public static readonly string AppData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "PCK-Studio"); public static readonly string AppDataCache = Path.Combine(AppData, "cache"); - public static readonly ProgramInfo Info = new ProgramInfo(); - /// /// The main entry point for the application. /// From fd37f8cfd496839aeb08ffdf7ac11c92305b5be1 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 3 May 2023 16:50:18 +0200 Subject: [PATCH 75/80] Changed visibility of CommitInfo and ApplicationBuildInfo to internal --- PCK-Studio/Internals/ApplicationBuildInfo.cs | 2 +- PCK-Studio/Internals/CommitInfo.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PCK-Studio/Internals/ApplicationBuildInfo.cs b/PCK-Studio/Internals/ApplicationBuildInfo.cs index 54c29118..acd9f6e8 100644 --- a/PCK-Studio/Internals/ApplicationBuildInfo.cs +++ b/PCK-Studio/Internals/ApplicationBuildInfo.cs @@ -21,7 +21,7 @@ using System.Reflection; namespace PckStudio.Internal { - static class ApplicationBuildInfo + static internal class ApplicationBuildInfo { // this is to specify which build release this is. This is manually updated for now // TODO: add different chars for different configurations diff --git a/PCK-Studio/Internals/CommitInfo.cs b/PCK-Studio/Internals/CommitInfo.cs index 47ca025e..1ccfe3e0 100644 --- a/PCK-Studio/Internals/CommitInfo.cs +++ b/PCK-Studio/Internals/CommitInfo.cs @@ -20,7 +20,7 @@ using System.Reflection; namespace PckStudio.Internal { - static class CommitInfo + static internal class CommitInfo { private static string _branchName = null; private static string _commitHash = null; From cb7b4565f5a231cd50467cda179009b0b01cac10 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 3 May 2023 16:50:57 +0200 Subject: [PATCH 76/80] SkinBOX.cs - Added ICloneable and IEquatable interfaces --- PCK-Studio/Internals/SkinBOX.cs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/PCK-Studio/Internals/SkinBOX.cs b/PCK-Studio/Internals/SkinBOX.cs index d32948e8..764444e7 100644 --- a/PCK-Studio/Internals/SkinBOX.cs +++ b/PCK-Studio/Internals/SkinBOX.cs @@ -20,7 +20,7 @@ using System.Numerics; namespace PckStudio.Internal { - public class SkinBOX + public class SkinBOX : ICloneable, IEquatable { public string Type; public Vector3 Pos; @@ -86,5 +86,28 @@ namespace PckStudio.Internal float.TryParse(arguments[startIndex + 2], out float z); return new Vector3(vec2, z); } + + public override int GetHashCode() + { + return Type.GetHashCode() % Pos.GetHashCode() * UV.GetHashCode() % Size.GetHashCode(); + } + + public override bool Equals(object obj) + { + return obj is SkinBOX box && Equals(box); + } + + public bool Equals(SkinBOX other) + { + return Type.Equals(other.Type) && + Pos.Equals(other.Pos) && + Size.Equals(other.Size) && + UV.Equals(other.UV); + } + + public object Clone() + { + return new SkinBOX((string)Type.Clone(), Pos, Size, UV, HideWithArmor, Mirror, Scale); + } } } From 47cd6e4629cfb30e87484d8074128a87b6ef0648 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 3 May 2023 17:02:29 +0200 Subject: [PATCH 77/80] MainForm.cs - Fixed Application not showing Title in task bar --- PCK-Studio/MainForm.cs | 4 +++- PCK-Studio/MainForm.resx | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index e0ee7a34..770fdaa3 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -72,7 +72,9 @@ namespace PckStudio tabControl.SelectTab(0); isSelectingTab = false; - labelVersion.Text = "PCK Studio: " + Application.ProductVersion; + Text = Application.ProductName; + + labelVersion.Text = $"{Application.ProductName}: {Application.ProductVersion}"; ChangelogRichTextBox.Text = Resources.CHANGELOG; #if BETA diff --git a/PCK-Studio/MainForm.resx b/PCK-Studio/MainForm.resx index 656d3e81..6f665d40 100644 --- a/PCK-Studio/MainForm.resx +++ b/PCK-Studio/MainForm.resx @@ -522,7 +522,7 @@ - 180, 22 + 114, 22 New @@ -536,7 +536,7 @@ - 180, 22 + 114, 22 Open @@ -550,7 +550,7 @@ - 180, 22 + 114, 22 Extract @@ -569,7 +569,7 @@ - 180, 22 + 114, 22 Save @@ -588,13 +588,13 @@ - 180, 22 + 114, 22 Save As - 180, 22 + 114, 22 Close @@ -621,7 +621,7 @@ - 180, 22 + 176, 22 Advanced Bulk @@ -647,7 +647,7 @@ - 180, 22 + 176, 22 Convert to Bedrock From 7777fb21ca1518775719f6d31b0b8cf0f9c60379 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Thu, 4 May 2023 13:00:48 +0200 Subject: [PATCH 78/80] Moved Extensions folder out of Classes folder --- .../{Classes => }/Extensions/BlendMode.cs | 0 .../Extensions/ColorExtensions.cs | 0 .../Extensions/EnumerableExtensions.cs | 0 .../Extensions/GraphicsExtensions.cs | 0 .../Extensions/ImageExtensions.cs | 35 +++++++++---------- .../Extensions/ListExtensions.cs | 0 PCK-Studio/PckStudio.csproj | 12 +++---- 7 files changed, 22 insertions(+), 25 deletions(-) rename PCK-Studio/{Classes => }/Extensions/BlendMode.cs (100%) rename PCK-Studio/{Classes => }/Extensions/ColorExtensions.cs (100%) rename PCK-Studio/{Classes => }/Extensions/EnumerableExtensions.cs (100%) rename PCK-Studio/{Classes => }/Extensions/GraphicsExtensions.cs (100%) rename PCK-Studio/{Classes => }/Extensions/ImageExtensions.cs (87%) rename PCK-Studio/{Classes => }/Extensions/ListExtensions.cs (100%) diff --git a/PCK-Studio/Classes/Extensions/BlendMode.cs b/PCK-Studio/Extensions/BlendMode.cs similarity index 100% rename from PCK-Studio/Classes/Extensions/BlendMode.cs rename to PCK-Studio/Extensions/BlendMode.cs diff --git a/PCK-Studio/Classes/Extensions/ColorExtensions.cs b/PCK-Studio/Extensions/ColorExtensions.cs similarity index 100% rename from PCK-Studio/Classes/Extensions/ColorExtensions.cs rename to PCK-Studio/Extensions/ColorExtensions.cs diff --git a/PCK-Studio/Classes/Extensions/EnumerableExtensions.cs b/PCK-Studio/Extensions/EnumerableExtensions.cs similarity index 100% rename from PCK-Studio/Classes/Extensions/EnumerableExtensions.cs rename to PCK-Studio/Extensions/EnumerableExtensions.cs diff --git a/PCK-Studio/Classes/Extensions/GraphicsExtensions.cs b/PCK-Studio/Extensions/GraphicsExtensions.cs similarity index 100% rename from PCK-Studio/Classes/Extensions/GraphicsExtensions.cs rename to PCK-Studio/Extensions/GraphicsExtensions.cs diff --git a/PCK-Studio/Classes/Extensions/ImageExtensions.cs b/PCK-Studio/Extensions/ImageExtensions.cs similarity index 87% rename from PCK-Studio/Classes/Extensions/ImageExtensions.cs rename to PCK-Studio/Extensions/ImageExtensions.cs index 10820471..21992942 100644 --- a/PCK-Studio/Classes/Extensions/ImageExtensions.cs +++ b/PCK-Studio/Extensions/ImageExtensions.cs @@ -17,39 +17,36 @@ namespace PckStudio.Extensions internal static class ImageExtensions { - private struct ImageLayoutInfo + private struct ImageSection { - /// - /// Size of sub section of the image - /// - public readonly Size SectionSize; - public readonly Point SectionPoint; - public readonly Rectangle SectionArea; + public readonly Size Size; + public readonly Point Point; + public readonly Rectangle Area; - public ImageLayoutInfo(int width, int height, int index, ImageLayoutDirection layoutDirection) + public ImageSection(Size sectionSize, int index, ImageLayoutDirection layoutDirection) { switch(layoutDirection) { case ImageLayoutDirection.Horizontal: { - SectionSize = new Size(height,height); - SectionPoint = new Point(index * height, 0); + Size = new Size(sectionSize.Height, sectionSize.Height); + Point = new Point(index * sectionSize.Height, 0); } break; case ImageLayoutDirection.Vertical: { - SectionSize = new Size(width, width); - SectionPoint = new Point(0, index * width); + Size = new Size(sectionSize.Width, sectionSize.Width); + Point = new Point(0, index * sectionSize.Width); } break; default: - SectionSize = Size.Empty; - SectionPoint = new Point(-1, -1); + Size = Size.Empty; + Point = new Point(-1, -1); break; } - SectionArea = new Rectangle(SectionPoint, SectionSize); + Area = new Rectangle(Point, Size); } } @@ -89,8 +86,8 @@ namespace PckStudio.Extensions { for (int i = 0; i < source.Height / source.Width; i++) { - ImageLayoutInfo locationInfo = new ImageLayoutInfo(source.Width, source.Height, i, layoutDirection); - yield return source.GetArea(locationInfo.SectionArea); + ImageSection locationInfo = new ImageSection(source.Size, i, layoutDirection); + yield return source.GetArea(locationInfo.Area); } yield break; } @@ -104,8 +101,8 @@ namespace PckStudio.Extensions { foreach (var (i, texture) in sources.enumerate()) { - var info = new ImageLayoutInfo(texture.Width, texture.Height, i, layoutDirection); - graphic.DrawImage(texture, info.SectionPoint); + var info = new ImageSection(texture.Size, i, layoutDirection); + graphic.DrawImage(texture, info.Point); }; } return image; diff --git a/PCK-Studio/Classes/Extensions/ListExtensions.cs b/PCK-Studio/Extensions/ListExtensions.cs similarity index 100% rename from PCK-Studio/Classes/Extensions/ListExtensions.cs rename to PCK-Studio/Extensions/ListExtensions.cs diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 7c3c8638..28d094e5 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -172,10 +172,10 @@ - - - - + + + + @@ -192,7 +192,7 @@ - + @@ -422,7 +422,7 @@ installWiiU.cs - + Form From bef679dc827024ec7bc5536506e97c5e8722bd30 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Thu, 4 May 2023 14:37:40 +0200 Subject: [PATCH 79/80] PckStudio.csproj - Added condition to only aquire commit hash and branch name when in debug mode --- PCK-Studio/Classes/Misc/FileCacher.cs | 2 +- PCK-Studio/PckStudio.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PCK-Studio/Classes/Misc/FileCacher.cs b/PCK-Studio/Classes/Misc/FileCacher.cs index 23712fed..f2b6ecc5 100644 --- a/PCK-Studio/Classes/Misc/FileCacher.cs +++ b/PCK-Studio/Classes/Misc/FileCacher.cs @@ -1,4 +1,4 @@ -/* Copyright (c) 2023-present miku-666, MattNL +/* Copyright (c) 2023-present miku-666 * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index 28d094e5..fdd7b60e 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -18,7 +18,7 @@ false true - + @@ -31,7 +31,7 @@ $(GitBranch) - + $(IntermediateOutputPath)GitAssemblyInfo.cs From b4059ca20f495eedf3753a1bac2308355cb86688 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Thu, 4 May 2023 15:26:11 +0200 Subject: [PATCH 80/80] MainForm.cs - Fixed issue with gdi trying to play gif files --- PCK-Studio/MainForm.cs | 81 +++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 770fdaa3..3e500802 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -497,13 +497,21 @@ namespace PckStudio case PckFile.FileData.FileType.SkinFile: case PckFile.FileData.FileType.CapeFile: case PckFile.FileData.FileType.TextureFile: - // TODO: Add tga support - if (Path.GetExtension(file.Filename) == ".tga") break; - using (MemoryStream stream = new MemoryStream(file.Data)) { - try + // TODO: Add tga support + if (Path.GetExtension(file.Filename) == ".tga") break; + using MemoryStream stream = new MemoryStream(file.Data); + + var img = Image.FromStream(stream); + + if (img.RawFormat != ImageFormat.Jpeg || img.RawFormat != ImageFormat.Png) { - pictureBoxImagePreview.Image = Image.FromStream(stream); + img = new Bitmap(img); + } + + try + { + pictureBoxImagePreview.Image = img; labelImageSize.Text = $"{pictureBoxImagePreview.Image.Size.Width}x{pictureBoxImagePreview.Image.Size.Height}"; } catch (Exception ex) @@ -513,14 +521,15 @@ namespace PckStudio Debug.WriteLine("Not a supported image format. Setting back to default"); Debug.WriteLine(string.Format("An error occured of type: {0} with message: {1}", ex.GetType(), ex.Message), "Exception"); } - } - if ((file.Filename.StartsWith("res/textures/blocks/") || file.Filename.StartsWith("res/textures/items/")) && - file.Filetype == PckFile.FileData.FileType.TextureFile - && !IsFilePathMipMapped(file.Filename)) - { - buttonEdit.Text = "EDIT TILE ANIMATION"; - buttonEdit.Visible = true; + + if ((file.Filename.StartsWith("res/textures/blocks/") || file.Filename.StartsWith("res/textures/items/")) && + file.Filetype == PckFile.FileData.FileType.TextureFile + && !IsFilePathMipMapped(file.Filename)) + { + buttonEdit.Text = "EDIT TILE ANIMATION"; + buttonEdit.Visible = true; + } } break; @@ -2264,26 +2273,29 @@ namespace PckStudio private async void wavBinkaToolStripMenuItem_Click(object sender, EventArgs e) { - int success = 0; - int exitCode = 0; + using OpenFileDialog fileDialog = new OpenFileDialog + { + Multiselect = true, + Filter = "WAV files (*.wav)|*.wav", + Title = "Please choose WAV files to convert to BINKA" + }; + if (fileDialog.ShowDialog() != DialogResult.OK) + return; - OpenFileDialog ofn = new OpenFileDialog(); - ofn.Multiselect = true; - ofn.Filter = "WAV files (*.wav)|*.wav"; - ofn.Title = "Please choose WAV files to convert to BINKA"; - ofn.ShowDialog(); - ofn.Dispose(); - if (ofn.FileNames.Length < 1) return; // Return if empty or if the user cancels - - InProgressPrompt waitDiag = new InProgressPrompt(); + InProgressPrompt waitDiag = new InProgressPrompt(); waitDiag.Show(this); - foreach (string file in ofn.FileNames) + + int convertedCounter = 0; + foreach (string file in fileDialog.FileNames) { - string songName = string.Join("_", Path.GetFileNameWithoutExtension(file).Split(Path.GetInvalidFileNameChars())); + string[] a = Path.GetFileNameWithoutExtension(file).Split(Path.GetInvalidFileNameChars()); + + string songName = string.Join("_", a); songName = System.Text.RegularExpressions.Regex.Replace(songName, @"[^\u0000-\u007F]+", "_"); // Replace UTF characters string cacheSongLoc = Path.Combine(Program.AppDataCache, songName + Path.GetExtension(file)); - if (File.Exists(cacheSongLoc)) File.Delete(cacheSongLoc); + if (File.Exists(cacheSongLoc)) + File.Delete(cacheSongLoc); using (var reader = new NAudio.Wave.WaveFileReader(file)) //read from original location { @@ -2292,25 +2304,27 @@ namespace PckStudio { NAudio.Wave.WaveFileWriter.CreateWaveFile(cacheSongLoc, conversionStream); //write to new location } - reader.Close(); - reader.Dispose(); } Cursor.Current = Cursors.WaitCursor; + int exitCode = 0; await System.Threading.Tasks.Task.Run(() => { exitCode = Classes.Binka.FromWav(cacheSongLoc, Path.Combine(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(file) + ".binka"), 4); }); - if (exitCode != 0) continue; + if (exitCode != 0) + continue; - success++; + convertedCounter++; } - waitDiag.Close(); + int fileCount = fileDialog.FileNames.Length; + + waitDiag.Close(); waitDiag.Dispose(); - MessageBox.Show(this, $"Successfully converted {success}/{ofn.FileNames.Length} file{(ofn.FileNames.Length != 1 ? "s" : "")}", "Done!"); + MessageBox.Show(this, $"Successfully converted {convertedCounter}/{fileCount} file{(fileCount != 1 ? "s" : "")}", "Done!"); } private void binkaWavToolStripMenuItem_Click(object sender, EventArgs e) @@ -2324,7 +2338,8 @@ namespace PckStudio Title = "Please choose BINKA files to convert to WAV" }; - if (fileDialog.ShowDialog() != DialogResult.OK) return; + if (fileDialog.ShowDialog() != DialogResult.OK) + return; InProgressPrompt waitDiag = new InProgressPrompt(); waitDiag.Show(this);