From 0d150cf19bd772debc9e7ec1f267ea6084e95ff2 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sun, 25 Sep 2022 18:34:22 +0200 Subject: [PATCH] Add reloading button to textures. --- Penumbra/Import/Textures/Texture.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Penumbra/Import/Textures/Texture.cs b/Penumbra/Import/Textures/Texture.cs index a3ca306c..1f2997ee 100644 --- a/Penumbra/Import/Textures/Texture.cs +++ b/Penumbra/Import/Textures/Texture.cs @@ -250,7 +250,7 @@ public sealed class Texture : IDisposable _tmpPath ??= Path; using var spacing = ImRaii.PushStyle( ImGuiStyleVar.ItemSpacing, new Vector2( 3 * ImGuiHelpers.GlobalScale, ImGui.GetStyle().ItemSpacing.Y ) ); - ImGui.SetNextItemWidth( -ImGui.GetFrameHeight() - 3 * ImGuiHelpers.GlobalScale ); + ImGui.SetNextItemWidth( -2 * ImGui.GetFrameHeight() - 7 * ImGuiHelpers.GlobalScale ); ImGui.InputTextWithHint( label, hint, ref _tmpPath, Utf8GamePath.MaxGamePathLength ); if( ImGui.IsItemDeactivatedAfterEdit() ) { @@ -279,5 +279,15 @@ public sealed class Texture : IDisposable manager.OpenFileDialog( "Open Image...", "Textures{.png,.dds,.tex}", UpdatePath, 1, startPath ); } + + ImGui.SameLine(); + if( ImGuiUtil.DrawDisabledButton( FontAwesomeIcon.Recycle.ToIconString(), new Vector2( ImGui.GetFrameHeight() ), + "Reload the currently selected path.", false, + true ) ) + { + var path = Path; + Path = string.Empty; + Load( path ); + } } } \ No newline at end of file