From 9a33b5369a4549e69ac094aeeed1be1ce104cfc0 Mon Sep 17 00:00:00 2001 From: Victor Chelaru Date: Tue, 23 Jan 2024 08:40:35 -0700 Subject: [PATCH] File build tool dialog now no longer hides behind main window. --- .../AchxToSpineAtlas/AchxToSpineAtlas/Program.cs | 15 +++++++++++++++ .../Glue/Build/BuildToolAssociationManager.cs | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/FRBDK/AchxToSpineAtlas/AchxToSpineAtlas/Program.cs b/FRBDK/AchxToSpineAtlas/AchxToSpineAtlas/Program.cs index 4cb582c05..97d98f82d 100644 --- a/FRBDK/AchxToSpineAtlas/AchxToSpineAtlas/Program.cs +++ b/FRBDK/AchxToSpineAtlas/AchxToSpineAtlas/Program.cs @@ -66,6 +66,9 @@ private static string ConvertToAtlasString(AnimationChainListSave animationChain { stringBuilder.AppendLine(animationChain.Name); var frame = animationChain.Frames[0]; + + WarnIfFrameTextureDiffers(frame, texture); + WriteFrameCooordinates(stringBuilder, frame); } else @@ -74,6 +77,8 @@ private static string ConvertToAtlasString(AnimationChainListSave animationChain { var frame = animationChain.Frames[i]; + WarnIfFrameTextureDiffers(frame, texture); + stringBuilder.AppendLine(animationChain.Name + "_" + i); WriteFrameCooordinates(stringBuilder, frame); } @@ -83,6 +88,16 @@ private static string ConvertToAtlasString(AnimationChainListSave animationChain return stringBuilder.ToString(); } + private static void WarnIfFrameTextureDiffers(AnimationFrameSave frame, string texture) + { + var frameTexture = frame.TextureName?.Replace("\\", "/"); + + if(frameTexture != texture) + { + Console.WriteLine($"warning : animation frame uses different texture from first: {frameTexture}"); + } + } + private static void WriteFrameCooordinates(StringBuilder stringBuilder, AnimationFrameSave frame) { var x = MathFunctions.RoundToInt(frame.LeftCoordinate); diff --git a/FRBDK/Glue/Glue/Build/BuildToolAssociationManager.cs b/FRBDK/Glue/Glue/Build/BuildToolAssociationManager.cs index 5b05e9e12..735f257c9 100644 --- a/FRBDK/Glue/Glue/Build/BuildToolAssociationManager.cs +++ b/FRBDK/Glue/Glue/Build/BuildToolAssociationManager.cs @@ -8,6 +8,7 @@ using System.Windows.Forms; using FlatRedBall.Glue.Plugins.ExportedImplementations; using L = Localization; +using Glue; namespace FlatRedBall.Glue.Managers; @@ -134,7 +135,10 @@ public BuildToolAssociation GetBuildToolAssocationAndNameFor(string fileName, ou } nfw.ResultName = FileManager.RemoveExtension(FileManager.RemovePath(fileName)); - DialogResult result = nfw.ShowDialog(); + DialogResult result = DialogResult.Cancel; + + GlueCommands.Self.DoOnUiThread(() => result = nfw.ShowDialog(MainGlueWindow.Self)); + //result = nfw.ShowDialog(); extraCommandLineArguments = ""; if (result == DialogResult.OK)