mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Revert legacy tattoo changes.
This commit is contained in:
parent
c75315f0f7
commit
a5f35dbd17
2 changed files with 40 additions and 18 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Glamourer.GameData;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Glamourer.GameData;
|
||||
using Glamourer.Unlocks;
|
||||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
|
|
@ -200,13 +201,21 @@ public partial class CustomizationDrawer
|
|||
using var id = SetId(featureIdx);
|
||||
var enabled = _customize.Get(featureIdx) != CustomizeValue.Zero;
|
||||
var feature = _set.Data(featureIdx, 0, face);
|
||||
var icon = featureIdx == CustomizeIndex.LegacyTattoo
|
||||
? _legacyTattoo ?? _service.Manager.GetIcon(feature.IconId)
|
||||
: _service.Manager.GetIcon(feature.IconId);
|
||||
var hasIcon = icon.TryGetWrap(out var wrap, out _);
|
||||
bool hasIcon;
|
||||
IDalamudTextureWrap? wrap;
|
||||
var icon = _service.Manager.GetIcon(feature.IconId);
|
||||
if (featureIdx is CustomizeIndex.LegacyTattoo)
|
||||
{
|
||||
wrap = _legacyTattoo;
|
||||
hasIcon = wrap != null;
|
||||
}
|
||||
else
|
||||
{
|
||||
hasIcon = icon.TryGetWrap(out wrap, out _);
|
||||
}
|
||||
|
||||
if (ImGui.ImageButton(wrap?.ImGuiHandle ?? icon.GetWrapOrEmpty().ImGuiHandle, _iconSize, Vector2.Zero, Vector2.One,
|
||||
(int)ImGui.GetStyle().FramePadding.X,
|
||||
Vector4.Zero, enabled ? Vector4.One : _redTint))
|
||||
(int)ImGui.GetStyle().FramePadding.X, Vector4.Zero, enabled ? Vector4.One : _redTint))
|
||||
{
|
||||
_customize.Set(featureIdx, enabled ? CustomizeValue.Zero : CustomizeValue.Max);
|
||||
Changed |= _currentFlag;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Interface.Textures;
|
||||
using Dalamud.Interface.Textures;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Glamourer.GameData;
|
||||
using Glamourer.Services;
|
||||
using Glamourer.Unlocks;
|
||||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
|
@ -16,15 +15,16 @@ using Penumbra.GameData.Structs;
|
|||
namespace Glamourer.Gui.Customization;
|
||||
|
||||
public partial class CustomizationDrawer(
|
||||
TextureCache textureCache,
|
||||
ITextureProvider textures,
|
||||
CustomizeService _service,
|
||||
CodeService _codes,
|
||||
Configuration _config,
|
||||
FavoriteManager _favorites,
|
||||
HeightService _heightService)
|
||||
: IDisposable
|
||||
{
|
||||
private readonly Vector4 _redTint = new(0.6f, 0.3f, 0.3f, 1f);
|
||||
private readonly ISharedImmediateTexture? _legacyTattoo = GetLegacyTattooIcon(textureCache);
|
||||
private readonly IDalamudTextureWrap? _legacyTattoo = GetLegacyTattooIcon(textures);
|
||||
|
||||
private Exception? _terminate;
|
||||
|
||||
|
|
@ -49,6 +49,9 @@ public partial class CustomizationDrawer(
|
|||
private float _raceSelectorWidth;
|
||||
private bool _withApply;
|
||||
|
||||
public void Dispose()
|
||||
=> _legacyTattoo?.Dispose();
|
||||
|
||||
public bool Draw(CustomizeArray current, bool locked, bool lockedRedraw)
|
||||
{
|
||||
_withApply = false;
|
||||
|
|
@ -189,6 +192,16 @@ public partial class CustomizationDrawer(
|
|||
_raceSelectorWidth = _inputIntSize + _comboSelectorSize - _framedIconSize.X;
|
||||
}
|
||||
|
||||
private static ISharedImmediateTexture? GetLegacyTattooIcon(TextureCache icons)
|
||||
=> icons.TextureProvider.GetFromManifestResource(Assembly.GetExecutingAssembly(), "Glamourer.LegacyTattoo.raw");
|
||||
private static IDalamudTextureWrap? GetLegacyTattooIcon(ITextureProvider textures)
|
||||
{
|
||||
using var resource = Assembly.GetExecutingAssembly().GetManifestResourceStream("Glamourer.LegacyTattoo.raw");
|
||||
if (resource == null)
|
||||
return null;
|
||||
|
||||
var rawImage = new byte[resource.Length];
|
||||
var length = resource.Read(rawImage, 0, (int)resource.Length);
|
||||
return length == resource.Length
|
||||
? textures.CreateFromRaw(RawImageSpecification.Rgba32(192, 192), rawImage, "Glamourer.LegacyTattoo")
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue