From 72d5f9a0ae35314e09c4fa44d3595c3a4a577d5c Mon Sep 17 00:00:00 2001 From: soopercool101 Date: Mon, 29 Apr 2024 17:49:46 -0700 Subject: [PATCH] 50CC: Fix crash when a palette doesn't exist that should Also use VistaFolderBrowserDialog instead of FolderBrowserDialog --- BrawlCrate/NodeWrappers/Graphics/TEX0Wrapper.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BrawlCrate/NodeWrappers/Graphics/TEX0Wrapper.cs b/BrawlCrate/NodeWrappers/Graphics/TEX0Wrapper.cs index dc5f84fc5..3cb97bdf9 100644 --- a/BrawlCrate/NodeWrappers/Graphics/TEX0Wrapper.cs +++ b/BrawlCrate/NodeWrappers/Graphics/TEX0Wrapper.cs @@ -1,6 +1,7 @@ using BrawlCrate.ExternalInterfacing; using BrawlCrate.UI; using BrawlLib.Internal.Windows.Forms; +using BrawlLib.Internal.Windows.Forms.Ookii.Dialogs; using BrawlLib.SSBB; using BrawlLib.SSBB.ResourceNodes; using System; @@ -319,7 +320,7 @@ public void ConvertToStock50() } } - if (tx0.HasPalette) + if (tx0.HasPalette && tx0.GetPaletteNode() != null) { tx0.GetPaletteNode().Name = "InfStc." + tx0.texSortNum.ToString("0000"); } @@ -417,7 +418,11 @@ public void ConvertToStock50() if (!autoFoundFolder) { +#if MONO FolderBrowserDialog f = new FolderBrowserDialog +#else + VistaFolderBrowserDialog f = new VistaFolderBrowserDialog +#endif { Description = "Select the \"portrite\" folder" };