diff --git a/Glamourer/Gui/Tabs/DesignTab/ModAssociationsTab.cs b/Glamourer/Gui/Tabs/DesignTab/ModAssociationsTab.cs index 8aa7e09..38cb811 100644 --- a/Glamourer/Gui/Tabs/DesignTab/ModAssociationsTab.cs +++ b/Glamourer/Gui/Tabs/DesignTab/ModAssociationsTab.cs @@ -80,8 +80,16 @@ public class ModAssociationsTab "Delete this mod from associations", false, true)) removedMod = mod; - ImGuiUtil.DrawTableColumn(mod.Name); - ImGuiUtil.DrawTableColumn(mod.DirectoryName); + ImGui.TableNextColumn(); + 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(); using (var font = ImRaii.PushFont(UiBuilder.IconFont)) { diff --git a/Glamourer/Interop/Penumbra/PenumbraService.cs b/Glamourer/Interop/Penumbra/PenumbraService.cs index b00aefd..375d148 100644 --- a/Glamourer/Interop/Penumbra/PenumbraService.cs +++ b/Glamourer/Interop/Penumbra/PenumbraService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; +using Dalamud.Interface.Internal.Notifications; using Dalamud.Logging; using Dalamud.Plugin; using Glamourer.Events; @@ -59,6 +60,7 @@ public unsafe class PenumbraService : IDisposable private FuncSubscriber _setModPriority; private FuncSubscriber _setModSetting; private FuncSubscriber, PenumbraApiEc> _setModSettings; + private FuncSubscriber _openModPage; private readonly EventSubscriber _initializedEvent; 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 => Available ? _currentCollection.Invoke(ApiCollectionType.Current) : ""; @@ -258,7 +267,8 @@ public unsafe class PenumbraService : IDisposable _setModPriority = Ipc.TrySetModPriority.Subscriber(_pluginInterface); _setModSetting = Ipc.TrySetModSetting.Subscriber(_pluginInterface); _setModSettings = Ipc.TrySetModSettings.Subscriber(_pluginInterface); - Available = true; + _openModPage = Ipc.OpenMainWindow.Subscriber(_pluginInterface); + Available = true; _penumbraReloaded.Invoke(); Glamourer.Log.Debug("Glamourer attached to Penumbra."); } diff --git a/Penumbra.Api b/Penumbra.Api index 97610e1..9472b6e 160000 --- a/Penumbra.Api +++ b/Penumbra.Api @@ -1 +1 @@ -Subproject commit 97610e1c9d27d863ae8563bb9c8525cc6f8a3709 +Subproject commit 9472b6e327109216368c3dc1720159f5295bdb13