Skip to content

Commit

Permalink
Merge branch 'manifest-patch' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Aug 23, 2023
2 parents 8205fbb + 3e93a81 commit c422527
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Craftimizer/Craftimizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Authors>Asriel Camora</Authors>
<Version>1.2.0.0</Version>
<Version>1.2.1.0</Version>
<PackageProjectUrl>https://github.com/WorkingRobot/craftimizer.git</PackageProjectUrl>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Craftimizer/Craftimizer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"Author": "Asriel Camora",
"Author": "Asriel",
"Name": "Craftimizer",
"Punchline": "Simulate crafts and create computer-assisted macros from the comfort of your own game",
"Description": "Allows you to generate macros and simulate all sorts of crafts without having to open another app. Open your crafting log to get started.",
"RepoUrl": "https://github.com/WorkingRobot/craftimizer",
"InternalName": "craftimizer",
"InternalName": "Craftimizer",
"ApplicableVersion": "any",
"DalamudApiLevel": 8,
"Tags": [
Expand Down
12 changes: 5 additions & 7 deletions Craftimizer/Icons.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
using Dalamud.Interface.Internal;
using ImGuiScene;
using System.Collections.Generic;

namespace Craftimizer.Plugin;

internal static class Icons
{
private static readonly Dictionary<string, TextureWrap> Cache = new();
private static readonly Dictionary<ushort, IDalamudTextureWrap> Cache = new();

public static TextureWrap GetIconFromPath(string path)
public static TextureWrap GetIconFromId(ushort id)
{
if (!Cache.TryGetValue(path, out var ret))
Cache.Add(path, ret = Service.DataManager.GetImGuiTexture(path)!);
if (!Cache.TryGetValue(id, out var ret))
Cache.Add(id, ret = Service.TextureProvider.GetIcon(id)!);
return ret;
}

public static TextureWrap GetIconFromId(ushort id) =>
GetIconFromPath($"ui/icon/{id / 1000 * 1000:000000}/{id:000000}_hr1.tex");
}
16 changes: 9 additions & 7 deletions Craftimizer/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@
using Dalamud.Interface.Windowing;
using Dalamud.IoC;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;

namespace Craftimizer.Plugin;

public sealed class Service
{
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
[PluginService] public static DalamudPluginInterface PluginInterface { get; private set; }
[PluginService] public static CommandManager CommandManager { get; private set; }
[PluginService] public static ObjectTable Objects { get; private set; }
[PluginService] public static SigScanner SigScanner { get; private set; }
[PluginService] public static GameGui GameGui { get; private set; }
[PluginService] public static ClientState ClientState { get; private set; }
[PluginService] public static DataManager DataManager { get; private set; }
[PluginService] public static TargetManager TargetManager { get; private set; }
[PluginService] public static ICommandManager CommandManager { get; private set; }
[PluginService] public static IObjectTable Objects { get; private set; }
[PluginService] public static ISigScanner SigScanner { get; private set; }
[PluginService] public static IGameGui GameGui { get; private set; }
[PluginService] public static IClientState ClientState { get; private set; }
[PluginService] public static IDataManager DataManager { get; private set; }
[PluginService] public static ITargetManager TargetManager { get; private set; }
[PluginService] public static Condition Condition { get; private set; }
[PluginService] public static Framework Framework { get; private set; }
[PluginService] public static ITextureProvider TextureProvider { get; private set; }

public static Plugin Plugin { get; internal set; }
public static Configuration Configuration { get; internal set; }
Expand Down
2 changes: 1 addition & 1 deletion Craftimizer/Utils/Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Craftimizer.Utils;
public sealed unsafe class Hooks : IDisposable
{
public delegate void OnActionUsedDelegate(ActionType action);

public event OnActionUsedDelegate? OnActionUsed;

public delegate bool UseActionDelegate(ActionManager* manager, CSActionType actionType, uint actionId, ulong targetId, uint param, uint useType, int pvp, nint a8);
Expand Down

0 comments on commit c422527

Please sign in to comment.