mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 04:34:19 +01:00
Add support for middle-clicking mods.
This commit is contained in:
parent
f5822cf2c8
commit
c24a40fd9f
2 changed files with 30 additions and 7 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
||||||
Subproject commit a9dac59d36e25064ebd9cd17d519bfac91acc17e
|
Subproject commit 791a9c98aa5a533f754f4e1085d1ae6f890717ac
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
using Dalamud.Game.ClientState.Keys;
|
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.DragDrop;
|
using Dalamud.Interface.DragDrop;
|
||||||
using Dalamud.Interface.Internal.Notifications;
|
using Dalamud.Interface.Internal.Notifications;
|
||||||
|
|
@ -37,7 +36,8 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
public ModCollection SelectedSettingCollection { get; private set; } = ModCollection.Empty;
|
public ModCollection SelectedSettingCollection { get; private set; } = ModCollection.Empty;
|
||||||
|
|
||||||
public ModFileSystemSelector(IKeyState keyState, CommunicatorService communicator, ModFileSystem fileSystem, ModManager modManager,
|
public ModFileSystemSelector(IKeyState keyState, CommunicatorService communicator, ModFileSystem fileSystem, ModManager modManager,
|
||||||
CollectionManager collectionManager, Configuration config, TutorialService tutorial, FileDialogService fileDialog, MessageService messager,
|
CollectionManager collectionManager, Configuration config, TutorialService tutorial, FileDialogService fileDialog,
|
||||||
|
MessageService messager,
|
||||||
ModImportManager modImportManager, IDragDropManager dragDrop)
|
ModImportManager modImportManager, IDragDropManager dragDrop)
|
||||||
: base(fileSystem, keyState, Penumbra.Log, HandleException, allowMultipleSelection: true)
|
: base(fileSystem, keyState, Penumbra.Log, HandleException, allowMultipleSelection: true)
|
||||||
{
|
{
|
||||||
|
|
@ -167,6 +167,22 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
.Push(ImGuiCol.HeaderHovered, 0x4000FFFF, leaf.Value.Favorite);
|
.Push(ImGuiCol.HeaderHovered, 0x4000FFFF, leaf.Value.Favorite);
|
||||||
using var id = ImRaii.PushId(leaf.Value.Index);
|
using var id = ImRaii.PushId(leaf.Value.Index);
|
||||||
ImRaii.TreeNode(leaf.Value.Name, flags).Dispose();
|
ImRaii.TreeNode(leaf.Value.Name, flags).Dispose();
|
||||||
|
if (ImGui.IsItemClicked(ImGuiMouseButton.Middle))
|
||||||
|
{
|
||||||
|
var (setting, collection) = _collectionManager.Active.Current[leaf.Value.Index];
|
||||||
|
if (_config.DeleteModModifier.ForcedModifier(new DoubleModifier(ModifierHotkey.Control, ModifierHotkey.Shift)).IsActive())
|
||||||
|
{
|
||||||
|
_collectionManager.Editor.SetModInheritance(_collectionManager.Active.Current, leaf.Value, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var inherited = collection != _collectionManager.Active.Current;
|
||||||
|
if (inherited)
|
||||||
|
_collectionManager.Editor.SetModInheritance(_collectionManager.Active.Current, leaf.Value, false);
|
||||||
|
_collectionManager.Editor.SetModState(_collectionManager.Active.Current, leaf.Value, setting is not { Enabled: true });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (state.Priority != 0 && !_config.HidePrioritiesInSelector)
|
if (state.Priority != 0 && !_config.HidePrioritiesInSelector)
|
||||||
{
|
{
|
||||||
var line = ImGui.GetItemRectMin().Y;
|
var line = ImGui.GetItemRectMin().Y;
|
||||||
|
|
@ -326,13 +342,15 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_messager.NotificationMessage(e, $"Could not move newly imported mod {mod.Name} to default import folder {_config.DefaultImportFolder}.", NotificationType.Warning);
|
_messager.NotificationMessage(e,
|
||||||
|
$"Could not move newly imported mod {mod.Name} to default import folder {_config.DefaultImportFolder}.",
|
||||||
|
NotificationType.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawHelpPopup()
|
private void DrawHelpPopup()
|
||||||
{
|
{
|
||||||
ImGuiUtil.HelpPopup("ExtendedHelp", new Vector2(1000 * UiHelpers.Scale, 36.5f * ImGui.GetTextLineHeightWithSpacing()), () =>
|
ImGuiUtil.HelpPopup("ExtendedHelp", new Vector2(1000 * UiHelpers.Scale, 38.5f * ImGui.GetTextLineHeightWithSpacing()), () =>
|
||||||
{
|
{
|
||||||
ImGui.Dummy(Vector2.UnitY * ImGui.GetTextLineHeight());
|
ImGui.Dummy(Vector2.UnitY * ImGui.GetTextLineHeight());
|
||||||
ImGui.TextUnformatted("Mod Management");
|
ImGui.TextUnformatted("Mod Management");
|
||||||
|
|
@ -363,6 +381,11 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
ImGuiUtil.BulletTextColored(ColorId.FolderExpanded.Value(), "expanded mod folder.");
|
ImGuiUtil.BulletTextColored(ColorId.FolderExpanded.Value(), "expanded mod folder.");
|
||||||
ImGuiUtil.BulletTextColored(ColorId.FolderCollapsed.Value(), "collapsed mod folder");
|
ImGuiUtil.BulletTextColored(ColorId.FolderCollapsed.Value(), "collapsed mod folder");
|
||||||
indent.Pop(1);
|
indent.Pop(1);
|
||||||
|
ImGui.BulletText("Middle-click a mod to disable it if it is enabled or enable it if it is disabled.");
|
||||||
|
indent.Push();
|
||||||
|
ImGui.BulletText(
|
||||||
|
$"Holding {_config.DeleteModModifier.ForcedModifier(new DoubleModifier(ModifierHotkey.Control, ModifierHotkey.Shift))} while middle-clicking lets it inherit, discarding settings.");
|
||||||
|
indent.Pop(1);
|
||||||
ImGui.BulletText("Right-click a mod to enter its sort order, which is its name by default, possibly with a duplicate number.");
|
ImGui.BulletText("Right-click a mod to enter its sort order, which is its name by default, possibly with a duplicate number.");
|
||||||
indent.Push();
|
indent.Push();
|
||||||
ImGui.BulletText("A sort order differing from the mods name will not be displayed, it will just be used for ordering.");
|
ImGui.BulletText("A sort order differing from the mods name will not be displayed, it will just be used for ordering.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue