mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Add customizable hotkeys for mod deletion.
This commit is contained in:
parent
9d43895f38
commit
c330859abc
4 changed files with 16 additions and 3 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
||||||
Subproject commit 729f12c5560536fe77f2a09f3b76c1c3c4cdb1ff
|
Subproject commit 6ce8ca816678e7a363f9f4a6f43f009f8d79c070
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Dalamud.Configuration;
|
using Dalamud.Configuration;
|
||||||
using Dalamud.Logging;
|
using Dalamud.Logging;
|
||||||
|
using OtterGui.Classes;
|
||||||
using OtterGui.Filesystem;
|
using OtterGui.Filesystem;
|
||||||
using Penumbra.Import;
|
using Penumbra.Import;
|
||||||
using Penumbra.UI.Classes;
|
using Penumbra.UI.Classes;
|
||||||
|
|
@ -46,6 +47,7 @@ public partial class Configuration : IPluginConfiguration
|
||||||
public int ModSelectorScaledSize { get; set; } = Constants.DefaultScaledSize;
|
public int ModSelectorScaledSize { get; set; } = Constants.DefaultScaledSize;
|
||||||
public bool OpenFoldersByDefault { get; set; } = false;
|
public bool OpenFoldersByDefault { get; set; } = false;
|
||||||
public string DefaultImportFolder { get; set; } = string.Empty;
|
public string DefaultImportFolder { get; set; } = string.Empty;
|
||||||
|
public DoubleModifier DeleteModModifier { get; set; } = new(ModifierHotkey.Control, ModifierHotkey.Shift);
|
||||||
|
|
||||||
public bool FixMainWindow { get; set; } = false;
|
public bool FixMainWindow { get; set; } = false;
|
||||||
public bool ShowAdvanced { get; set; }
|
public bool ShowAdvanced { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ using System.Collections.Concurrent;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using OtterGui.Classes;
|
||||||
|
|
||||||
namespace Penumbra.UI.Classes;
|
namespace Penumbra.UI.Classes;
|
||||||
|
|
||||||
|
|
@ -286,14 +287,14 @@ public sealed partial class ModFileSystemSelector : FileSystemSelector< Mod, Mod
|
||||||
|
|
||||||
private void DeleteModButton( Vector2 size )
|
private void DeleteModButton( Vector2 size )
|
||||||
{
|
{
|
||||||
var keys = ImGui.GetIO().KeyCtrl && ImGui.GetIO().KeyShift;
|
var keys = Penumbra.Config.DeleteModModifier.IsActive();
|
||||||
var tt = SelectedLeaf == null
|
var tt = SelectedLeaf == null
|
||||||
? "No mod selected."
|
? "No mod selected."
|
||||||
: "Delete the currently selected mod entirely from your drive.\n"
|
: "Delete the currently selected mod entirely from your drive.\n"
|
||||||
+ "This can not be undone.";
|
+ "This can not be undone.";
|
||||||
if( !keys )
|
if( !keys )
|
||||||
{
|
{
|
||||||
tt += "\nHold Control and Shift while clicking to delete the mod.";
|
tt += $"\nHold {Penumbra.Config.DeleteModModifier} while clicking to delete the mod.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ImGuiUtil.DrawDisabledButton( FontAwesomeIcon.Trash.ToIconString(), size, tt, SelectedLeaf == null || !keys, true )
|
if( ImGuiUtil.DrawDisabledButton( FontAwesomeIcon.Trash.ToIconString(), size, tt, SelectedLeaf == null || !keys, true )
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using ImGuiNET;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Filesystem;
|
using OtterGui.Filesystem;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
using OtterGui.Widgets;
|
||||||
|
|
||||||
namespace Penumbra.UI;
|
namespace Penumbra.UI;
|
||||||
|
|
||||||
|
|
@ -89,6 +90,15 @@ public partial class ConfigWindow
|
||||||
Penumbra.Config.OpenFoldersByDefault = v;
|
Penumbra.Config.OpenFoldersByDefault = v;
|
||||||
_window._selector.SetFilterDirty();
|
_window._selector.SetFilterDirty();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
Widget.DoubleModifierSelector( "Mod Deletion Modifier",
|
||||||
|
"A modifier you need to hold while clicking the Delete Mod button for it to take effect.", _window._inputTextWidth.X,
|
||||||
|
Penumbra.Config.DeleteModModifier,
|
||||||
|
v =>
|
||||||
|
{
|
||||||
|
Penumbra.Config.DeleteModModifier = v;
|
||||||
|
Penumbra.Config.Save();
|
||||||
|
} );
|
||||||
ImGui.Dummy( _window._defaultSpace );
|
ImGui.Dummy( _window._defaultSpace );
|
||||||
Checkbox( "Always Open Import at Default Directory",
|
Checkbox( "Always Open Import at Default Directory",
|
||||||
"Open the import window at the location specified here every time, forgetting your previous path.",
|
"Open the import window at the location specified here every time, forgetting your previous path.",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue