mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Add opening mods from associated mods tab.
This commit is contained in:
parent
927a7d4775
commit
65a0528e38
3 changed files with 22 additions and 4 deletions
|
|
@ -80,8 +80,16 @@ public class ModAssociationsTab
|
||||||
"Delete this mod from associations", false, true))
|
"Delete this mod from associations", false, true))
|
||||||
removedMod = mod;
|
removedMod = mod;
|
||||||
|
|
||||||
ImGuiUtil.DrawTableColumn(mod.Name);
|
ImGui.TableNextColumn();
|
||||||
ImGuiUtil.DrawTableColumn(mod.DirectoryName);
|
var selected = ImGui.Selectable($"{mod.Name}##name");
|
||||||
|
var hovered = ImGui.IsItemHovered();
|
||||||
|
ImGui.TableNextColumn();
|
||||||
|
selected |= ImGui.Selectable($"{mod.DirectoryName}##directory");
|
||||||
|
hovered |= ImGui.IsItemHovered();
|
||||||
|
if (selected)
|
||||||
|
_penumbra.OpenModPage(mod);
|
||||||
|
if (hovered)
|
||||||
|
ImGui.SetTooltip("Click to open mod page in Penumbra.");
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
using (var font = ImRaii.PushFont(UiBuilder.IconFont))
|
using (var font = ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Dalamud.Interface.Internal.Notifications;
|
||||||
using Dalamud.Logging;
|
using Dalamud.Logging;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Glamourer.Events;
|
using Glamourer.Events;
|
||||||
|
|
@ -59,6 +60,7 @@ public unsafe class PenumbraService : IDisposable
|
||||||
private FuncSubscriber<string, string, string, int, PenumbraApiEc> _setModPriority;
|
private FuncSubscriber<string, string, string, int, PenumbraApiEc> _setModPriority;
|
||||||
private FuncSubscriber<string, string, string, string, string, PenumbraApiEc> _setModSetting;
|
private FuncSubscriber<string, string, string, string, string, PenumbraApiEc> _setModSetting;
|
||||||
private FuncSubscriber<string, string, string, string, IReadOnlyList<string>, PenumbraApiEc> _setModSettings;
|
private FuncSubscriber<string, string, string, string, IReadOnlyList<string>, PenumbraApiEc> _setModSettings;
|
||||||
|
private FuncSubscriber<TabType, string, string, PenumbraApiEc> _openModPage;
|
||||||
|
|
||||||
private readonly EventSubscriber _initializedEvent;
|
private readonly EventSubscriber _initializedEvent;
|
||||||
private readonly EventSubscriber _disposedEvent;
|
private readonly EventSubscriber _disposedEvent;
|
||||||
|
|
@ -141,6 +143,13 @@ public unsafe class PenumbraService : IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OpenModPage(Mod mod)
|
||||||
|
{
|
||||||
|
if (_openModPage.Invoke(TabType.Mods, mod.DirectoryName, mod.Name) == PenumbraApiEc.ModMissing)
|
||||||
|
Glamourer.Chat.NotificationMessage($"Could not open the mod {mod.Name}, no fitting mod was found in your Penumbra install.",
|
||||||
|
"Mod Missing", NotificationType.Info);
|
||||||
|
}
|
||||||
|
|
||||||
public string CurrentCollection
|
public string CurrentCollection
|
||||||
=> Available ? _currentCollection.Invoke(ApiCollectionType.Current) : "<Unavailable>";
|
=> Available ? _currentCollection.Invoke(ApiCollectionType.Current) : "<Unavailable>";
|
||||||
|
|
||||||
|
|
@ -258,7 +267,8 @@ public unsafe class PenumbraService : IDisposable
|
||||||
_setModPriority = Ipc.TrySetModPriority.Subscriber(_pluginInterface);
|
_setModPriority = Ipc.TrySetModPriority.Subscriber(_pluginInterface);
|
||||||
_setModSetting = Ipc.TrySetModSetting.Subscriber(_pluginInterface);
|
_setModSetting = Ipc.TrySetModSetting.Subscriber(_pluginInterface);
|
||||||
_setModSettings = Ipc.TrySetModSettings.Subscriber(_pluginInterface);
|
_setModSettings = Ipc.TrySetModSettings.Subscriber(_pluginInterface);
|
||||||
Available = true;
|
_openModPage = Ipc.OpenMainWindow.Subscriber(_pluginInterface);
|
||||||
|
Available = true;
|
||||||
_penumbraReloaded.Invoke();
|
_penumbraReloaded.Invoke();
|
||||||
Glamourer.Log.Debug("Glamourer attached to Penumbra.");
|
Glamourer.Log.Debug("Glamourer attached to Penumbra.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 97610e1c9d27d863ae8563bb9c8525cc6f8a3709
|
Subproject commit 9472b6e327109216368c3dc1720159f5295bdb13
|
||||||
Loading…
Add table
Add a link
Reference in a new issue