Merge branch 'feature/dalamud-sdk-15-bump'
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project Sdk="Dalamud.NET.Sdk/14.0.1">
|
<Project Sdk="Dalamud.NET.Sdk/15.0.0">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Authors>Asriel Camora</Authors>
|
<Authors>Asriel Camora</Authors>
|
||||||
<Version>2.9.1.1</Version>
|
<Version>2.9.1.1</Version>
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ internal static class ImGuiUtils
|
|||||||
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.Success)
|
||||||
{
|
{
|
||||||
ImPlot.SetupAxes([], [], 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);
|
||||||
|
|||||||
+13
-8
@@ -6,9 +6,14 @@ using System.Numerics;
|
|||||||
|
|
||||||
namespace Craftimizer.Plugin;
|
namespace Craftimizer.Plugin;
|
||||||
|
|
||||||
|
public interface IEndObject : IDisposable
|
||||||
|
{
|
||||||
|
bool Success { get; }
|
||||||
|
}
|
||||||
|
|
||||||
public static class ImRaii2
|
public static class ImRaii2
|
||||||
{
|
{
|
||||||
private struct EndUnconditionally(Action endAction, bool success) : ImRaii.IEndObject, IDisposable
|
private struct EndUnconditionally(Action endAction, bool success) : IEndObject
|
||||||
{
|
{
|
||||||
private Action EndAction { get; } = endAction;
|
private Action EndAction { get; } = endAction;
|
||||||
|
|
||||||
@@ -26,7 +31,7 @@ public static class ImRaii2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct EndConditionally(Action endAction, bool success) : ImRaii.IEndObject, IDisposable
|
private struct EndConditionally(Action endAction, bool success) : IEndObject
|
||||||
{
|
{
|
||||||
public bool Success { get; } = success;
|
public bool Success { get; } = success;
|
||||||
|
|
||||||
@@ -48,36 +53,36 @@ public static class ImRaii2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImRaii.IEndObject GroupPanel(string name, float width, out float internalWidth)
|
public static IEndObject GroupPanel(string name, float width, out float internalWidth)
|
||||||
{
|
{
|
||||||
internalWidth = ImGuiUtils.BeginGroupPanel(name, width);
|
internalWidth = ImGuiUtils.BeginGroupPanel(name, width);
|
||||||
return new EndUnconditionally(ImGuiUtils.EndGroupPanel, true);
|
return new EndUnconditionally(ImGuiUtils.EndGroupPanel, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImRaii.IEndObject Plot(string title_id, Vector2 size, ImPlotFlags flags)
|
public static IEndObject Plot(string title_id, Vector2 size, ImPlotFlags flags)
|
||||||
{
|
{
|
||||||
return new EndConditionally(new Action(ImPlot.EndPlot), ImPlot.BeginPlot(title_id, size, flags));
|
return new EndConditionally(new Action(ImPlot.EndPlot), ImPlot.BeginPlot(title_id, size, flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImRaii.IEndObject PushStyle(ImPlotStyleVar idx, Vector2 val)
|
public static IEndObject PushStyle(ImPlotStyleVar idx, Vector2 val)
|
||||||
{
|
{
|
||||||
ImPlot.PushStyleVar(idx, val);
|
ImPlot.PushStyleVar(idx, val);
|
||||||
return new EndUnconditionally(ImPlot.PopStyleVar, true);
|
return new EndUnconditionally(ImPlot.PopStyleVar, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImRaii.IEndObject PushStyle(ImPlotStyleVar idx, float val)
|
public static IEndObject PushStyle(ImPlotStyleVar idx, float val)
|
||||||
{
|
{
|
||||||
ImPlot.PushStyleVar(idx, val);
|
ImPlot.PushStyleVar(idx, val);
|
||||||
return new EndUnconditionally(ImPlot.PopStyleVar, true);
|
return new EndUnconditionally(ImPlot.PopStyleVar, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImRaii.IEndObject PushColor(ImPlotCol idx, Vector4 col)
|
public static IEndObject PushColor(ImPlotCol idx, Vector4 col)
|
||||||
{
|
{
|
||||||
ImPlot.PushStyleColor(idx, col);
|
ImPlot.PushStyleColor(idx, col);
|
||||||
return new EndUnconditionally(ImPlot.PopStyleColor, true);
|
return new EndUnconditionally(ImPlot.PopStyleColor, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImRaii.IEndObject TextWrapPos(float wrap_local_pos_x)
|
public static IEndObject TextWrapPos(float wrap_local_pos_x)
|
||||||
{
|
{
|
||||||
ImGui.PushTextWrapPos(wrap_local_pos_x);
|
ImGui.PushTextWrapPos(wrap_local_pos_x);
|
||||||
return new EndUnconditionally(ImGui.PopTextWrapPos, true);
|
return new EndUnconditionally(ImGui.PopTextWrapPos, true);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ internal static class DynamicBars
|
|||||||
defaultSize);
|
defaultSize);
|
||||||
});
|
});
|
||||||
|
|
||||||
private static ImRaii.Color? PushCollectableColor(this in BarData bar, float collectability, bool colorUnmetThreshold = true)
|
private static ImRaii.ColorDisposable? PushCollectableColor(this in BarData bar, float collectability, bool colorUnmetThreshold = true)
|
||||||
{
|
{
|
||||||
if (bar.Collectability is not { } collectabilities)
|
if (bar.Collectability is not { } collectabilities)
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Dalamud.Memory;
|
|||||||
using FFXIVClientStructs.FFXIV.Client.UI;
|
using FFXIVClientStructs.FFXIV.Client.UI;
|
||||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||||
using System;
|
using System;
|
||||||
using ValueType = FFXIVClientStructs.FFXIV.Component.GUI.ValueType;
|
using ValueType = FFXIVClientStructs.FFXIV.Component.GUI.AtkValueType;
|
||||||
|
|
||||||
namespace Craftimizer.Utils;
|
namespace Craftimizer.Utils;
|
||||||
|
|
||||||
|
|||||||
@@ -810,7 +810,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
|||||||
};
|
};
|
||||||
|
|
||||||
using var panel = ImRaii2.GroupPanel(panelTitle, panelWidth, out _);
|
using var panel = ImRaii2.GroupPanel(panelTitle, panelWidth, out _);
|
||||||
if (!panel)
|
if (!panel.Success)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var stepsAvailWidthOffset = ImGui.GetContentRegionAvail().X - panelWidth;
|
var stepsAvailWidthOffset = ImGui.GetContentRegionAvail().X - panelWidth;
|
||||||
|
|||||||
@@ -50,14 +50,13 @@ public sealed class Settings : Window, IDisposable
|
|||||||
SelectedTab = label;
|
SelectedTab = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ImRaii.IEndObject TabItem(string label)
|
private ImRaii.TabItemDisposable TabItem(string label)
|
||||||
{
|
{
|
||||||
var isSelected = string.Equals(SelectedTab, label, StringComparison.Ordinal);
|
var isSelected = string.Equals(SelectedTab, label, StringComparison.Ordinal);
|
||||||
if (isSelected)
|
if (isSelected)
|
||||||
{
|
{
|
||||||
SelectedTab = null;
|
SelectedTab = null;
|
||||||
var open = true;
|
return ImRaii.TabItem(label, ImGuiTabItemFlags.SetSelected);
|
||||||
return ImRaii.TabItem(label, ref open, ImGuiTabItemFlags.SetSelected);
|
|
||||||
}
|
}
|
||||||
return ImRaii.TabItem(label);
|
return ImRaii.TabItem(label);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
"net10.0-windows7.0": {
|
"net10.0-windows7.0": {
|
||||||
"DalamudPackager": {
|
"DalamudPackager": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[14.0.1, )",
|
"requested": "[15.0.0, )",
|
||||||
"resolved": "14.0.1",
|
"resolved": "15.0.0",
|
||||||
"contentHash": "y0WWyUE6dhpGdolK3iKgwys05/nZaVf4ZPtIjpLhJBZvHxkkiE23zYRo7K7uqAgoK/QvK5cqF6l3VG5AbgC6KA=="
|
"contentHash": "411vwC8/X8Z/sQ2TI6v3SvOn66xFPeOjFn3Zn+h0d3Ox2t1kFm66AhDvmx/qcMwVrR+Hidxj0dadpQ2dgyXMBQ=="
|
||||||
},
|
},
|
||||||
"DotNet.ReproducibleBuilds": {
|
"DotNet.ReproducibleBuilds": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
|
|||||||
Reference in New Issue
Block a user