Skip to content

Commit

Permalink
File build tool dialog now no longer hides behind main window.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Jan 23, 2024
1 parent 406f779 commit 9a33b53
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 15 additions & 0 deletions FRBDK/AchxToSpineAtlas/AchxToSpineAtlas/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
Expand All @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion FRBDK/Glue/Glue/Build/BuildToolAssociationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Windows.Forms;
using FlatRedBall.Glue.Plugins.ExportedImplementations;
using L = Localization;
using Glue;

namespace FlatRedBall.Glue.Managers;

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9a33b53

Please sign in to comment.