Remaining API13 updates.

This commit is contained in:
Ottermandias 2025-08-08 15:39:05 +02:00
parent 00d550f4fe
commit ac6a726f57
16 changed files with 36 additions and 31 deletions

View file

@ -29,7 +29,6 @@
<ProjectReference Include="..\Penumbra.String\Penumbra.String.csproj" /> <ProjectReference Include="..\Penumbra.String\Penumbra.String.csproj" />
<ProjectReference Include="..\Penumbra.GameData\Penumbra.GameData.csproj" /> <ProjectReference Include="..\Penumbra.GameData\Penumbra.GameData.csproj" />
<PackageReference Include="Vortice.Direct3D11" Version="3.4.2-beta" /> <PackageReference Include="Vortice.Direct3D11" Version="3.4.2-beta" />
<PackageReference Update="DalamudPackager" Version="13.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -8,7 +8,7 @@
"AssemblyVersion": "9.0.0.1", "AssemblyVersion": "9.0.0.1",
"RepoUrl": "https://github.com/Ottermandias/Glamourer", "RepoUrl": "https://github.com/Ottermandias/Glamourer",
"ApplicableVersion": "any", "ApplicableVersion": "any",
"DalamudApiLevel": 12, "DalamudApiLevel": 13,
"ImageUrls": null, "ImageUrls": null,
"IconUrl": "https://raw.githubusercontent.com/Ottermandias/Glamourer/master/images/icon.png" "IconUrl": "https://raw.githubusercontent.com/Ottermandias/Glamourer/master/images/icon.png"
} }

View file

