mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Remaining API13 updates.
This commit is contained in:
parent
00d550f4fe
commit
ac6a726f57
16 changed files with 36 additions and 31 deletions
|
|
@ -29,7 +29,6 @@
|
|||
<ProjectReference Include="..\Penumbra.String\Penumbra.String.csproj" />
|
||||
<ProjectReference Include="..\Penumbra.GameData\Penumbra.GameData.csproj" />
|
||||
<PackageReference Include="Vortice.Direct3D11" Version="3.4.2-beta" />
|
||||
<PackageReference Update="DalamudPackager" Version="13.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"AssemblyVersion": "9.0.0.1",
|
||||
"RepoUrl": "https://github.com/Ottermandias/Glamourer",
|
||||
"ApplicableVersion": "any",
|
||||
"DalamudApiLevel": 12,
|
||||
"DalamudApiLevel": 13,
|
||||
"ImageUrls": null,
|
||||
"IconUrl": "https://raw.githubusercontent.com/Ottermandias/Glamourer/master/images/icon.png"
|
||||
}
|
||||
|
|
@ -287,13 +287,13 @@ public class CustomizeParameterDrawer(Configuration config, PaletteImport import
|
|||
}
|
||||
|
||||
private ImGuiColorEditFlags GetFlags()
|
||||
=> Format | Display | ImGuiColorEditFlags.HDR | ImGuiColorEditFlags.NoOptions;
|
||||
=> Format | Display | ImGuiColorEditFlags.Hdr | ImGuiColorEditFlags.NoOptions;
|
||||
|
||||
private ImGuiColorEditFlags Format
|
||||
=> config.UseFloatForColors ? ImGuiColorEditFlags.Float : ImGuiColorEditFlags.Uint8;
|
||||
|
||||
private ImGuiColorEditFlags Display
|
||||
=> config.UseRgbForColors ? ImGuiColorEditFlags.DisplayRGB : ImGuiColorEditFlags.DisplayHSV;
|
||||
=> config.UseRgbForColors ? ImGuiColorEditFlags.DisplayRgb : ImGuiColorEditFlags.DisplayHsv;
|
||||
|
||||
private ImRaii.IEndObject EnsureSize()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ public abstract class DesignComboBase : FilterComboCache<Tuple<IDesignStandIn, s
|
|||
ImGui.TextUnformatted("Currently resolving to ");
|
||||
using var color = ImRaii.PushColor(ImGuiCol.Text, DesignColors.GetColor(linkedDesign));
|
||||
ImGui.SameLine(0, 0);
|
||||
ImGui.TextUnformatted(linkedDesign.Name);
|
||||
ImGui.TextUnformatted(linkedDesign.Name.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -529,11 +529,11 @@ public class EquipmentDrawer
|
|||
|
||||
public unsafe void DrawDragDropTooltip()
|
||||
{
|
||||
var payload = ImGui.GetDragDropPayload().NativePtr;
|
||||
var payload = ImGui.GetDragDropPayload().Handle;
|
||||
if (payload is null)
|
||||
return;
|
||||
|
||||
if (!MemoryMarshal.CreateReadOnlySpanFromNullTerminated(payload->DataType).SequenceEqual("equipDragDrop"u8))
|
||||
if (!MemoryMarshal.CreateReadOnlySpanFromNullTerminated((byte*)Unsafe.AsPointer(ref payload->DataType_0)).SequenceEqual("equipDragDrop"u8))
|
||||
return;
|
||||
|
||||
using var tt = ImUtf8.Tooltip();
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public sealed unsafe class AdvancedDyePopup(
|
|||
var modelHandle = model == null ? null : model->ModelResourceHandle;
|
||||
var path = materialHandle == null
|
||||
? string.Empty
|
||||
: ByteString.FromSpanUnsafe(materialHandle->ResourceHandle.FileName.AsSpan(), true).ToString();
|
||||
: ByteString.FromSpanUnsafe(materialHandle->FileName.AsSpan(), true).ToString();
|
||||
var gamePath = modelHandle == null
|
||||
? string.Empty
|
||||
: modelHandle->GetMaterialFileNameBySlot(index.MaterialIndex).ToString();
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ public class SetPanel(
|
|||
if (source)
|
||||
{
|
||||
ImUtf8.Text($"Moving design #{index + 1:D2}...");
|
||||
if (ImGui.SetDragDropPayload(dragDropLabel, nint.Zero, 0))
|
||||
if (ImGui.SetDragDropPayload(dragDropLabel, null, 0))
|
||||
{
|
||||
_dragIndex = index;
|
||||
_selector.DragDesignIndex = index;
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ public class SetSelector : IDisposable
|
|||
ImGui.SameLine();
|
||||
var f = _enabledFilter;
|
||||
|
||||
if (ImGui.CheckboxFlags("##enabledFilter", ref f, 3))
|
||||
if (ImGui.CheckboxFlags("##enabledFilter", ref f, 3u))
|
||||
{
|
||||
_enabledFilter = _enabledFilter switch
|
||||
{
|
||||
|
|
@ -347,7 +347,7 @@ public class SetSelector : IDisposable
|
|||
if (source)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public unsafe class PenumbraPanel(PenumbraService _penumbra, PenumbraChangedItem
|
|||
ImGui.TableNextColumn();
|
||||
var address = _drawObject.Address;
|
||||
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))
|
||||
_drawObject = address;
|
||||
ImGuiUtil.DrawTableColumn(_penumbra.Available
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ public class DesignLinkDrawer(
|
|||
{
|
||||
if (source)
|
||||
{
|
||||
ImGui.SetDragDropPayload("DraggingLink", IntPtr.Zero, 0);
|
||||
ImGui.SetDragDropPayload("DraggingLink", null, 0);
|
||||
ImGui.TextUnformatted($"Reordering {design.Name}...");
|
||||
_dragDropIndex = index;
|
||||
_dragDropOrder = order;
|
||||
|
|
|
|||
|
|
@ -154,6 +154,11 @@ public class DesignPanel
|
|||
EquipmentDrawer.DrawMetaToggle(ToggleDrawData.FromDesign(MetaIndex.WeaponState, _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()
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public class CollectionOverrideDrawer(
|
|||
{
|
||||
if (source)
|
||||
{
|
||||
ImGui.SetDragDropPayload("DraggingOverride", nint.Zero, 0);
|
||||
ImGui.SetDragDropPayload("DraggingOverride", null, 0);
|
||||
ImGui.TextUnformatted($"Reordering Override #{idx + 1}...");
|
||||
_dragDropIndex = idx;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public class UnlockOverview(
|
|||
var unlocked = customizeUnlocks.IsUnlocked(customize, out var time);
|
||||
var icon = customizations.Manager.GetIcon(customize.IconId);
|
||||
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);
|
||||
|
||||
if (favorites.Contains(_selected3, _selected2, customize.Index, customize.Value))
|
||||
|
|
@ -135,7 +135,7 @@ public class UnlockOverview(
|
|||
using var tt = ImRaii.Tooltip();
|
||||
var size = new Vector2(wrap!.Width, wrap.Height);
|
||||
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($"{customize.Index.ToDefaultName()} {customize.Value.Value}");
|
||||
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))
|
||||
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,
|
||||
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))
|
||||
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,
|
||||
unlocked || codes.Enabled(CodeService.CodeFlag.Shirts) ? Vector4.One : UnavailableTint);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public sealed unsafe class CrestService : EventWrapperRef3<Actor, CrestFlag, boo
|
|||
|
||||
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 void CrestChangeDetour(DrawDataContainer* container, byte crestFlags)
|
||||
|
|
|
|||
|
|
@ -114,9 +114,9 @@ public sealed unsafe class LiveColorTablePreviewer : IService, IDisposable
|
|||
var frame = DateTimeOffset.UtcNow.UtcTicks;
|
||||
var hueByte = frame % (steps * frameLength) / frameLength;
|
||||
var hue = (float)hueByte / steps;
|
||||
float r, g, b = 0;
|
||||
ImGui.ColorConvertHSVtoRGB(hue, 1, 1, &r, &g, &b);
|
||||
return new Vector3(r, g, b);
|
||||
Vector3 ret;
|
||||
ImGui.ColorConvertHSVtoRGB(hue, 1, 1, &ret.X, &ret.Y, &ret.Z);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Dalamud.Plugin.Services;
|
||||
|
|
@ -12,30 +13,30 @@ public sealed class TextureService(IUiBuilder uiBuilder, IDataManager dataManage
|
|||
{
|
||||
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))
|
||||
return (ret.ImGuiHandle, new Vector2(ret.Width, ret.Height), false);
|
||||
return (ret.Handle, new Vector2(ret.Width, ret.Height), false);
|
||||
|
||||
var idx = slot.ToIndex();
|
||||
return idx < 12 && _slotIcons[idx] != null
|
||||
? (_slotIcons[idx]!.ImGuiHandle, new Vector2(_slotIcons[idx]!.Width, _slotIcons[idx]!.Height), true)
|
||||
: (nint.Zero, Vector2.Zero, true);
|
||||
? (_slotIcons[idx]!.Handle, new Vector2(_slotIcons[idx]!.Width, _slotIcons[idx]!.Height), 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))
|
||||
return (ret.ImGuiHandle, new Vector2(ret.Width, ret.Height), false);
|
||||
return (ret.Handle, new Vector2(ret.Width, ret.Height), false);
|
||||
|
||||
var idx = slot.ToIndex();
|
||||
if (idx == uint.MaxValue)
|
||||
return (nint.Zero, Vector2.Zero, true);
|
||||
return (default, Vector2.Zero, true);
|
||||
|
||||
idx += 12;
|
||||
return idx < 13 && _slotIcons[idx] != null
|
||||
? (_slotIcons[idx]!.ImGuiHandle, new Vector2(_slotIcons[idx]!.Width, _slotIcons[idx]!.Height), true)
|
||||
: (nint.Zero, Vector2.Zero, true);
|
||||
? (_slotIcons[idx]!.Handle, new Vector2(_slotIcons[idx]!.Width, _slotIcons[idx]!.Height), true)
|
||||
: (default, Vector2.Zero, true);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue