API9 updates
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.62">
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.13.8" />
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.92">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -4,7 +4,6 @@ using Craftimizer.Solver;
|
||||
using Dalamud.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
namespace Craftimizer.Plugin;
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DalamudPackager" Version="2.1.11" />
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.62">
|
||||
<PackageReference Include="DalamudPackager" Version="2.1.12" />
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.92">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
@@ -56,10 +56,6 @@
|
||||
<HintPath>$(DalamudLibPath)Dalamud.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Dalamud">
|
||||
<HintPath>$(DalamudLibPath)Dalamud.Interface.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImGui.NET">
|
||||
<HintPath>$(DalamudLibPath)ImGui.NET.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"RepoUrl": "https://github.com/WorkingRobot/craftimizer",
|
||||
"InternalName": "craftimizer",
|
||||
"ApplicableVersion": "any",
|
||||
"DalamudApiLevel": 8,
|
||||
"Tags": [
|
||||
"crafting",
|
||||
"doh",
|
||||
|
||||
@@ -2,6 +2,7 @@ using Craftimizer.Plugin.Windows;
|
||||
using Craftimizer.Simulator;
|
||||
using Craftimizer.Utils;
|
||||
using Craftimizer.Windows;
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.Plugin;
|
||||
@@ -18,7 +19,7 @@ public sealed class Plugin : IDalamudPlugin
|
||||
public string Version { get; }
|
||||
public string Author { get; }
|
||||
public string BuildConfiguration { get; }
|
||||
public TextureWrap Icon { get; }
|
||||
public IDalamudTextureWrap Icon { get; }
|
||||
|
||||
public WindowSystem WindowSystem { get; }
|
||||
public Settings SettingsWindow { get; }
|
||||
|
||||
@@ -21,8 +21,10 @@ public sealed class Service
|
||||
[PluginService] public static IDataManager DataManager { get; private set; }
|
||||
[PluginService] public static ITextureProvider TextureProvider { 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 ICondition Condition { get; private set; }
|
||||
[PluginService] public static IFramework Framework { get; private set; }
|
||||
[PluginService] public static IPluginLog PluginLog { get; private set; }
|
||||
[PluginService] public static IGameInteropProvider GameInteropProvider { get; private set; }
|
||||
|
||||
public static Plugin Plugin { get; private set; }
|
||||
public static Configuration Configuration => Plugin.Configuration;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Craftimizer.Simulator;
|
||||
using Craftimizer.Simulator.Actions;
|
||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Utility;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||
@@ -86,7 +87,7 @@ internal static class ActionUtils
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
public static TextureWrap GetIcon(this ActionType me, ClassJob classJob)
|
||||
public static IDalamudTextureWrap GetIcon(this ActionType me, ClassJob classJob)
|
||||
{
|
||||
var (craftAction, action) = GetActionRow(me, classJob);
|
||||
if (craftAction != null)
|
||||
@@ -325,7 +326,7 @@ internal static class EffectUtils
|
||||
return (ushort)iconId;
|
||||
}
|
||||
|
||||
public static TextureWrap GetIcon(this EffectType me, int strength) =>
|
||||
public static IDalamudTextureWrap GetIcon(this EffectType me, int strength) =>
|
||||
Service.IconManager.GetIcon(me.GetIconId(strength));
|
||||
|
||||
public static string GetTooltip(this EffectType me, int strength, int duration)
|
||||
|
||||
@@ -33,7 +33,7 @@ public static unsafe class Gearsets
|
||||
|
||||
public static GearsetItem[] GetGearsetItems(RaptureGearsetModule.GearsetEntry* entry)
|
||||
{
|
||||
var gearsetItems = new Span<RaptureGearsetModule.GearsetItem>(entry->ItemsData, 14);
|
||||
var gearsetItems = entry->ItemsSpan;
|
||||
var items = new GearsetItem[14];
|
||||
for (var i = 0; i < 14; ++i)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ public sealed unsafe class Hooks : IDisposable
|
||||
|
||||
public Hooks()
|
||||
{
|
||||
UseActionHook = Hook<UseActionDelegate>.FromAddress((nint)ActionManager.MemberFunctionPointers.UseAction, UseActionDetour);
|
||||
UseActionHook = Service.GameInteropProvider.HookFromAddress<UseActionDelegate>((nint)ActionManager.MemberFunctionPointers.UseAction, UseActionDetour);
|
||||
UseActionHook.Enable();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public sealed unsafe class Hooks : IDisposable
|
||||
{
|
||||
var canCast = manager->GetActionStatus(actionType, actionId) == 0;
|
||||
var ret = UseActionHook.Original(manager, actionType, actionId, targetId, param, useType, pvp, a8);
|
||||
if (canCast && ret && (actionType == CSActionType.CraftAction || actionType == CSActionType.Spell))
|
||||
if (canCast && ret && (actionType == CSActionType.CraftAction || actionType == CSActionType.Action))
|
||||
{
|
||||
var classJob = ClassJobUtils.GetClassJobFromIdx((byte)(Service.ClientState.LocalPlayer?.ClassJob.Id ?? 0));
|
||||
if (classJob != null)
|
||||
|
||||
@@ -12,7 +12,7 @@ public sealed class IconManager : IDisposable
|
||||
{
|
||||
private readonly Dictionary<uint, IDalamudTextureWrap> iconCache = new();
|
||||
private readonly Dictionary<string, IDalamudTextureWrap> textureCache = new();
|
||||
private readonly Dictionary<string, TextureWrap> assemblyCache = new();
|
||||
private readonly Dictionary<string, IDalamudTextureWrap> assemblyCache = new();
|
||||
|
||||
public IDalamudTextureWrap GetIcon(uint id)
|
||||
{
|
||||
@@ -30,14 +30,14 @@ public sealed class IconManager : IDisposable
|
||||
return ret;
|
||||
}
|
||||
|
||||
public TextureWrap GetAssemblyTexture(string filename)
|
||||
public IDalamudTextureWrap GetAssemblyTexture(string filename)
|
||||
{
|
||||
if (!assemblyCache.TryGetValue(filename, out var ret))
|
||||
assemblyCache.Add(filename, ret = GetAssemblyTextureInternal(filename));
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static TextureWrap GetAssemblyTextureInternal(string filename)
|
||||
private static IDalamudTextureWrap GetAssemblyTextureInternal(string filename)
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
byte[] iconData;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using Craftimizer.Plugin;
|
||||
using System;
|
||||
|
||||
namespace Craftimizer.Utils;
|
||||
|
||||
public static class Log
|
||||
{
|
||||
public static void Debug(string line) => Service.PluginLog.Debug(line);
|
||||
|
||||
public static void Error(string line) => Service.PluginLog.Error(line);
|
||||
public static void Error(Exception e, string line) => Service.PluginLog.Error(e, line);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ using Craftimizer.Plugin;
|
||||
using Craftimizer.Simulator;
|
||||
using Dalamud.Game;
|
||||
using Dalamud.Logging;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.UI;
|
||||
@@ -84,7 +85,7 @@ public sealed unsafe class RecipeNote : IDisposable
|
||||
Service.Framework.Update += FrameworkUpdate;
|
||||
}
|
||||
|
||||
private void FrameworkUpdate(Framework f)
|
||||
private void FrameworkUpdate(IFramework f)
|
||||
{
|
||||
HasValidRecipe = false;
|
||||
try
|
||||
@@ -93,7 +94,7 @@ public sealed unsafe class RecipeNote : IDisposable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
PluginLog.LogError(e, "RecipeNote framework update failed");
|
||||
Log.Error(e, "RecipeNote framework update failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using Craftimizer.Plugin.Utils;
|
||||
using Craftimizer.Utils;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
using ImGuiNET;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using Craftimizer.Simulator;
|
||||
using Craftimizer.Simulator.Actions;
|
||||
using Craftimizer.Utils;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Craftimizer.Plugin.Windows;
|
||||
|
||||
@@ -50,7 +49,7 @@ public sealed unsafe partial class Craft : Window, IDisposable
|
||||
|
||||
SolverTaskToken = new();
|
||||
SolverTask = new(Config.SynthHelperSolverConfig, state) { Token = SolverTaskToken.Token };
|
||||
SolverTask.OnLog += s => PluginLog.Debug(s);
|
||||
SolverTask.OnLog += s => Log.Debug(s);
|
||||
SolverTask.OnNewAction += SolverActionQueue.Enqueue;
|
||||
SolverTask.Start();
|
||||
}
|
||||
|
||||
@@ -394,22 +394,20 @@ public unsafe class CraftingLog : Window
|
||||
|
||||
for (var i = 0; i < 100; i++)
|
||||
{
|
||||
var gearset = inst->Gearset[i];
|
||||
if (gearset == null)
|
||||
var gearset = inst->EntriesSpan[i];
|
||||
if (gearset.ID != i)
|
||||
continue;
|
||||
if (gearset->ID != i)
|
||||
continue;
|
||||
if (!gearset->Flags.HasFlag(RaptureGearsetModule.GearsetFlag.Exists))
|
||||
if (!gearset.Flags.HasFlag(RaptureGearsetModule.GearsetFlag.Exists))
|
||||
continue;
|
||||
|
||||
if (ClassJobUtils.GetClassJobFromIdx(gearset->ClassJob) != RecipeUtils.ClassJob)
|
||||
if (ClassJobUtils.GetClassJobFromIdx(gearset.ClassJob) != RecipeUtils.ClassJob)
|
||||
continue;
|
||||
|
||||
var items = Gearsets.GetGearsetItems(gearset);
|
||||
var items = Gearsets.GetGearsetItems(&gearset);
|
||||
var stats = Gearsets.CalculateCharacterStats(items, RecipeUtils.CharacterLevel, RecipeUtils.CanUseManipulation);
|
||||
var gearsetId = gearset->ID + 1;
|
||||
var gearsetId = gearset.ID + 1;
|
||||
|
||||
ImGuiUtils.BeginGroupPanel($"{SafeMemory.ReadString((nint)gearset->Name, 47)} ({gearsetId})");
|
||||
ImGuiUtils.BeginGroupPanel($"{SafeMemory.ReadString((nint)gearset.Name, 47)} ({gearsetId})");
|
||||
ImGui.Text(GetCharacterStatsText(stats));
|
||||
ImGui.SameLine();
|
||||
if (ImGuiComponents.IconButton($"SwapGearset{gearsetId}", FontAwesomeIcon.SyncAlt))
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
using Craftimizer.Plugin;
|
||||
using Craftimizer.Plugin;
|
||||
using Craftimizer.Plugin.Utils;
|
||||
using Craftimizer.Simulator;
|
||||
using Craftimizer.Simulator.Actions;
|
||||
using Craftimizer.Solver;
|
||||
using Craftimizer.Utils;
|
||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Interface.GameFonts;
|
||||
using Dalamud.Interface.Raii;
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Interface.Style;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Utility;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
@@ -56,6 +60,11 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
||||
private TextureWrap SplendorousBadge { get; }
|
||||
private TextureWrap SpecialistBadge { get; }
|
||||
private TextureWrap NoManipulationBadge { get; }
|
||||
private IDalamudTextureWrap ExpertBadge { get; }
|
||||
private IDalamudTextureWrap CollectibleBadge { get; }
|
||||
private IDalamudTextureWrap SplendorousBadge { get; }
|
||||
private IDalamudTextureWrap SpecialistBadge { get; }
|
||||
private IDalamudTextureWrap NoManipulationBadge { get; }
|
||||
private GameFontHandle AxisFont { get; }
|
||||
|
||||
public RecipeNote() : base("Craftimizer RecipeNode", WindowFlags, false)
|
||||
@@ -563,14 +572,12 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
||||
var gearsetModule = RaptureGearsetModule.Instance();
|
||||
for (var i = 0; i < 100; i++)
|
||||
{
|
||||
var gearset = gearsetModule->Gearset[i];
|
||||
if (gearset == null)
|
||||
var gearset = gearsetModule->EntriesSpan[i];
|
||||
if (!gearset.Flags.HasFlag(RaptureGearsetModule.GearsetFlag.Exists))
|
||||
continue;
|
||||
if (!gearset->Flags.HasFlag(RaptureGearsetModule.GearsetFlag.Exists))
|
||||
if (gearset.ID != i)
|
||||
continue;
|
||||
if (gearset->ID != i)
|
||||
continue;
|
||||
if (gearset->ClassJob != job.GetClassJobIndex())
|
||||
if (gearset.ClassJob != job.GetClassJobIndex())
|
||||
continue;
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Craftimizer.Solver;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using ImGuiNET;
|
||||
using System;
|
||||
|
||||
@@ -3,10 +3,11 @@ using Craftimizer.Simulator.Actions;
|
||||
using Dalamud.Game.Text;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
using ImGuiScene;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
@@ -204,7 +205,7 @@ public sealed partial class Simulator : Window, IDisposable
|
||||
ImGuiUtils.BeginGroupPanel("Effects", drawParams.Total);
|
||||
|
||||
var effectHeight = ImGui.GetFontSize() * 2f;
|
||||
Vector2 GetEffectSize(TextureWrap icon) => new(icon.Width * effectHeight / icon.Height, effectHeight);
|
||||
Vector2 GetEffectSize(IDalamudTextureWrap icon) => new(icon.Width * effectHeight / icon.Height, effectHeight);
|
||||
|
||||
ImGui.Dummy(new(0, effectHeight));
|
||||
ImGui.SameLine(0, 0);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
using Craftimizer.Simulator;
|
||||
using Craftimizer.Simulator.Actions;
|
||||
using Craftimizer.Utils;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Craftimizer.Plugin.Windows;
|
||||
|
||||
@@ -85,7 +84,7 @@ public sealed partial class Simulator : Window, IDisposable
|
||||
SolverInitialActionCount = Actions.Count;
|
||||
SolverTaskToken = new();
|
||||
SolverTask = new(Config.SimulatorSolverConfig, solverState) { Token = SolverTaskToken.Token };
|
||||
SolverTask.OnLog += s => PluginLog.Debug(s);
|
||||
SolverTask.OnLog += s => Log.Debug(s);
|
||||
SolverTask.OnNewAction += SolverActionQueue.Enqueue;
|
||||
SolverTask.Start();
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
"net7.0-windows7.0": {
|
||||
"DalamudPackager": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.1.11, )",
|
||||
"resolved": "2.1.11",
|
||||
"contentHash": "9qlAWoRRTiL/geAvuwR/g6Bcbrd/bJJgVnB/RurBiyKs6srsP0bvpoo8IK+Eg8EA6jWeM6/YJWs66w4FIAzqPw=="
|
||||
"requested": "[2.1.12, )",
|
||||
"resolved": "2.1.12",
|
||||
"contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg=="
|
||||
},
|
||||
"Meziantou.Analyzer": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.0.62, )",
|
||||
"resolved": "2.0.62",
|
||||
"contentHash": "uG2CiDIm97q8KrUt8B34WdElpEDDLOe4YzrLWpwlQmesXrSX2WuJZ+HwIGWrJgDBBMi2a3tVjeF8oKjV+AhUdA=="
|
||||
"requested": "[2.0.92, )",
|
||||
"resolved": "2.0.92",
|
||||
"contentHash": "gVyPM2gDPfxvZ2rGUKzTNZsNhdgsetfYd+OKowKwMqZ9K00j1amUU+SnlRI26629EKK4cbJWJwHs00UPXRr0BA=="
|
||||
},
|
||||
"craftimizer.simulator": {
|
||||
"type": "Project"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.62">
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.92">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.62">
|
||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.92">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
Reference in New Issue
Block a user