From 4cd03f2198cb93a3f1205b30f466232380660aa9 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Tue, 2 May 2023 20:50:10 +0200 Subject: [PATCH] Work around some file picker stuff for textures. --- .../UI/AdvancedWindow/ModEditWindow.Textures.cs | 14 ++++++++++---- Penumbra/UI/AdvancedWindow/ModEditWindow.cs | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Penumbra/UI/AdvancedWindow/ModEditWindow.Textures.cs b/Penumbra/UI/AdvancedWindow/ModEditWindow.Textures.cs index 514dcb02..d235c417 100644 --- a/Penumbra/UI/AdvancedWindow/ModEditWindow.Textures.cs +++ b/Penumbra/UI/AdvancedWindow/ModEditWindow.Textures.cs @@ -45,7 +45,8 @@ public partial class ModEditWindow _fileDialog, _config.DefaultModImportPath); var files = _editor.Files.Tex.SelectMany(f => f.SubModUsage.Select(p => (p.Item2.ToString(), true)) .Prepend((f.File.FullName, false))); - tex.PathSelectBox(_dalamud, "##combo", "Select the textures included in this mod on your drive or the ones they replace from the game files.", + tex.PathSelectBox(_dalamud, "##combo", + "Select the textures included in this mod on your drive or the ones they replace from the game files.", files, _mod.ModPath.FullName.Length + 1); if (tex == _left) @@ -84,6 +85,8 @@ public partial class ModEditWindow "Add the appropriate number of MipMaps to the file."); } + private bool _forceTextureStartPath = true; + private void DrawOutputChild(Vector2 size, Vector2 imageSize) { using var child = ImRaii.Child("Output", size, true); @@ -102,7 +105,8 @@ public partial class ModEditWindow { if (a) _center.SaveAsTex(b, (CombinedTexture.TextureSaveType)_currentSaveAs, _addMipMaps); - }, _mod!.ModPath.FullName, false); + }, _mod!.ModPath.FullName, _forceTextureStartPath); + _forceTextureStartPath = false; } if (ImGui.Button("Save as DDS", -Vector2.UnitX)) @@ -112,7 +116,8 @@ public partial class ModEditWindow { if (a) _center.SaveAsDds(b, (CombinedTexture.TextureSaveType)_currentSaveAs, _addMipMaps); - }, _mod!.ModPath.FullName, false); + }, _mod!.ModPath.FullName, _forceTextureStartPath); + _forceTextureStartPath = false; } ImGui.NewLine(); @@ -124,7 +129,8 @@ public partial class ModEditWindow { if (a) _center.SaveAsPng(b); - }, _mod!.ModPath.FullName, false); + }, _mod!.ModPath.FullName, _forceTextureStartPath); + _forceTextureStartPath = false; } ImGui.NewLine(); diff --git a/Penumbra/UI/AdvancedWindow/ModEditWindow.cs b/Penumbra/UI/AdvancedWindow/ModEditWindow.cs index 211acc85..ba6cc0aa 100644 --- a/Penumbra/UI/AdvancedWindow/ModEditWindow.cs +++ b/Penumbra/UI/AdvancedWindow/ModEditWindow.cs @@ -59,6 +59,7 @@ public partial class ModEditWindow : Window, IDisposable _shaderPackageTab.Reset(); _itemSwapTab.UpdateMod(mod, _activeCollections.Current[mod.Index].Settings); UpdateModels(); + _forceTextureStartPath = true; } public void ChangeOption(SubMod? subMod)