3 Commits

Author SHA1 Message Date
cd847a4fb7 Fix refresh issue
All checks were successful
Build and Release / Build (push) Successful in 35s
2026-01-03 13:41:29 +02:00
c9d2b9ce94 Integrate Allagan Tools for item info in UI
Added AT interop to check plugin availability and trigger `/moreinfo` command for selected items. UI now displays a button next to each item category label to open more information via AT, with tooltips and error handling if AT is not installed. Initialization for AT interop added to plugin startup.
2026-01-03 02:39:55 +02:00
f6d06a652d Rename project from GlamourBrowser 2026-01-02 23:59:37 +02:00
10 changed files with 88 additions and 9 deletions

3
.gitignore vendored
View File

@@ -367,3 +367,6 @@ FodyWeavers.xsd
Glamaholic/.github/
.idea/
/.claude
/.claude/settings.local.json
/nul

View File

@@ -1,7 +1,7 @@
using Dalamud.Game.Command;
using System;
namespace Glamaholic {
namespace GlamourBrowser {
internal class Commands : IDisposable {
private Plugin Plugin { get; }

View File

@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
namespace Glamaholic {
namespace GlamourBrowser {
[Serializable]
internal class Configuration : IPluginConfiguration {
private const int CURRENT_VERSION = 1;

View File

@@ -5,7 +5,7 @@ using System;
using System.Collections.Immutable;
using System.Linq;
namespace Glamaholic {
namespace GlamourBrowser {
internal class DataCache {
public static Lazy<ImmutableList<Item>> EquippableItems { get; } =
new(() => Service.DataManager.GetExcelSheet<Item>(ClientLanguage.English)!

View File

@@ -0,0 +1,60 @@
using Dalamud.Plugin;
using Dalamud.Plugin.Ipc;
using Dalamud.Plugin.Services;
using HeightAdjuster.Interop.Glamourer;
using System;
using System.Collections.Generic;
namespace GlamourBrowser.Interop {
internal class AT {
private static bool Initialized { get; set; } = false;
private static bool Available { get; set; } = false;
private static ICommandManager _commandManager;
private static IChatGui _chatGui;
public static void Initialize(ICommandManager commandManager, IDalamudPluginInterface pluginInterface, IChatGui chatGui) {
if (Initialized)
return;
_commandManager = commandManager;
_chatGui = chatGui;
Initialized = true;
RefreshStatus(pluginInterface);
}
public static void RefreshStatus(IDalamudPluginInterface pluginInterface) {
var prev = Available;
Available = false;
foreach (var plugin in pluginInterface.InstalledPlugins) {
if (plugin.InternalName == "InventoryTools") {
Available = plugin.IsLoaded;
break;
}
}
if (prev == Available)
return;
}
public static void OpenMoreInformationSub(string itemId) {
if (IsAvailable()) {
_commandManager.ProcessCommand("/moreinfo " + itemId);
} else {
_chatGui.PrintError("Allagan Tools was not detected, please install it to get more information about this item.");
}
}
public static bool IsAvailable() {
return Available;
}
}
}

View File

@@ -5,7 +5,7 @@ using HeightAdjuster.Interop.Glamourer;
using System;
using System.Collections.Generic;
namespace Glamaholic.Interop {
namespace GlamourBrowser.Interop {
internal class Glamourer {
private static SetItem _SetItem { get; set; } = null!;
private static GetState _GetState { get; set; } = null!;

View File

@@ -2,7 +2,7 @@ using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using System;
namespace Glamaholic {
namespace GlamourBrowser {
public class Plugin : IDalamudPlugin {
internal static string Name => "GlamourBrowser";
@@ -22,6 +22,7 @@ namespace Glamaholic {
this.Commands = new Commands(this);
Interop.Glamourer.Initialize(Service.Interface);
Interop.AT.Initialize(Service.CommandManager, Service.Interface, Service.ChatGui);
Service.Framework.Update += OnFrameworkUpdate;
}
@@ -31,6 +32,7 @@ namespace Glamaholic {
return;
Interop.Glamourer.RefreshStatus(Service.Interface);
Interop.AT.RefreshStatus(Service.Interface);
LastInteropCheckTime = now;
}

View File

@@ -1,8 +1,8 @@
using Dalamud.Interface.Textures.TextureWraps;
using Glamaholic.Ui;
using GlamourBrowser.Ui;
using System;
namespace Glamaholic {
namespace GlamourBrowser {
internal class PluginUi : IDisposable {
internal Plugin Plugin { get; }

View File

@@ -3,7 +3,7 @@ using Dalamud.IoC;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
namespace Glamaholic {
namespace GlamourBrowser {
internal class Service {
[PluginService] internal static IPluginLog Log { get; private set; } = null!;

View File

@@ -7,7 +7,7 @@ using System.Collections.Immutable;
using System.Linq;
using System.Numerics;
namespace Glamaholic.Ui {
namespace GlamourBrowser.Ui {
internal class MainInterface {
internal const int IconSize = 48;
private const int ItemsPerRow = 5;
@@ -230,6 +230,19 @@ namespace Glamaholic.Ui {
ImGui.TextUnformatted(label);
ImGui.SameLine();
ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(2, 2));
if (ImGui.Button($"?##info-{label}", new Vector2(20, 20))) {
if (selectedItem.HasValue) {
Interop.AT.OpenMoreInformationSub(selectedItem.Value.RowId.ToString());
}
}
ImGui.PopStyleVar();
if (ImGui.IsItemHovered()) {
ImGui.SetTooltip("Click to see item location");
}
var drawCursor = ImGui.GetCursorScreenPos();
var slotSize = SelectedGearIconSize + SelectedGearPaddingSize;
var borderColour = *ImGui.GetStyleColorVec4(ImGuiCol.Border);
@@ -274,6 +287,7 @@ namespace Glamaholic.Ui {
}
ImGui.PopItemWidth();
} else {
ImGui.SetCursorPos(cursorAfter);
ImGui.TextUnformatted("(empty)");