Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cd847a4fb7 | |||
| c9d2b9ce94 | |||
| f6d06a652d |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -367,3 +367,6 @@ FodyWeavers.xsd
|
|||||||
Glamaholic/.github/
|
Glamaholic/.github/
|
||||||
|
|
||||||
.idea/
|
.idea/
|
||||||
|
/.claude
|
||||||
|
/.claude/settings.local.json
|
||||||
|
/nul
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Glamaholic {
|
namespace GlamourBrowser {
|
||||||
internal class Commands : IDisposable {
|
internal class Commands : IDisposable {
|
||||||
private Plugin Plugin { get; }
|
private Plugin Plugin { get; }
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Glamaholic {
|
namespace GlamourBrowser {
|
||||||
[Serializable]
|
[Serializable]
|
||||||
internal class Configuration : IPluginConfiguration {
|
internal class Configuration : IPluginConfiguration {
|
||||||
private const int CURRENT_VERSION = 1;
|
private const int CURRENT_VERSION = 1;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using System;
|
|||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Glamaholic {
|
namespace GlamourBrowser {
|
||||||
internal class DataCache {
|
internal class DataCache {
|
||||||
public static Lazy<ImmutableList<Item>> EquippableItems { get; } =
|
public static Lazy<ImmutableList<Item>> EquippableItems { get; } =
|
||||||
new(() => Service.DataManager.GetExcelSheet<Item>(ClientLanguage.English)!
|
new(() => Service.DataManager.GetExcelSheet<Item>(ClientLanguage.English)!
|
||||||
|
|||||||
60
GlamourBrowser/Interop/AT.cs
Normal file
60
GlamourBrowser/Interop/AT.cs
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ using HeightAdjuster.Interop.Glamourer;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Glamaholic.Interop {
|
namespace GlamourBrowser.Interop {
|
||||||
internal class Glamourer {
|
internal class Glamourer {
|
||||||
private static SetItem _SetItem { get; set; } = null!;
|
private static SetItem _SetItem { get; set; } = null!;
|
||||||
private static GetState _GetState { get; set; } = null!;
|
private static GetState _GetState { get; set; } = null!;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Dalamud.Plugin;
|
|||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Glamaholic {
|
namespace GlamourBrowser {
|
||||||
public class Plugin : IDalamudPlugin {
|
public class Plugin : IDalamudPlugin {
|
||||||
internal static string Name => "GlamourBrowser";
|
internal static string Name => "GlamourBrowser";
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ namespace Glamaholic {
|
|||||||
this.Commands = new Commands(this);
|
this.Commands = new Commands(this);
|
||||||
|
|
||||||
Interop.Glamourer.Initialize(Service.Interface);
|
Interop.Glamourer.Initialize(Service.Interface);
|
||||||
|
Interop.AT.Initialize(Service.CommandManager, Service.Interface, Service.ChatGui);
|
||||||
Service.Framework.Update += OnFrameworkUpdate;
|
Service.Framework.Update += OnFrameworkUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,6 +32,7 @@ namespace Glamaholic {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Interop.Glamourer.RefreshStatus(Service.Interface);
|
Interop.Glamourer.RefreshStatus(Service.Interface);
|
||||||
|
Interop.AT.RefreshStatus(Service.Interface);
|
||||||
|
|
||||||
LastInteropCheckTime = now;
|
LastInteropCheckTime = now;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface.Textures.TextureWraps;
|
using Dalamud.Interface.Textures.TextureWraps;
|
||||||
using Glamaholic.Ui;
|
using GlamourBrowser.Ui;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Glamaholic {
|
namespace GlamourBrowser {
|
||||||
internal class PluginUi : IDisposable {
|
internal class PluginUi : IDisposable {
|
||||||
internal Plugin Plugin { get; }
|
internal Plugin Plugin { get; }
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using Dalamud.IoC;
|
|||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
|
||||||
namespace Glamaholic {
|
namespace GlamourBrowser {
|
||||||
internal class Service {
|
internal class Service {
|
||||||
[PluginService] internal static IPluginLog Log { get; private set; } = null!;
|
[PluginService] internal static IPluginLog Log { get; private set; } = null!;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System.Collections.Immutable;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace Glamaholic.Ui {
|
namespace GlamourBrowser.Ui {
|
||||||
internal class MainInterface {
|
internal class MainInterface {
|
||||||
internal const int IconSize = 48;
|
internal const int IconSize = 48;
|
||||||
private const int ItemsPerRow = 5;
|
private const int ItemsPerRow = 5;
|
||||||
@@ -230,6 +230,19 @@ namespace Glamaholic.Ui {
|
|||||||
|
|
||||||
ImGui.TextUnformatted(label);
|
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 drawCursor = ImGui.GetCursorScreenPos();
|
||||||
var slotSize = SelectedGearIconSize + SelectedGearPaddingSize;
|
var slotSize = SelectedGearIconSize + SelectedGearPaddingSize;
|
||||||
var borderColour = *ImGui.GetStyleColorVec4(ImGuiCol.Border);
|
var borderColour = *ImGui.GetStyleColorVec4(ImGuiCol.Border);
|
||||||
@@ -274,6 +287,7 @@ namespace Glamaholic.Ui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui.PopItemWidth();
|
ImGui.PopItemWidth();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ImGui.SetCursorPos(cursorAfter);
|
ImGui.SetCursorPos(cursorAfter);
|
||||||
ImGui.TextUnformatted("(empty)");
|
ImGui.TextUnformatted("(empty)");
|
||||||
|
|||||||
Reference in New Issue
Block a user