Update for 7.3

This commit is contained in:
Asriel Camora
2025-08-18 22:43:31 -07:00
parent fd1651cef9
commit 050fddbcd0
16 changed files with 111 additions and 109 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Dalamud.NET.Sdk/12.0.2"> <Project Sdk="Dalamud.NET.Sdk/13.0.0">
<PropertyGroup> <PropertyGroup>
<Authors>Asriel Camora</Authors> <Authors>Asriel Camora</Authors>
<Version>2.7.2.1</Version> <Version>2.7.2.2</Version>
<PackageProjectUrl>https://github.com/WorkingRobot/Craftimizer.git</PackageProjectUrl> <PackageProjectUrl>https://github.com/WorkingRobot/Craftimizer.git</PackageProjectUrl>
<Configurations>Debug;Release</Configurations> <Configurations>Debug;Release</Configurations>
</PropertyGroup> </PropertyGroup>
+5 -5
View File
@@ -1,4 +1,4 @@
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System; using System;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@@ -179,7 +179,7 @@ internal static unsafe class ImGuiExtras
igRenderFrame(p_min, p_max, fill_col, border, rounding); igRenderFrame(p_min, p_max, fill_col, border, rounding);
public static unsafe void RenderRectFilledRangeH(ImDrawListPtr draw_list, Vector4 rect, uint col, float x_start_norm, float x_end_norm, float rounding) => public static unsafe void RenderRectFilledRangeH(ImDrawListPtr draw_list, Vector4 rect, uint col, float x_start_norm, float x_end_norm, float rounding) =>
igRenderRectFilledRangeH(draw_list.NativePtr, &rect, col, x_start_norm, x_end_norm, rounding); igRenderRectFilledRangeH(draw_list, &rect, col, x_start_norm, x_end_norm, rounding);
public static unsafe bool ItemSize(Vector2 size, float text_baseline_y = -1.0f) => public static unsafe bool ItemSize(Vector2 size, float text_baseline_y = -1.0f) =>
igItemSize_Vec2(size, text_baseline_y); igItemSize_Vec2(size, text_baseline_y);
@@ -202,7 +202,7 @@ internal static unsafe class ImGuiExtras
} }
GetUtf8(text, utf8TextBytes, utf8TextByteCount); GetUtf8(text, utf8TextBytes, utf8TextByteCount);
var ret = ImGuiNative.ImFont_CalcWordWrapPositionA(font.NativePtr, scale, utf8TextBytes, utf8TextBytes + utf8TextByteCount, wrap_width); var ret = ImGuiNative.CalcWordWrapPositionA(font, scale, utf8TextBytes, utf8TextBytes + utf8TextByteCount, wrap_width);
int? retVal = null; int? retVal = null;
if (utf8TextBytes <= ret && ret <= utf8TextBytes + utf8TextByteCount) if (utf8TextBytes <= ret && ret <= utf8TextBytes + utf8TextByteCount)
@@ -218,12 +218,12 @@ internal static unsafe class ImGuiExtras
} }
public static unsafe bool SetDragDropPayload<T>(string type, T data) where T : unmanaged => public static unsafe bool SetDragDropPayload<T>(string type, T data) where T : unmanaged =>
ImGui.SetDragDropPayload(type, (nint)(&data), (uint)sizeof(T)); ImGui.SetDragDropPayload(type, MemoryMarshal.AsBytes(new ReadOnlySpan<T>(&data, 1)));
public static unsafe bool AcceptDragDropPayload<T>(string type, out T data) where T : unmanaged public static unsafe bool AcceptDragDropPayload<T>(string type, out T data) where T : unmanaged
{ {
var payload = ImGui.AcceptDragDropPayload(type); var payload = ImGui.AcceptDragDropPayload(type);
if (payload.NativePtr == null || payload.DataSize != sizeof(T)) if (payload.IsNull || payload.DataSize != sizeof(T))
{ {
data = default; data = default;
return false; return false;
+12 -9
View File
@@ -3,8 +3,8 @@ using Dalamud.Interface;
using Dalamud.Interface.ManagedFontAtlas; using Dalamud.Interface.ManagedFontAtlas;
using Dalamud.Interface.Utility; using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using ImPlotNET; using Dalamud.Bindings.ImPlot;
using MathNet.Numerics.Statistics; using MathNet.Numerics.Statistics;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -297,7 +297,8 @@ internal static class ImGuiUtils
Max = max; Max = max;
bandwidth *= Max - Min; bandwidth *= Max - Min;
var samplesList = samples.AsParallel().Select(s => (double)s).ToArray(); var samplesList = samples.AsParallel().Select(s => (double)s).ToArray();
_ = Task.Run(() => { _ = Task.Run(() =>
{
var s = Stopwatch.StartNew(); var s = Stopwatch.StartNew();
var data = ParallelEnumerable.Range(0, resolution + 1) var data = ParallelEnumerable.Range(0, resolution + 1)
.Select(n => Lerp(min, max, n / (float)resolution)) .Select(n => Lerp(min, max, n / (float)resolution))
@@ -315,14 +316,14 @@ internal static class ImGuiUtils
public static void ViolinPlot(in ViolinData data, Vector2 size) public static void ViolinPlot(in ViolinData data, Vector2 size)
{ {
using var padding = ImRaii2.PushStyle(ImPlotStyleVar.PlotPadding, Vector2.Zero); using var padding = ImRaii2.PushStyle(ImPlotStyleVar.Padding, Vector2.Zero);
using var plotBg = ImRaii2.PushColor(ImPlotCol.PlotBg, Vector4.Zero); using var plotBg = ImRaii2.PushColor(ImPlotCol.Bg, Vector4.Zero);
using var fill = ImRaii2.PushColor(ImPlotCol.Fill, Vector4.One.WithAlpha(.5f)); using var fill = ImRaii2.PushColor(ImPlotCol.Fill, Vector4.One.WithAlpha(.5f));
using var plot = ImRaii2.Plot("##violin", size, ImPlotFlags.CanvasOnly | ImPlotFlags.NoInputs | ImPlotFlags.NoChild | ImPlotFlags.NoFrame); using var plot = ImRaii2.Plot("##violin", size, ImPlotFlags.CanvasOnly | ImPlotFlags.NoInputs | ImPlotFlags.NoChild | ImPlotFlags.NoFrame);
if (plot) if (plot)
{ {
ImPlot.SetupAxes(null, null, ImPlotAxisFlags.NoDecorations, ImPlotAxisFlags.NoDecorations | ImPlotAxisFlags.AutoFit); ImPlot.SetupAxes([], [], ImPlotAxisFlags.NoDecorations, ImPlotAxisFlags.NoDecorations | ImPlotAxisFlags.AutoFit);
ImPlot.SetupAxisLimits(ImAxis.X1, data.Min, data.Max, ImPlotCond.Always); ImPlot.SetupAxisLimits(ImAxis.X1, data.Min, data.Max, ImPlotCond.Always);
ImPlot.SetupFinish(); ImPlot.SetupFinish();
@@ -333,7 +334,7 @@ internal static class ImGuiUtils
var label_id = stackalloc byte[] { (byte)'\0' }; var label_id = stackalloc byte[] { (byte)'\0' };
fixed (ViolinData.Point* p = points) fixed (ViolinData.Point* p = points)
{ {
ImPlotNative.ImPlot_PlotShaded_FloatPtrFloatPtrFloatPtr(label_id, &p->X, &p->Y, &p->Y2, points.Length, ImPlotShadedFlags.None, 0, sizeof(ViolinData.Point)); ImPlot.PlotShaded(label_id, &p->X, &p->Y, &p->Y2, points.Length, ImPlotShadedFlags.None, 0, sizeof(ViolinData.Point));
} }
} }
} }
@@ -522,7 +523,7 @@ internal static class ImGuiUtils
ImGuiListClipperPtr imGuiListClipperPtr; ImGuiListClipperPtr imGuiListClipperPtr;
unsafe unsafe
{ {
imGuiListClipperPtr = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper_ImGuiListClipper()); imGuiListClipperPtr = new ImGuiListClipperPtr(ImGuiNative.ImGuiListClipper());
} }
try try
{ {
@@ -662,7 +663,9 @@ internal static class ImGuiUtils
currentWrapWidth = wrapPosX - currentPos; currentWrapWidth = wrapPosX - currentPos;
var textBuf = text.AsSpan(); var textBuf = text.AsSpan();
var lineSize = font.CalcWordWrapPositionA(ImGuiHelpers.GlobalScale, textBuf, currentWrapWidth) ?? textBuf.Length; var lineSize = font.CalcWordWrapPositionA(ImGuiHelpers.GlobalScale, textBuf, currentWrapWidth);
if (lineSize == 0)
lineSize = textBuf.Length;
var lineBuf = textBuf[..lineSize]; var lineBuf = textBuf[..lineSize];
ImGui.TextUnformatted(lineBuf.ToString()); ImGui.TextUnformatted(lineBuf.ToString());
var remainingBuf = textBuf[lineSize..].TrimStart(); var remainingBuf = textBuf[lineSize..].TrimStart();
+2 -2
View File
@@ -1,6 +1,6 @@
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using ImPlotNET; using Dalamud.Bindings.ImPlot;
using System; using System;
using System.Numerics; using System.Numerics;
+1 -1
View File
@@ -1,6 +1,6 @@
using Craftimizer.Plugin; using Craftimizer.Plugin;
using Dalamud.Interface.Colors; using Dalamud.Interface.Colors;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System; using System;
using System.Numerics; using System.Numerics;
+1 -1
View File
@@ -1,6 +1,6 @@
using Craftimizer.Plugin; using Craftimizer.Plugin;
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
using System.Numerics; using System.Numerics;
+4 -3
View File
@@ -1,4 +1,5 @@
using Craftimizer.Plugin; using Craftimizer.Plugin;
using Dalamud.Bindings.ImGui;
using Dalamud.Interface.Textures; using Dalamud.Interface.Textures;
using Dalamud.Interface.Textures.TextureWraps; using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Utility; using Dalamud.Utility;
@@ -19,7 +20,7 @@ public interface ITextureIcon
float? AspectRatio => Dimensions is { } d ? d.X / d.Y : null; float? AspectRatio => Dimensions is { } d ? d.X / d.Y : null;
nint ImGuiHandle { get; } ImTextureID Handle { get; }
} }
public interface ILoadedTextureIcon : ITextureIcon, IDisposable { } public interface ILoadedTextureIcon : ITextureIcon, IDisposable { }
@@ -32,7 +33,7 @@ public sealed class IconManager : IDisposable
public Vector2? Dimensions => GetWrap()?.Size; public Vector2? Dimensions => GetWrap()?.Size;
public nint ImGuiHandle => GetWrapOrEmpty().ImGuiHandle; public ImTextureID Handle => GetWrapOrEmpty().Handle;
private Task<IDalamudTextureWrap> TextureWrapTask { get; } private Task<IDalamudTextureWrap> TextureWrapTask { get; }
private CancellationTokenSource DisposeToken { get; } private CancellationTokenSource DisposeToken { get; }
@@ -69,7 +70,7 @@ public sealed class IconManager : IDisposable
public Vector2? Dimensions => Base.Dimensions; public Vector2? Dimensions => Base.Dimensions;
public nint ImGuiHandle => Base.ImGuiHandle; public ImTextureID Handle => Base.Handle;
public void Release() public void Release()
{ {
+1 -1
View File
@@ -5,7 +5,7 @@ using Dalamud.Interface.ImGuiNotification;
using FFXIVClientStructs.FFXIV.Client.System.Memory; using FFXIVClientStructs.FFXIV.Client.System.Memory;
using FFXIVClientStructs.FFXIV.Client.System.String; using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Client.UI.Misc; using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
+4 -4
View File
@@ -34,10 +34,10 @@ public sealed record RecipeData
ClassJob = (ClassJob)Recipe.CraftType.RowId; ClassJob = (ClassJob)Recipe.CraftType.RowId;
var resolvedLevelTableRow = Recipe.RecipeLevelTable.RowId; var resolvedLevelTableRow = Recipe.RecipeLevelTable.RowId;
if (Recipe.Unknown0 != 0) if (Recipe.MaxAdjustableJobLevel.RowId != 0)
{ {
AdjustedJobLevel = Math.Min(explicitlyAdjustedJobLevel ?? ClassJob.GetWKSSyncedLevel(), Recipe.Unknown0); AdjustedJobLevel = Math.Min(explicitlyAdjustedJobLevel ?? ClassJob.GetWKSSyncedLevel(), (ushort)Recipe.MaxAdjustableJobLevel.RowId);
resolvedLevelTableRow = LuminaSheets.GathererCrafterLvAdjustTableSheet.GetRow(AdjustedJobLevel.Value).Unknown0; resolvedLevelTableRow = LuminaSheets.GathererCrafterLvAdjustTableSheet.GetRow(AdjustedJobLevel.Value).RecipeLevel.RowId;
} }
Table = LuminaSheets.RecipeLevelTableSheet.GetRow(resolvedLevelTableRow); Table = LuminaSheets.RecipeLevelTableSheet.GetRow(resolvedLevelTableRow);
@@ -46,7 +46,7 @@ public sealed record RecipeData
IsExpert = Recipe.IsExpert, IsExpert = Recipe.IsExpert,
ClassJobLevel = Table.ClassJobLevel, ClassJobLevel = Table.ClassJobLevel,
ConditionsFlag = Table.ConditionsFlag, ConditionsFlag = Table.ConditionsFlag,
MaxDurability = (Recipe.Unknown0 != 0 ? 80 : Table.Durability) * Recipe.DurabilityFactor / 100, MaxDurability = (Recipe.MaxAdjustableJobLevel.RowId != 0 ? 80 : Table.Durability) * Recipe.DurabilityFactor / 100,
MaxQuality = (Recipe.CanHq || Recipe.IsExpert) ? (int)Table.Quality * Recipe.QualityFactor / 100 : 0, MaxQuality = (Recipe.CanHq || Recipe.IsExpert) ? (int)Table.Quality * Recipe.QualityFactor / 100 : 0,
MaxProgress = Table.Difficulty * Recipe.DifficultyFactor / 100, MaxProgress = Table.Difficulty * Recipe.DifficultyFactor / 100,
QualityModifier = Table.QualityModifier, QualityModifier = Table.QualityModifier,
+3 -3
View File
@@ -2,7 +2,7 @@ using Craftimizer.Plugin;
using Dalamud.Interface; using Dalamud.Interface;
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing; using Dalamud.Interface.Windowing;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Numerics; using System.Numerics;
@@ -32,7 +32,7 @@ public sealed class MacroClipboard : Window, IDisposable
public override void Draw() public override void Draw()
{ {
var idx = 0; var idx = 0;
foreach(var macro in Macros) foreach (var macro in Macros)
DrawMacro(idx++, macro); DrawMacro(idx++, macro);
} }
@@ -77,7 +77,7 @@ public sealed class MacroClipboard : Window, IDisposable
using var padding = ImRaii.PushStyle(ImGuiStyleVar.FramePadding, Vector2.Zero); using var padding = ImRaii.PushStyle(ImGuiStyleVar.FramePadding, Vector2.Zero);
using var bg = ImRaii.PushColor(ImGuiCol.FrameBg, Vector4.Zero); using var bg = ImRaii.PushColor(ImGuiCol.FrameBg, Vector4.Zero);
var lineCount = macro.Count(c => c == '\n') + 1; var lineCount = macro.Count(c => c == '\n') + 1;
ImGui.InputTextMultiline("", ref macro, (uint)macro.Length + 1, new(availWidth, ImGui.GetTextLineHeight() * Math.Max(15, lineCount) + ImGui.GetStyle().FramePadding.Y), ImGuiInputTextFlags.ReadOnly | ImGuiInputTextFlags.AutoSelectAll); ImGui.InputTextMultiline("", ref macro, macro.Length + 1, new(availWidth, ImGui.GetTextLineHeight() * Math.Max(15, lineCount) + ImGui.GetStyle().FramePadding.Y), ImGuiInputTextFlags.ReadOnly | ImGuiInputTextFlags.AutoSelectAll);
} }
if (buttonHovered) if (buttonHovered)
+27 -30
View File
@@ -12,7 +12,7 @@ using Dalamud.Interface.ManagedFontAtlas;
using Dalamud.Interface.Utility; using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing; using Dalamud.Interface.Windowing;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -270,7 +270,7 @@ public sealed class MacroEditor : Window, IDisposable
uv0 /= new Vector2(56); uv0 /= new Vector2(56);
uv1 /= new Vector2(56); uv1 /= new Vector2(56);
ImGui.Image(Service.IconManager.GetIconCached(RecipeData.ClassJob.GetIconId()).ImGuiHandle, new Vector2(imageSize), uv0, uv1); ImGui.Image(Service.IconManager.GetIconCached(RecipeData.ClassJob.GetIconId()).Handle, new Vector2(imageSize), uv0, uv1);
ImGui.SameLine(0, 5); ImGui.SameLine(0, 5);
AxisFont.Text(textClassName); AxisFont.Text(textClassName);
@@ -346,7 +346,7 @@ public sealed class MacroEditor : Window, IDisposable
{ {
var v = CharacterStats.HasSplendorousBuff; var v = CharacterStats.HasSplendorousBuff;
var tint = v ? Vector4.One : disabledTint; var tint = v ? Vector4.One : disabledTint;
if (ImGui.ImageButton(SplendorousBadge.ImGuiHandle, new Vector2(imageButtonSize), default, Vector2.One, imageButtonPadding, default, tint)) if (ImGui.ImageButton(SplendorousBadge.Handle, new Vector2(imageButtonSize), default, Vector2.One, imageButtonPadding, default, tint))
CharacterStats = CharacterStats with { HasSplendorousBuff = !v }; CharacterStats = CharacterStats with { HasSplendorousBuff = !v };
} }
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
@@ -364,7 +364,7 @@ public sealed class MacroEditor : Window, IDisposable
using (var d = ImRaii.Disabled(specialistLevel > CharacterStats.Level)) using (var d = ImRaii.Disabled(specialistLevel > CharacterStats.Level))
{ {
var tint = new Vector4(0.99f, 0.97f, 0.62f, 1f) * (v ? Vector4.One : disabledTint); var tint = new Vector4(0.99f, 0.97f, 0.62f, 1f) * (v ? Vector4.One : disabledTint);
if (ImGui.ImageButton(SpecialistBadge.ImGuiHandle, new Vector2(imageButtonSize), default, Vector2.One, imageButtonPadding, default, tint)) if (ImGui.ImageButton(SpecialistBadge.Handle, new Vector2(imageButtonSize), default, Vector2.One, imageButtonPadding, default, tint))
{ {
v = !v; v = !v;
newIsSpecialist = v; newIsSpecialist = v;
@@ -380,7 +380,7 @@ public sealed class MacroEditor : Window, IDisposable
{ {
var v = CharacterStats.CanUseManipulation && manipLevel <= CharacterStats.Level; var v = CharacterStats.CanUseManipulation && manipLevel <= CharacterStats.Level;
var tint = (v || manipLevel > CharacterStats.Level) ? disabledTint : Vector4.One; var tint = (v || manipLevel > CharacterStats.Level) ? disabledTint : Vector4.One;
if (ImGui.ImageButton((v ? ManipulationBadge : NoManipulationBadge).ImGuiHandle, new Vector2(imageButtonSize), default, Vector2.One, imageButtonPadding, default, tint)) if (ImGui.ImageButton((v ? ManipulationBadge : NoManipulationBadge).Handle, new Vector2(imageButtonSize), default, Vector2.One, imageButtonPadding, default, tint))
CharacterStats = CharacterStats with { CanUseManipulation = !v }; CharacterStats = CharacterStats with { CanUseManipulation = !v };
} }
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
@@ -392,7 +392,7 @@ public sealed class MacroEditor : Window, IDisposable
var buffBadgeSize = new Vector2(imageSize * (WellFedBadge.AspectRatio ?? 1), imageSize); var buffBadgeSize = new Vector2(imageSize * (WellFedBadge.AspectRatio ?? 1), imageSize);
(uint ItemId, bool HQ)? newFoodBuff = null; (uint ItemId, bool HQ)? newFoodBuff = null;
ImGui.Image(WellFedBadge.ImGuiHandle, buffBadgeSize); ImGui.Image(WellFedBadge.Handle, buffBadgeSize);
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip("Food"); ImGuiUtils.Tooltip("Food");
ImGui.SameLine(0, 5); ImGui.SameLine(0, 5);
@@ -427,7 +427,7 @@ public sealed class MacroEditor : Window, IDisposable
} }
(uint ItemId, bool HQ)? newMedicineBuff = null; (uint ItemId, bool HQ)? newMedicineBuff = null;
ImGui.Image(MedicatedBadge.ImGuiHandle, buffBadgeSize); ImGui.Image(MedicatedBadge.Handle, buffBadgeSize);
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip("Medicine"); ImGuiUtils.Tooltip("Medicine");
ImGui.SameLine(0, 5); ImGui.SameLine(0, 5);
@@ -464,7 +464,7 @@ public sealed class MacroEditor : Window, IDisposable
ImGui.TableNextColumn(); ImGui.TableNextColumn();
int? newFCCraftsmanshipBuff = null; int? newFCCraftsmanshipBuff = null;
ImGui.Image(EatFromTheHandBadge.ImGuiHandle, buffBadgeSize); ImGui.Image(EatFromTheHandBadge.Handle, buffBadgeSize);
var fcBuffName = "Eat from the Hand"; var fcBuffName = "Eat from the Hand";
var fcStatName = "Craftsmanship"; var fcStatName = "Craftsmanship";
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
@@ -491,7 +491,7 @@ public sealed class MacroEditor : Window, IDisposable
} }
int? newFCControlBuff = null; int? newFCControlBuff = null;
ImGui.Image(InControlBadge.ImGuiHandle, buffBadgeSize); ImGui.Image(InControlBadge.Handle, buffBadgeSize);
fcBuffName = "In Control"; fcBuffName = "In Control";
fcStatName = "Control"; fcStatName = "Control";
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
@@ -763,7 +763,7 @@ public sealed class MacroEditor : Window, IDisposable
(isExpert ? badgeSize.X + 3 : 0); (isExpert ? badgeSize.X + 3 : 0);
ImGui.AlignTextToFramePadding(); ImGui.AlignTextToFramePadding();
ImGui.Image(Service.IconManager.GetIconCached(RecipeData.Recipe.ItemResult.Value.Icon).ImGuiHandle, new Vector2(imageSize)); ImGui.Image(Service.IconManager.GetIconCached(RecipeData.Recipe.ItemResult.Value.Icon).Handle, new Vector2(imageSize));
ImGui.SameLine(0, 5); ImGui.SameLine(0, 5);
@@ -801,7 +801,7 @@ public sealed class MacroEditor : Window, IDisposable
uv1 /= new Vector2(56); uv1 /= new Vector2(56);
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().FramePadding.Y / 2); ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().FramePadding.Y / 2);
ImGui.Image(Service.IconManager.GetIconCached(classJob.GetIconId()).ImGuiHandle, new Vector2(imageSize), uv0, uv1); ImGui.Image(Service.IconManager.GetIconCached(classJob.GetIconId()).Handle, new Vector2(imageSize), uv0, uv1);
ImGui.SameLine(0, 5); ImGui.SameLine(0, 5);
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + (fontHandle.FontSize - textLevelSize.Y) / 2); ImGui.SetCursorPosY(ImGui.GetCursorPosY() + (fontHandle.FontSize - textLevelSize.Y) / 2);
ImGui.TextUnformatted(textLevel); ImGui.TextUnformatted(textLevel);
@@ -821,7 +821,8 @@ public sealed class MacroEditor : Window, IDisposable
newAdjustedJobLevel = (ushort)level; newAdjustedJobLevel = (ushort)level;
} }
} }
else { else
{
ImGui.TextUnformatted(textLevel); ImGui.TextUnformatted(textLevel);
} }
@@ -837,7 +838,7 @@ public sealed class MacroEditor : Window, IDisposable
if (isAdjustable) if (isAdjustable)
{ {
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.Image(CosmicExplorationBadge.ImGuiHandle, new(imageSize)); ImGui.Image(CosmicExplorationBadge.Handle, new(imageSize));
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"Cosmic Exploration"); ImGuiUtils.Tooltip($"Cosmic Exploration");
} }
@@ -846,7 +847,7 @@ public sealed class MacroEditor : Window, IDisposable
{ {
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + badgeOffset); ImGui.SetCursorPosY(ImGui.GetCursorPosY() + badgeOffset);
ImGui.Image(CollectibleBadge.ImGuiHandle, badgeSize); ImGui.Image(CollectibleBadge.Handle, badgeSize);
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"Collectible"); ImGuiUtils.Tooltip($"Collectible");
} }
@@ -855,7 +856,7 @@ public sealed class MacroEditor : Window, IDisposable
{ {
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + badgeOffset); ImGui.SetCursorPosY(ImGui.GetCursorPosY() + badgeOffset);
ImGui.Image(ExpertBadge.ImGuiHandle, badgeSize); ImGui.Image(ExpertBadge.Handle, badgeSize);
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"Expert Recipe"); ImGuiUtils.Tooltip($"Expert Recipe");
} }
@@ -957,7 +958,7 @@ public sealed class MacroEditor : Window, IDisposable
var imageSize = ImGui.GetFrameHeight(); var imageSize = ImGui.GetFrameHeight();
using (var d = ImRaii.Disabled(!canHq)) using (var d = ImRaii.Disabled(!canHq))
ImGui.Image(icon.ImGuiHandle, new Vector2(imageSize)); ImGui.Image(icon.Handle, new Vector2(imageSize));
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled)) if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{ {
if (canHq) if (canHq)
@@ -1005,12 +1006,12 @@ public sealed class MacroEditor : Window, IDisposable
private bool DrawLevelEntry(ref int level) private bool DrawLevelEntry(ref int level)
{ {
static unsafe int LevelInputCallback(ImGuiInputTextCallbackData* data) static int LevelInputCallback(ImGuiInputTextCallbackDataPtr data)
{ {
if (data->EventFlag == ImGuiInputTextFlags.CallbackCharFilter) if (data.EventFlag == ImGuiInputTextFlags.CallbackCharFilter)
{ {
if (SqText.LevelNumReplacements.TryGetValue((char)data->EventChar, out var seChar)) if (SqText.LevelNumReplacements.TryGetValue((char)data.EventChar, out var seChar))
data->EventChar = seChar.ToIconChar(); data.EventChar = seChar.ToIconChar();
else else
return 1; return 1;
} }
@@ -1025,11 +1026,7 @@ public sealed class MacroEditor : Window, IDisposable
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.SetNextItemWidth(levelTextWidth); ImGui.SetNextItemWidth(levelTextWidth);
var levelText = SqText.ToLevelString(level); var levelText = SqText.ToLevelString(level);
bool textChanged; var textChanged = ImGui.InputText("##levelText", ref levelText, 12, ImGuiInputTextFlags.CallbackCharFilter | ImGuiInputTextFlags.AutoSelectAll, LevelInputCallback);
unsafe
{
textChanged = ImGui.InputText("##levelText", ref levelText, 12, ImGuiInputTextFlags.CallbackCharFilter | ImGuiInputTextFlags.AutoSelectAll, LevelInputCallback);
}
if (textChanged) if (textChanged)
{ {
var newLevel = SqText.TryParseLevelString(levelText, out var lv) var newLevel = SqText.TryParseLevelString(levelText, out var lv)
@@ -1073,7 +1070,7 @@ public sealed class MacroEditor : Window, IDisposable
{ {
var actionBase = actions[i].Base(); var actionBase = actions[i].Base();
var canUse = actionBase.CanUse(sim); var canUse = actionBase.CanUse(sim);
if (ImGui.ImageButton(actions[i].GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize), default, Vector2.One, 0, default, !canUse ? new(1, 1, 1, ImGui.GetStyle().DisabledAlpha) : Vector4.One) && !SolverRunning) if (ImGui.ImageButton(actions[i].GetIcon(RecipeData!.ClassJob).Handle, new(imageSize), default, Vector2.One, 0, default, !canUse ? new(1, 1, 1, ImGui.GetStyle().DisabledAlpha) : Vector4.One) && !SolverRunning)
AddStep(actions[i]); AddStep(actions[i]);
if (!canUse && if (!canUse &&
(CharacterStats.Level < actionBase.Level || (CharacterStats.Level < actionBase.Level ||
@@ -1097,7 +1094,7 @@ public sealed class MacroEditor : Window, IDisposable
if (_source) if (_source)
{ {
ImGuiExtras.SetDragDropPayload("macroActionInsert", actions[i]); ImGuiExtras.SetDragDropPayload("macroActionInsert", actions[i]);
ImGui.ImageButton(actions[i].GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize)); ImGui.ImageButton(actions[i].GetIcon(RecipeData!.ClassJob).Handle, new(imageSize));
} }
} }
} }
@@ -1228,7 +1225,7 @@ public sealed class MacroEditor : Window, IDisposable
var icon = effect.GetIcon(effects.GetStrength(effect)); var icon = effect.GetIcon(effects.GetStrength(effect));
var size = new Vector2(buffIconHeight * (icon.AspectRatio ?? 1), buffIconHeight); var size = new Vector2(buffIconHeight * (icon.AspectRatio ?? 1), buffIconHeight);
ImGui.Image(icon.ImGuiHandle, size); ImGui.Image(icon.Handle, size);
if (!effect.IsIndefinite()) if (!effect.IsIndefinite())
{ {
ImGui.SetCursorPosY(ImGui.GetCursorPosY() - buffDurationShift); ImGui.SetCursorPosY(ImGui.GetCursorPosY() - buffDurationShift);
@@ -1302,7 +1299,7 @@ public sealed class MacroEditor : Window, IDisposable
var actionBase = action.Base(); var actionBase = action.Base();
var failedAction = response != ActionResponse.UsedAction; var failedAction = response != ActionResponse.UsedAction;
using var id = ImRaii.PushId(i); using var id = ImRaii.PushId(i);
if (ImGui.ImageButton(action.GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize), default, Vector2.One, 0, default, failedAction ? new(1, 1, 1, ImGui.GetStyle().DisabledAlpha) : Vector4.One) && !SolverRunning) if (ImGui.ImageButton(action.GetIcon(RecipeData!.ClassJob).Handle, new(imageSize), default, Vector2.One, 0, default, failedAction ? new(1, 1, 1, ImGui.GetStyle().DisabledAlpha) : Vector4.One) && !SolverRunning)
RemoveStep(i); RemoveStep(i);
if (response is ActionResponse.ActionNotUnlocked || if (response is ActionResponse.ActionNotUnlocked ||
( (
@@ -1331,7 +1328,7 @@ public sealed class MacroEditor : Window, IDisposable
if (_source) if (_source)
{ {
ImGuiExtras.SetDragDropPayload("macroAction", i); ImGuiExtras.SetDragDropPayload("macroAction", i);
ImGui.ImageButton(action.GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize)); ImGui.ImageButton(action.GetIcon(RecipeData!.ClassJob).Handle, new(imageSize));
} }
} }
using (var _target = ImRaii.DragDropTarget()) using (var _target = ImRaii.DragDropTarget())
+4 -4
View File
@@ -3,7 +3,7 @@ using Craftimizer.Utils;
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface; using Dalamud.Interface;
using Dalamud.Interface.Windowing; using Dalamud.Interface.Windowing;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System; using System;
using Craftimizer.Simulator; using Craftimizer.Simulator;
using Craftimizer.Simulator.Actions; using Craftimizer.Simulator.Actions;
@@ -82,7 +82,7 @@ public sealed class MacroList : Window, IDisposable
{ {
var width = ImGui.GetContentRegionAvail().X; var width = ImGui.GetContentRegionAvail().X;
var macros = new List<Macro>(sortedMacros); var macros = new List<Macro>(sortedMacros);
for(var i = 0; i < macros.Count; ++i) for (var i = 0; i < macros.Count; ++i)
{ {
var pos = ImGui.GetCursorPos(); var pos = ImGui.GetCursorPos();
DrawMacro(macros[i]); DrawMacro(macros[i]);
@@ -281,7 +281,7 @@ public sealed class MacroList : Window, IDisposable
var shouldShowMore = i + 1 == itemsPerRow * 2 && i + 1 < itemCount; var shouldShowMore = i + 1 == itemsPerRow * 2 && i + 1 < itemCount;
if (!shouldShowMore) if (!shouldShowMore)
{ {
ImGui.Image(macro.Actions[i].GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(miniRowHeight)); ImGui.Image(macro.Actions[i].GetIcon(RecipeData!.ClassJob).Handle, new(miniRowHeight));
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip(macro.Actions[i].GetName(RecipeData!.ClassJob)); ImGuiUtils.Tooltip(macro.Actions[i].GetName(RecipeData!.ClassJob));
} }
@@ -289,7 +289,7 @@ public sealed class MacroList : Window, IDisposable
{ {
var amtMore = itemCount - itemsPerRow * 2; var amtMore = itemCount - itemsPerRow * 2;
var pos = ImGui.GetCursorPos(); var pos = ImGui.GetCursorPos();
ImGui.Image(macro.Actions[i].GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(miniRowHeight), default, Vector2.One, new(1, 1, 1, .5f)); ImGui.Image(macro.Actions[i].GetIcon(RecipeData!.ClassJob).Handle, new(miniRowHeight), default, Vector2.One, new(1, 1, 1, .5f));
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"{macro.Actions[i].GetName(RecipeData!.ClassJob)}\nand {amtMore} more"); ImGuiUtils.Tooltip($"{macro.Actions[i].GetName(RecipeData!.ClassJob)}\nand {amtMore} more");
ImGui.SetCursorPos(pos); ImGui.SetCursorPos(pos);
+19 -18
View File
@@ -20,7 +20,7 @@ using FFXIVClientStructs.FFXIV.Client.Game.UI;
using FFXIVClientStructs.FFXIV.Client.System.String; using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Client.UI.Misc; using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
@@ -194,7 +194,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
bool ShouldUseRecipeNote() bool ShouldUseRecipeNote()
{ {
Addon = (AtkUnitBase*)Service.GameGui.GetAddonByName("RecipeNote"); Addon = (AtkUnitBase*)Service.GameGui.GetAddonByName("RecipeNote").Address;
if (Addon == null) if (Addon == null)
return false; return false;
@@ -211,7 +211,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
bool ShouldUseWKSRecipeNote() bool ShouldUseWKSRecipeNote()
{ {
Addon = (AtkUnitBase*)Service.GameGui.GetAddonByName("WKSRecipeNotebook"); Addon = (AtkUnitBase*)Service.GameGui.GetAddonByName("WKSRecipeNotebook").Address;
if (Addon == null) if (Addon == null)
return false; return false;
@@ -533,7 +533,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
uv0 /= new Vector2(56); uv0 /= new Vector2(56);
uv1 /= new Vector2(56); uv1 /= new Vector2(56);
ImGui.Image(Service.IconManager.GetIconCached(RecipeData.ClassJob.GetIconId()).ImGuiHandle, new Vector2(imageSize), uv0, uv1); ImGui.Image(Service.IconManager.GetIconCached(RecipeData.ClassJob.GetIconId()).Handle, new Vector2(imageSize), uv0, uv1);
ImGui.SameLine(0, 5); ImGui.SameLine(0, 5);
if (level != 0) if (level != 0)
@@ -547,7 +547,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
if (hasSplendorous) if (hasSplendorous)
{ {
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.Image(SplendorousBadge.ImGuiHandle, new Vector2(imageSize)); ImGui.Image(SplendorousBadge.Handle, new Vector2(imageSize));
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"Splendorous Tool"); ImGuiUtils.Tooltip($"Splendorous Tool");
} }
@@ -555,7 +555,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
if (hasSpecialist) if (hasSpecialist)
{ {
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.Image(SpecialistBadge.ImGuiHandle, new Vector2(imageSize), Vector2.Zero, Vector2.One, new(0.99f, 0.97f, 0.62f, 1f)); ImGui.Image(SpecialistBadge.Handle, new Vector2(imageSize), Vector2.Zero, Vector2.One, new(0.99f, 0.97f, 0.62f, 1f));
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"Specialist"); ImGuiUtils.Tooltip($"Specialist");
} }
@@ -563,7 +563,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
if (shouldHaveManip) if (shouldHaveManip)
{ {
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.Image(NoManipulationBadge.ImGuiHandle, new Vector2(imageSize)); ImGui.Image(NoManipulationBadge.Handle, new Vector2(imageSize));
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"No Manipulation (Missing Job Quest)"); ImGuiUtils.Tooltip($"No Manipulation (Missing Job Quest)");
} }
@@ -637,7 +637,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
ImGuiUtils.TextCentered($"You are missing the required equipment."); ImGuiUtils.TextCentered($"You are missing the required equipment.");
ImGuiUtils.AlignCentered(imageSize + 5 + ImGui.CalcTextSize(itemName).X); ImGuiUtils.AlignCentered(imageSize + 5 + ImGui.CalcTextSize(itemName).X);
ImGui.AlignTextToFramePadding(); ImGui.AlignTextToFramePadding();
ImGui.Image(Service.IconManager.GetIconCached(item.Icon).ImGuiHandle, new(imageSize)); ImGui.Image(Service.IconManager.GetIconCached(item.Icon).Handle, new(imageSize));
ImGui.SameLine(0, 5); ImGui.SameLine(0, 5);
ImGui.TextUnformatted(itemName); ImGui.TextUnformatted(itemName);
} }
@@ -652,7 +652,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
ImGuiUtils.TextCentered($"You are missing the required status effect."); ImGuiUtils.TextCentered($"You are missing the required status effect.");
ImGuiUtils.AlignCentered(imageSize.X + 5 + ImGui.CalcTextSize(statusName).X); ImGuiUtils.AlignCentered(imageSize.X + 5 + ImGui.CalcTextSize(statusName).X);
ImGui.AlignTextToFramePadding(); ImGui.AlignTextToFramePadding();
ImGui.Image(statusIcon.ImGuiHandle, imageSize); ImGui.Image(statusIcon.Handle, imageSize);
ImGui.SameLine(0, 5); ImGui.SameLine(0, 5);
ImGui.TextUnformatted(statusName); ImGui.TextUnformatted(statusName);
} }
@@ -709,7 +709,8 @@ public sealed unsafe class RecipeNote : Window, IDisposable
{ {
var textStars = new string('★', RecipeData!.Table.Stars); var textStars = new string('★', RecipeData!.Table.Stars);
var textStarsSize = Vector2.Zero; var textStarsSize = Vector2.Zero;
if (!string.IsNullOrEmpty(textStars)) { if (!string.IsNullOrEmpty(textStars))
{
textStarsSize = AxisFont.CalcTextSize(textStars); textStarsSize = AxisFont.CalcTextSize(textStars);
} }
var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(RecipeData.AdjustedJobLevel ?? RecipeData.RecipeInfo.ClassJobLevel); var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(RecipeData.AdjustedJobLevel ?? RecipeData.RecipeInfo.ClassJobLevel);
@@ -731,7 +732,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
); );
ImGui.AlignTextToFramePadding(); ImGui.AlignTextToFramePadding();
ImGui.Image(Service.IconManager.GetIconCached(RecipeData.Recipe.ItemResult.Value!.Icon).ImGuiHandle, new Vector2(imageSize)); ImGui.Image(Service.IconManager.GetIconCached(RecipeData.Recipe.ItemResult.Value!.Icon).Handle, new Vector2(imageSize));
ImGui.SameLine(0, 5); ImGui.SameLine(0, 5);
ImGui.TextUnformatted(textLevel); ImGui.TextUnformatted(textLevel);
@@ -748,7 +749,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
if (isAdjustable) if (isAdjustable)
{ {
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.Image(CosmicExplorationBadge.ImGuiHandle, new(imageSize)); ImGui.Image(CosmicExplorationBadge.Handle, new(imageSize));
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"Cosmic Exploration"); ImGuiUtils.Tooltip($"Cosmic Exploration");
} }
@@ -757,7 +758,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
{ {
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + badgeOffset); ImGui.SetCursorPosY(ImGui.GetCursorPosY() + badgeOffset);
ImGui.Image(CollectibleBadge.ImGuiHandle, badgeSize); ImGui.Image(CollectibleBadge.Handle, badgeSize);
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"Collectible"); ImGuiUtils.Tooltip($"Collectible");
} }
@@ -766,7 +767,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
{ {
ImGui.SameLine(0, 3); ImGui.SameLine(0, 3);
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + badgeOffset); ImGui.SetCursorPosY(ImGui.GetCursorPosY() + badgeOffset);
ImGui.Image(ExpertBadge.ImGuiHandle, badgeSize); ImGui.Image(ExpertBadge.Handle, badgeSize);
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"Expert Recipe"); ImGuiUtils.Tooltip($"Expert Recipe");
} }
@@ -1071,7 +1072,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
var shouldShowMore = i + 1 == itemsPerRow * 2 && i + 1 < itemCount; var shouldShowMore = i + 1 == itemsPerRow * 2 && i + 1 < itemCount;
if (!shouldShowMore) if (!shouldShowMore)
{ {
ImGui.Image(actions[i].GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(miniRowHeight)); ImGui.Image(actions[i].GetIcon(RecipeData!.ClassJob).Handle, new(miniRowHeight));
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip(actions[i].GetName(RecipeData!.ClassJob)); ImGuiUtils.Tooltip(actions[i].GetName(RecipeData!.ClassJob));
} }
@@ -1079,7 +1080,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
{ {
var amtMore = itemCount - itemsPerRow * 2; var amtMore = itemCount - itemsPerRow * 2;
var pos = ImGui.GetCursorPos(); var pos = ImGui.GetCursorPos();
ImGui.Image(actions[i].GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(miniRowHeight), default, Vector2.One, new(1, 1, 1, .5f)); ImGui.Image(actions[i].GetIcon(RecipeData!.ClassJob).Handle, new(miniRowHeight), default, Vector2.One, new(1, 1, 1, .5f));
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.Tooltip($"{actions[i].GetName(RecipeData!.ClassJob)}\nand {amtMore} more"); ImGuiUtils.Tooltip($"{actions[i].GetName(RecipeData!.ClassJob)}\nand {amtMore} more");
ImGui.SetCursorPos(pos); ImGui.SetCursorPos(pos);
@@ -1108,12 +1109,12 @@ public sealed unsafe class RecipeNote : Window, IDisposable
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGui.TextUnformatted("Current"); ImGui.TextUnformatted("Current");
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGui.TextColored(new(0, 1, 0, 1), $"{current}"); ImGui.TextColored(new Vector4(0, 1, 0, 1), $"{current}");
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGui.TextUnformatted("Required"); ImGui.TextUnformatted("Required");
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGui.TextColored(new(1, 0, 0, 1), $"{required}"); ImGui.TextColored(new Vector4(1, 0, 0, 1), $"{required}");
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGui.TextUnformatted("You need"); ImGui.TextUnformatted("You need");
+4 -4
View File
@@ -8,7 +8,7 @@ using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing; using Dalamud.Interface.Windowing;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -834,7 +834,7 @@ public sealed class Settings : Window, IDisposable
iconTint = new(1, 1f, .5f, 1); iconTint = new(1, 1f, .5f, 1);
else if (isRisky) else if (isRisky)
iconTint = new(1, .5f, .5f, 1); iconTint = new(1, .5f, .5f, 1);
if (ImGui.ImageButton(actions[i].GetIcon(recipeData.ClassJob).ImGuiHandle, new(imageSize), default, Vector2.One, 0, default, iconTint)) if (ImGui.ImageButton(actions[i].GetIcon(recipeData.ClassJob).Handle, new(imageSize), default, Vector2.One, 0, default, iconTint))
{ {
isDirty = true; isDirty = true;
if (isEnabled) if (isEnabled)
@@ -893,7 +893,7 @@ public sealed class Settings : Window, IDisposable
return true; return true;
} }
foreach(var combo in ActionCategory.Combo.GetActions()) foreach (var combo in ActionCategory.Combo.GetActions())
{ {
if (combo.Base() is BaseComboAction { } comboAction) if (combo.Base() is BaseComboAction { } comboAction)
{ {
@@ -1104,7 +1104,7 @@ public sealed class Settings : Window, IDisposable
ImGui.TableSetupColumn("", ImGuiTableColumnFlags.WidthFixed, iconDim.X); ImGui.TableSetupColumn("", ImGuiTableColumnFlags.WidthFixed, iconDim.X);
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGui.Image(icon.ImGuiHandle, iconDim); ImGui.Image(icon.Handle, iconDim);
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGuiUtils.AlignMiddle(new(float.PositiveInfinity, HeaderFont.GetFontSize() + SubheaderFont.GetFontSize() + ImGui.GetFontSize() * 3 + ImGui.GetStyle().ItemSpacing.Y * 4), new(0, iconDim.Y)); ImGuiUtils.AlignMiddle(new(float.PositiveInfinity, HeaderFont.GetFontSize() + SubheaderFont.GetFontSize() + ImGui.GetFontSize() * 3 + ImGui.GetStyle().ItemSpacing.Y * 4), new(0, iconDim.Y));
+8 -8
View File
@@ -15,7 +15,7 @@ using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.Character; using FFXIVClientStructs.FFXIV.Client.Game.Character;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Shell; using FFXIVClientStructs.FFXIV.Client.UI.Shell;
using ImGuiNET; using Dalamud.Bindings.ImGui;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -168,7 +168,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
return false; return false;
} }
Addon = (AddonSynthesis*)Service.GameGui.GetAddonByName("Synthesis"); Addon = (AddonSynthesis*)Service.GameGui.GetAddonByName("Synthesis").Address;
if (Addon == null) if (Addon == null)
{ {
@@ -210,7 +210,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
Macro.FlushQueue(); Macro.FlushQueue();
var isInCraftAction = Service.Condition[ConditionFlag.Crafting40]; var isInCraftAction = Service.Condition[ConditionFlag.ExecutingCraftingAction];
if (!isInCraftAction && wasInCraftAction) if (!isInCraftAction && wasInCraftAction)
RefreshCurrentState(); RefreshCurrentState();
wasInCraftAction = isInCraftAction; wasInCraftAction = isInCraftAction;
@@ -289,7 +289,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
{ {
var spacing = ImGui.GetStyle().ItemSpacing.X; var spacing = ImGui.GetStyle().ItemSpacing.X;
var imageSize = ImGui.GetFrameHeight() * 2; var imageSize = ImGui.GetFrameHeight() * 2;
var canExecute = !Service.Condition[ConditionFlag.Crafting40]; var canExecute = !Service.Condition[ConditionFlag.ExecutingCraftingAction];
var lastState = Macro.InitialState; var lastState = Macro.InitialState;
hoveredState = null; hoveredState = null;
@@ -331,7 +331,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
isPressed = ImGuiExtras.ButtonBehavior(bb, id, out isHovered, out isHeld, ImGuiButtonFlags.None); isPressed = ImGuiExtras.ButtonBehavior(bb, id, out isHovered, out isHeld, ImGuiButtonFlags.None);
} }
ImGui.ImageButton(action.GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize), default, Vector2.One, 0, default, failedAction ? new(1, 1, 1, ImGui.GetStyle().DisabledAlpha) : Vector4.One); ImGui.ImageButton(action.GetIcon(RecipeData!.ClassJob).Handle, new(imageSize), default, Vector2.One, 0, default, failedAction ? new(1, 1, 1, ImGui.GetStyle().DisabledAlpha) : Vector4.One);
if (isPressed && i == 0) if (isPressed && i == 0)
{ {
if (ExecuteNextAction()) if (ExecuteNextAction())
@@ -380,7 +380,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
var icon = effect.GetIcon(effects.GetStrength(effect)); var icon = effect.GetIcon(effects.GetStrength(effect));
var size = new Vector2(iconHeight * (icon.AspectRatio ?? 1), iconHeight); var size = new Vector2(iconHeight * (icon.AspectRatio ?? 1), iconHeight);
ImGui.Image(icon.ImGuiHandle, size); ImGui.Image(icon.Handle, size);
if (!effect.IsIndefinite()) if (!effect.IsIndefinite())
{ {
ImGui.SetCursorPosY(ImGui.GetCursorPosY() - durationShift); ImGui.SetCursorPosY(ImGui.GetCursorPosY() - durationShift);
@@ -476,7 +476,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
public bool ExecuteNextAction() public bool ExecuteNextAction()
{ {
var canExecute = !Service.Condition[ConditionFlag.Crafting40]; var canExecute = !Service.Condition[ConditionFlag.ExecutingCraftingAction];
var action = NextAction; var action = NextAction;
if (canExecute && action != null) if (canExecute && action != null)
{ {
@@ -528,7 +528,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
private void OnUseAction(ActionType action) private void OnUseAction(ActionType action)
{ {
Addon = (AddonSynthesis*)Service.GameGui.GetAddonByName("Synthesis"); Addon = (AddonSynthesis*)Service.GameGui.GetAddonByName("Synthesis").Address;
if (Addon == null) if (Addon == null)
return; return;
if (Addon->AtkUnitBase.WindowNode == null) if (Addon->AtkUnitBase.WindowNode == null)
+3 -3
View File
@@ -4,9 +4,9 @@
"net9.0-windows7.0": { "net9.0-windows7.0": {
"DalamudPackager": { "DalamudPackager": {
"type": "Direct", "type": "Direct",
"requested": "[12.0.0, )", "requested": "[13.0.0, )",
"resolved": "12.0.0", "resolved": "13.0.0",
"contentHash": "J5TJLV3f16T/E2H2P17ClWjtfEBPpq3yxvqW46eN36JCm6wR+EaoaYkqG9Rm5sHqs3/nK/vKjWWyvEs/jhKoXw==" "contentHash": "Mb3cUDSK/vDPQ8gQIeuCw03EMYrej1B4J44a1AvIJ9C759p9XeqdU9Hg4WgOmlnlPe0G7ILTD32PKSUpkQNa8w=="
}, },
"DotNet.ReproducibleBuilds": { "DotNet.ReproducibleBuilds": {
"type": "Direct", "type": "Direct",