@ -287,13 +287,13 @@ public class CustomizeParameterDrawer(Configuration config, PaletteImport import
} }
private ImGuiColorEditFlags GetFlags() private ImGuiColorEditFlags GetFlags()
=> Format | Display | ImGuiColorEditFlags.HDR | ImGuiColorEditFlags.NoOptions; => Format | Display | ImGuiColorEditFlags.Hdr | ImGuiColorEditFlags.NoOptions;
private ImGuiColorEditFlags Format private ImGuiColorEditFlags Format
=> config.UseFloatForColors ? ImGuiColorEditFlags.Float : ImGuiColorEditFlags.Uint8; => config.UseFloatForColors ? ImGuiColorEditFlags.Float : ImGuiColorEditFlags.Uint8;
private ImGuiColorEditFlags Display private ImGuiColorEditFlags Display
=> config.UseRgbForColors ? ImGuiColorEditFlags.DisplayRGB : ImGuiColorEditFlags.DisplayHSV; => config.UseRgbForColors ? ImGuiColorEditFlags.DisplayRgb : ImGuiColorEditFlags.DisplayHsv;
private ImRaii.IEndObject EnsureSize() private ImRaii.IEndObject EnsureSize()
{ {

View file

@ -194,7 +194,7 @@ public abstract class DesignComboBase : FilterComboCache<Tuple<IDesignStandIn, s
ImGui.TextUnformatted("Currently resolving to "); ImGui.TextUnformatted("Currently resolving to ");
using var color = ImRaii.PushColor(ImGuiCol.Text, DesignColors.GetColor(linkedDesign)); using var color = ImRaii.PushColor(ImGuiCol.Text, DesignColors.GetColor(linkedDesign));
ImGui.SameLine(0, 0); ImGui.SameLine(0, 0);
ImGui.TextUnformatted(linkedDesign.Name); ImGui.TextUnformatted(linkedDesign.Name.Text);
} }
else else
{ {

View file

@ -529,11 +529,11 @@ public class EquipmentDrawer
public unsafe void DrawDragDropTooltip() public unsafe void DrawDragDropTooltip()
{ {
var payload = ImGui.GetDragDropPayload().NativePtr; var payload = ImGui.GetDragDropPayload().Handle;
if (payload is null) if (payload is null)
return; return;
if (!MemoryMarshal.CreateReadOnlySpanFromNullTerminated(payload->DataType).SequenceEqual("equipDragDrop"u8)) if (!MemoryMarshal.CreateReadOnlySpanFromNullTerminated((byte*)Unsafe.AsPointer(ref payload->DataType_0)).SequenceEqual("equipDragDrop"u8))
return; return;
using var tt = ImUtf8.Tooltip(); using var tt = ImUtf8.Tooltip();

View file

@ -91,7 +91,7 @@ public sealed unsafe class AdvancedDyePopup(
var modelHandle = model == null ? null : model->ModelResourceHandle; var modelHandle = model == null ? null : model->ModelResourceHandle;
var path = materialHandle == null var path = materialHandle == null
? string.Empty ? string.Empty
: ByteString.FromSpanUnsafe(materialHandle->ResourceHandle.FileName.AsSpan(), true).ToString(); : ByteString.FromSpanUnsafe(materialHandle->FileName.AsSpan(), true).ToString();
var gamePath = modelHandle == null var gamePath = modelHandle == null
? string.Empty ? string.Empty
: modelHandle->GetMaterialFileNameBySlot(index.MaterialIndex).ToString(); : modelHandle->GetMaterialFileNameBySlot(index.MaterialIndex).ToString();

View file

@ -432,7 +432,7 @@ public class SetPanel(
if (source) if (source)
{ {
ImUtf8.Text($"Moving design #{index + 1:D2}..."); ImUtf8.Text($"Moving design #{index + 1:D2}...");
if (ImGui.SetDragDropPayload(dragDropLabel, nint.Zero, 0)) if (ImGui.SetDragDropPayload(dragDropLabel, null, 0))
{ {
_dragIndex = index; _dragIndex = index;
_selector.DragDesignIndex = index; _selector.DragDesignIndex = index;

View file

@ -144,7 +144,7 @@ public class SetSelector : IDisposable
ImGui.SameLine(); ImGui.SameLine();
var f = _enabledFilter; var f = _enabledFilter;
if (ImGui.CheckboxFlags("##enabledFilter", ref f, 3)) if (ImGui.CheckboxFlags("##enabledFilter", ref f, 3u))
{ {
_enabledFilter = _enabledFilter switch _enabledFilter = _enabledFilter switch
{ {
@ -347,7 +347,7 @@ public class SetSelector : IDisposable
if (source) if (source)
{ {
ImGui.TextUnformatted($"Moving design set {GetSetName(set, index)} from position {index + 1}..."); ImGui.TextUnformatted($"Moving design set {GetSetName(set, index)} from position {index + 1}...");
if (ImGui.SetDragDropPayload(dragDropLabel, nint.Zero, 0)) if (ImGui.SetDragDropPayload(dragDropLabel, null, 0))
_dragIndex = index; _dragIndex = index;
} }
} }

View file

@ -49,7 +49,7 @@ public unsafe class PenumbraPanel(PenumbraService _penumbra, PenumbraChangedItem
ImGui.TableNextColumn(); ImGui.TableNextColumn();
var address = _drawObject.Address; var address = _drawObject.Address;
ImGui.SetNextItemWidth(200 * ImGuiHelpers.GlobalScale); ImGui.SetNextItemWidth(200 * ImGuiHelpers.GlobalScale);
if (ImGui.InputScalar("##drawObjectPtr", ImGuiDataType.U64, (nint)(&address), nint.Zero, nint.Zero, "%llx", if (ImGui.InputScalar("##drawObjectPtr", ImGuiDataType.U64, ref address, nint.Zero, nint.Zero, "%llx",
ImGuiInputTextFlags.CharsHexadecimal)) ImGuiInputTextFlags.CharsHexadecimal))
_drawObject = address; _drawObject = address;
ImGuiUtil.DrawTableColumn(_penumbra.Available ImGuiUtil.DrawTableColumn(_penumbra.Available

View file

@ -195,7 +195,7 @@ public class DesignLinkDrawer(
{ {
if (source) if (source)
{ {
ImGui.SetDragDropPayload("DraggingLink", IntPtr.Zero, 0); ImGui.SetDragDropPayload("DraggingLink", null, 0);
ImGui.TextUnformatted($"Reordering {design.Name}..."); ImGui.TextUnformatted($"Reordering {design.Name}...");
_dragDropIndex = index; _dragDropIndex = index;
_dragDropOrder = order; _dragDropOrder = order;

View file

@ -154,6 +154,11 @@ public class DesignPanel
EquipmentDrawer.DrawMetaToggle(ToggleDrawData.FromDesign(MetaIndex.WeaponState, _manager, _selector.Selected!)); EquipmentDrawer.DrawMetaToggle(ToggleDrawData.FromDesign(MetaIndex.WeaponState, _manager, _selector.Selected!));
EquipmentDrawer.DrawMetaToggle(ToggleDrawData.CrestFromDesign(CrestFlag.OffHand, _manager, _selector.Selected!)); EquipmentDrawer.DrawMetaToggle(ToggleDrawData.CrestFromDesign(CrestFlag.OffHand, _manager, _selector.Selected!));
} }
ImGui.SameLine();
using (var _ = ImRaii.Group())
{
EquipmentDrawer.DrawMetaToggle(ToggleDrawData.FromDesign(MetaIndex.EarState, _manager, _selector.Selected!));
}
} }
private void DrawCustomize() private void DrawCustomize()

View file

@ -123,7 +123,7 @@ public class CollectionOverrideDrawer(
{ {
if (source) if (source)
{ {
ImGui.SetDragDropPayload("DraggingOverride", nint.Zero, 0); ImGui.SetDragDropPayload("DraggingOverride", null, 0);
ImGui.TextUnformatted($"Reordering Override #{idx + 1}..."); ImGui.TextUnformatted($"Reordering Override #{idx + 1}...");
_dragDropIndex = idx; _dragDropIndex = idx;
} }

View file

@ -123,7 +123,7 @@ public class UnlockOverview(
var unlocked = customizeUnlocks.IsUnlocked(customize, out var time); var unlocked = customizeUnlocks.IsUnlocked(customize, out var time);
var icon = customizations.Manager.GetIcon(customize.IconId); var icon = customizations.Manager.GetIcon(customize.IconId);
var hasIcon = icon.TryGetWrap(out var wrap, out _); var hasIcon = icon.TryGetWrap(out var wrap, out _);
ImGui.Image(wrap?.ImGuiHandle ?? icon.GetWrapOrEmpty().ImGuiHandle, iconSize, Vector2.Zero, Vector2.One, ImGui.Image(wrap?.Handle ?? icon.GetWrapOrEmpty().Handle, iconSize, Vector2.Zero, Vector2.One,
unlocked || codes.Enabled(CodeService.CodeFlag.Shirts) ? Vector4.One : UnavailableTint); unlocked || codes.Enabled(CodeService.CodeFlag.Shirts) ? Vector4.One : UnavailableTint);
if (favorites.Contains(_selected3, _selected2, customize.Index, customize.Value)) if (favorites.Contains(_selected3, _selected2, customize.Index, customize.Value))
@ -135,7 +135,7 @@ public class UnlockOverview(
using var tt = ImRaii.Tooltip(); using var tt = ImRaii.Tooltip();
var size = new Vector2(wrap!.Width, wrap.Height); var size = new Vector2(wrap!.Width, wrap.Height);
if (size.X >= iconSize.X && size.Y >= iconSize.Y) if (size.X >= iconSize.X && size.Y >= iconSize.Y)
ImGui.Image(wrap.ImGuiHandle, size); ImGui.Image(wrap.Handle, size);
ImGui.TextUnformatted(unlockData.Name); ImGui.TextUnformatted(unlockData.Name);
ImGui.TextUnformatted($"{customize.Index.ToDefaultName()} {customize.Value.Value}"); ImGui.TextUnformatted($"{customize.Index.ToDefaultName()} {customize.Value.Value}");
ImGui.TextUnformatted(unlocked ? $"Unlocked on {time:g}" : "Not unlocked."); ImGui.TextUnformatted(unlocked ? $"Unlocked on {time:g}" : "Not unlocked.");
@ -194,7 +194,7 @@ public class UnlockOverview(
if (!textures.TryLoadIcon(item.IconId.Id, out var iconHandle)) if (!textures.TryLoadIcon(item.IconId.Id, out var iconHandle))
return; return;
var (icon, size) = (iconHandle.ImGuiHandle, new Vector2(iconHandle.Width, iconHandle.Height)); var (icon, size) = (iconHandle.Handle, new Vector2(iconHandle.Width, iconHandle.Height));
ImGui.Image(icon, iconSize, Vector2.Zero, Vector2.One, ImGui.Image(icon, iconSize, Vector2.Zero, Vector2.One,
unlocked || codes.Enabled(CodeService.CodeFlag.Shirts) ? Vector4.One : UnavailableTint); unlocked || codes.Enabled(CodeService.CodeFlag.Shirts) ? Vector4.One : UnavailableTint);
@ -265,7 +265,7 @@ public class UnlockOverview(
if (!textures.TryLoadIcon(item.IconId.Id, out var iconHandle)) if (!textures.TryLoadIcon(item.IconId.Id, out var iconHandle))
return; return;
var (icon, size) = (iconHandle.ImGuiHandle, new Vector2(iconHandle.Width, iconHandle.Height)); var (icon, size) = (iconHandle.Handle, new Vector2(iconHandle.Width, iconHandle.Height));
ImGui.Image(icon, iconSize, Vector2.Zero, Vector2.One, ImGui.Image(icon, iconSize, Vector2.Zero, Vector2.One,
unlocked || codes.Enabled(CodeService.CodeFlag.Shirts) ? Vector4.One : UnavailableTint); unlocked || codes.Enabled(CodeService.CodeFlag.Shirts) ? Vector4.One : UnavailableTint);

View file

@ -67,7 +67,7 @@ public sealed unsafe class CrestService : EventWrapperRef3<Actor, CrestFlag, boo
private delegate void CrestChangeDelegate(DrawDataContainer* container, byte crestFlags); private delegate void CrestChangeDelegate(DrawDataContainer* container, byte crestFlags);
[Signature(Sigs.CrestChange, DetourName = nameof(CrestChangeDetour))] [Signature(Sigs.SetFreeCompanyCrestBitfield, DetourName = nameof(CrestChangeDetour))]
private readonly Hook<CrestChangeDelegate> _crestChangeHook = null!; private readonly Hook<CrestChangeDelegate> _crestChangeHook = null!;
private void CrestChangeDetour(DrawDataContainer* container, byte crestFlags) private void CrestChangeDetour(DrawDataContainer* container, byte crestFlags)

View file

@ -114,9 +114,9 @@ public sealed unsafe class LiveColorTablePreviewer : IService, IDisposable
var frame = DateTimeOffset.UtcNow.UtcTicks; var frame = DateTimeOffset.UtcNow.UtcTicks;
var hueByte = frame % (steps * frameLength) / frameLength; var hueByte = frame % (steps * frameLength) / frameLength;
var hue = (float)hueByte / steps; var hue = (float)hueByte / steps;
float r, g, b = 0; Vector3 ret;
ImGui.ColorConvertHSVtoRGB(hue, 1, 1, &r, &g, &b); ImGui.ColorConvertHSVtoRGB(hue, 1, 1, &ret.X, &ret.Y, &ret.Z);
return new Vector3(r, g, b); return ret;
} }
public void Dispose() public void Dispose()

View file

@ -1,3 +1,4 @@
using Dalamud.Bindings.ImGui;
using Dalamud.Interface; using Dalamud.Interface;
using Dalamud.Interface.Textures.TextureWraps; using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
@ -12,30 +13,30 @@ public sealed class TextureService(IUiBuilder uiBuilder, IDataManager dataManage
{ {
private readonly IDalamudTextureWrap?[] _slotIcons = CreateSlotIcons(uiBuilder); private readonly IDalamudTextureWrap?[] _slotIcons = CreateSlotIcons(uiBuilder);
public (nint, Vector2, bool) GetIcon(EquipItem item, EquipSlot slot) public (ImTextureID, Vector2, bool) GetIcon(EquipItem item, EquipSlot slot)
{ {
if (item.IconId.Id != 0 && TryLoadIcon(item.IconId.Id, out var ret)) if (item.IconId.Id != 0 && TryLoadIcon(item.IconId.Id, out var ret))
return (ret.ImGuiHandle, new Vector2(ret.Width, ret.Height), false); return (ret.Handle, new Vector2(ret.Width, ret.Height), false);
var idx = slot.ToIndex(); var idx = slot.ToIndex();
return idx < 12 && _slotIcons[idx] != null return idx < 12 && _slotIcons[idx] != null
? (_slotIcons[idx]!.ImGuiHandle, new Vector2(_slotIcons[idx]!.Width, _slotIcons[idx]!.Height), true) ? (_slotIcons[idx]!.Handle, new Vector2(_slotIcons[idx]!.Width, _slotIcons[idx]!.Height), true)
: (nint.Zero, Vector2.Zero, true); : (default, Vector2.Zero, true);
} }
public (nint, Vector2, bool) GetIcon(EquipItem item, BonusItemFlag slot) public (ImTextureID, Vector2, bool) GetIcon(EquipItem item, BonusItemFlag slot)
{ {
if (item.IconId.Id != 0 && TryLoadIcon(item.IconId.Id, out var ret)) if (item.IconId.Id != 0 && TryLoadIcon(item.IconId.Id, out var ret))
return (ret.ImGuiHandle, new Vector2(ret.Width, ret.Height), false); return (ret.Handle, new Vector2(ret.Width, ret.Height), false);
var idx = slot.ToIndex(); var idx = slot.ToIndex();
if (idx == uint.MaxValue) if (idx == uint.MaxValue)
return (nint.Zero, Vector2.Zero, true); return (default, Vector2.Zero, true);
idx += 12; idx += 12;
return idx < 13 && _slotIcons[idx] != null return idx < 13 && _slotIcons[idx] != null
? (_slotIcons[idx]!.ImGuiHandle, new Vector2(_slotIcons[idx]!.Width, _slotIcons[idx]!.Height), true) ? (_slotIcons[idx]!.Handle, new Vector2(_slotIcons[idx]!.Width, _slotIcons[idx]!.Height), true)
: (nint.Zero, Vector2.Zero, true); : (default, Vector2.Zero, true);
} }
public void Dispose() public void Dispose()