mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-22 23:47:45 +01:00
Some updates.
This commit is contained in:
parent
2d8d6fa75f
commit
01f05e5330
38 changed files with 629 additions and 677 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using Glamourer.Api.Enums;
|
||||
using Glamourer.Designs;
|
||||
using Glamourer.State;
|
||||
using ImSharp;
|
||||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
|
@ -21,11 +22,11 @@ public class DesignsApi(
|
|||
|
||||
public Dictionary<Guid, (string DisplayName, string FullPath, uint DisplayColor, bool ShownInQdb)> GetDesignListExtended()
|
||||
=> fileSystem.ToDictionary(kvp => kvp.Key.Identifier,
|
||||
kvp => (kvp.Key.Name.Text, kvp.Value.FullName(), color.GetColor(kvp.Key), kvp.Key.QuickDesign));
|
||||
kvp => (kvp.Key.Name.Text, kvp.Value.FullName(), color.GetColor(kvp.Key).Color, kvp.Key.QuickDesign));
|
||||
|
||||
public (string DisplayName, string FullPath, uint DisplayColor, bool ShowInQdb) GetExtendedDesignData(Guid designId)
|
||||
=> designs.Designs.ByIdentifier(designId) is { } d
|
||||
? (d.Name.Text, fileSystem.TryGetValue(d, out var leaf) ? leaf.FullName() : d.Name.Text, color.GetColor(d), d.QuickDesign)
|
||||
? (d.Name.Text, fileSystem.TryGetValue(d, out var leaf) ? leaf.FullName() : d.Name.Text, color.GetColor(d).Color, d.QuickDesign)
|
||||
: (string.Empty, string.Empty, 0, false);
|
||||
|
||||
public GlamourerApiEc ApplyDesign(Guid designId, int objectIndex, uint key, ApplyFlag flags)
|
||||
|
|
|
|||
|
|
@ -8,13 +8,11 @@ using Glamourer.Interop;
|
|||
using Glamourer.Services;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Luna;
|
||||
|
||||
namespace Glamourer.Automation;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Glamourer.Designs;
|
||||
using Glamourer.Interop;
|
||||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.String;
|
||||
|
|
|
|||
|
|
@ -6,11 +6,8 @@ using Glamourer.Gui;
|
|||
using Glamourer.Gui.Tabs.DesignTab;
|
||||
using Glamourer.Services;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Filesystem;
|
||||
using OtterGui.Widgets;
|
||||
using Luna;
|
||||
using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
||||
|
||||
namespace Glamourer;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Glamourer.Api.Enums;
|
||||
using Glamourer.GameData;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
||||
namespace Glamourer.Designs;
|
||||
|
|
@ -28,7 +28,7 @@ public record struct ApplicationCollection(
|
|||
CustomizeFlagExtensions.AllRelevant, CrestExtensions.AllRelevant, 0, MetaFlag.HatState | MetaFlag.VisorState | MetaFlag.WeaponState | MetaFlag.EarState);
|
||||
|
||||
public static ApplicationCollection FromKeys()
|
||||
=> (ImGui.GetIO().KeyCtrl, ImGui.GetIO().KeyShift) switch
|
||||
=> (Im.Io.KeyControl, Im.Io.KeyShift) switch
|
||||
{
|
||||
(false, false) => All,
|
||||
(true, true) => All,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Glamourer.Api.Enums;
|
||||
using Glamourer.GameData;
|
||||
using Glamourer.State;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
||||
namespace Glamourer.Designs;
|
||||
|
|
@ -11,10 +11,10 @@ public readonly struct ApplicationRules(ApplicationCollection application, bool
|
|||
public static readonly ApplicationRules All = new(ApplicationCollection.All, true);
|
||||
|
||||
public static ApplicationRules FromModifiers(ActorState state)
|
||||
=> FromModifiers(state, ImGui.GetIO().KeyCtrl, ImGui.GetIO().KeyShift);
|
||||
=> FromModifiers(state, Im.Io.KeyControl, Im.Io.KeyShift);
|
||||
|
||||
public static ApplicationRules NpcFromModifiers()
|
||||
=> NpcFromModifiers(ImGui.GetIO().KeyCtrl, ImGui.GetIO().KeyShift);
|
||||
=> NpcFromModifiers(Im.Io.KeyControl, Im.Io.KeyShift);
|
||||
|
||||
public static ApplicationRules AllButParameters(ActorState state)
|
||||
=> new(ApplicationCollection.All with { Parameters = ComputeParameters(state.ModelData, state.BaseData, All.Parameters) }, true);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ using Newtonsoft.Json;
|
|||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Notification = OtterGui.Classes.Notification;
|
||||
using Luna;
|
||||
using Notification = Luna.Notification;
|
||||
using SaveType = OtterGui.Classes.SaveType;
|
||||
|
||||
namespace Glamourer.Designs;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ using Glamourer.GameData;
|
|||
using Glamourer.Interop.Material;
|
||||
using Glamourer.Services;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.GameData.DataContainers;
|
||||
using Luna;
|
||||
|
||||
namespace Glamourer.Designs;
|
||||
|
||||
|
|
@ -595,19 +595,19 @@ public class DesignBase
|
|||
design.SetApplyCrest(CrestFlag.OffHand, applyCrestOff);
|
||||
}
|
||||
var metaValue = QuadBool.FromJObject(equip["Hat"], "Show", "Apply", QuadBool.NullFalse);
|
||||
design.SetApplyMeta(MetaIndex.HatState, metaValue.Enabled);
|
||||
design.SetApplyMeta(MetaIndex.HatState, metaValue.Set);
|
||||
design._designData.SetHatVisible(metaValue.ForcedValue);
|
||||
|
||||
metaValue = QuadBool.FromJObject(equip["Weapon"], "Show", "Apply", QuadBool.NullFalse);
|
||||
design.SetApplyMeta(MetaIndex.WeaponState, metaValue.Enabled);
|
||||
design.SetApplyMeta(MetaIndex.WeaponState, metaValue.Set);
|
||||
design._designData.SetWeaponVisible(metaValue.ForcedValue);
|
||||
|
||||
metaValue = QuadBool.FromJObject(equip["Visor"], "IsToggled", "Apply", QuadBool.NullFalse);
|
||||
design.SetApplyMeta(MetaIndex.VisorState, metaValue.Enabled);
|
||||
design.SetApplyMeta(MetaIndex.VisorState, metaValue.Set);
|
||||
design._designData.SetVisor(metaValue.ForcedValue);
|
||||
|
||||
metaValue = QuadBool.FromJObject(equip["VieraEars"], "Show", "Apply", QuadBool.NullTrue);
|
||||
design.SetApplyMeta(MetaIndex.EarState, metaValue.Enabled);
|
||||
design.SetApplyMeta(MetaIndex.EarState, metaValue.Set);
|
||||
design._designData.SetEarsVisible(metaValue.ForcedValue);
|
||||
return;
|
||||
|
||||
|
|
@ -652,7 +652,7 @@ public class DesignBase
|
|||
|
||||
var wetness = QuadBool.FromJObject(json["Wetness"], "Value", "Apply", QuadBool.NullFalse);
|
||||
design._designData.SetIsWet(wetness.ForcedValue);
|
||||
design.SetApplyMeta(MetaIndex.Wetness, wetness.Enabled);
|
||||
design.SetApplyMeta(MetaIndex.Wetness, wetness.Set);
|
||||
|
||||
design._designData.ModelId = json["ModelId"]?.ToObject<uint>() ?? 0;
|
||||
PrintWarning(customizations.ValidateModelId(design._designData.ModelId, out design._designData.ModelId,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Glamourer.Gui;
|
||||
using Glamourer.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
|
||||
namespace Glamourer.Designs;
|
||||
|
||||
|
|
@ -18,94 +14,89 @@ public class DesignColorUi(DesignColors colors, Configuration config)
|
|||
|
||||
public void Draw()
|
||||
{
|
||||
using var table = ImRaii.Table("designColors", 3, ImGuiTableFlags.RowBg);
|
||||
using var table = Im.Table.Begin("designColors"u8, 3, TableFlags.RowBackground);
|
||||
if (!table)
|
||||
return;
|
||||
|
||||
var changeString = string.Empty;
|
||||
uint? changeValue = null;
|
||||
var changeString = string.Empty;
|
||||
Rgba32? changeValue = null;
|
||||
|
||||
var buttonSize = new Vector2(ImGui.GetFrameHeight());
|
||||
ImGui.TableSetupColumn("##Delete", ImGuiTableColumnFlags.WidthFixed, buttonSize.X);
|
||||
ImGui.TableSetupColumn("##Select", ImGuiTableColumnFlags.WidthFixed, buttonSize.X);
|
||||
ImGui.TableSetupColumn("Color Name", ImGuiTableColumnFlags.WidthStretch);
|
||||
table.SetupColumn("##Delete"u8, TableColumnFlags.WidthFixed, Im.Style.FrameHeight);
|
||||
table.SetupColumn("##Select"u8, TableColumnFlags.WidthFixed, Im.Style.FrameHeight);
|
||||
table.SetupColumn("Color Name"u8, TableColumnFlags.WidthStretch);
|
||||
|
||||
ImGui.TableHeadersRow();
|
||||
table.HeaderRow();
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Recycle.ToIconString(), buttonSize,
|
||||
"Revert the color used for missing design colors to its default.", colors.MissingColor == DesignColors.MissingColorDefault,
|
||||
true))
|
||||
table.NextColumn();
|
||||
if (ImEx.Icon.Button(LunaStyle.RefreshIcon, "Revert the color used for missing design colors to its default."u8,
|
||||
colors.MissingColor == DesignColors.MissingColorDefault))
|
||||
{
|
||||
changeString = DesignColors.MissingColorName;
|
||||
changeValue = DesignColors.MissingColorDefault;
|
||||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
if (DrawColorButton(DesignColors.MissingColorName, colors.MissingColor, out var newColor))
|
||||
table.NextColumn();
|
||||
if (DrawColorButton(DesignColors.MissingColorNameU8, colors.MissingColor, out var newColor))
|
||||
{
|
||||
changeString = DesignColors.MissingColorName;
|
||||
changeValue = newColor;
|
||||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + ImGui.GetStyle().FramePadding.X);
|
||||
ImGui.TextUnformatted(DesignColors.MissingColorName);
|
||||
ImGuiUtil.HoverTooltip("This color is used when the color specified in a design is not available.");
|
||||
|
||||
table.NextColumn();
|
||||
Im.Cursor.X += Im.Style.FramePadding.X;
|
||||
Im.Text(DesignColors.MissingColorNameU8);
|
||||
Im.Tooltip.OnHover("This color is used when the color specified in a design is not available."u8);
|
||||
|
||||
var disabled = !config.DeleteDesignModifier.IsActive();
|
||||
var tt = "Delete this color. This does not remove it from designs using it.";
|
||||
if (disabled)
|
||||
tt += $"\nHold {config.DeleteDesignModifier} to delete.";
|
||||
|
||||
foreach (var ((name, color), idx) in colors.WithIndex())
|
||||
foreach (var (idx, (name, color)) in colors.Index())
|
||||
{
|
||||
using var id = ImRaii.PushId(idx);
|
||||
ImGui.TableNextColumn();
|
||||
using var id = Im.Id.Push(idx);
|
||||
table.NextColumn();
|
||||
|
||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Trash.ToIconString(), buttonSize, tt, disabled, true))
|
||||
if (ImEx.Icon.Button(LunaStyle.DeleteIcon, "Delete this color. This does not remove it from designs using it."u8, disabled))
|
||||
{
|
||||
changeString = name;
|
||||
changeValue = null;
|
||||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
if (disabled)
|
||||
Im.Tooltip.OnHover($"\nHold {config.DeleteDesignModifier} to delete.");
|
||||
|
||||
table.NextColumn();
|
||||
if (DrawColorButton(name, color, out newColor))
|
||||
{
|
||||
changeString = name;
|
||||
changeValue = newColor;
|
||||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + ImGui.GetStyle().FramePadding.X);
|
||||
ImGui.TextUnformatted(name);
|
||||
table.NextColumn();
|
||||
Im.Cursor.X += Im.Style.FramePadding.X;
|
||||
Im.Text(name);
|
||||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
(tt, disabled) = _newName.Length == 0
|
||||
table.NextColumn();
|
||||
(var tt, disabled) = _newName.Length == 0
|
||||
? ("Specify a name for a new color first.", true)
|
||||
: _newName is DesignColors.MissingColorName or DesignColors.AutomaticName
|
||||
? ($"You can not use the name {DesignColors.MissingColorName} or {DesignColors.AutomaticName}, choose a different one.", true)
|
||||
: colors.ContainsKey(_newName)
|
||||
? ($"The color {_newName} already exists, please choose a different name.", true)
|
||||
: ($"Add a new color {_newName} to your list.", false);
|
||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Plus.ToIconString(), buttonSize, tt, disabled, true))
|
||||
if (ImEx.Icon.Button(LunaStyle.AddObjectIcon, tt, disabled))
|
||||
{
|
||||
changeString = _newName;
|
||||
changeValue = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X);
|
||||
if (ImGui.InputTextWithHint("##newDesignColor", "New Color Name...", ref _newName, 64, ImGuiInputTextFlags.EnterReturnsTrue))
|
||||
table.NextColumn();
|
||||
table.NextColumn();
|
||||
Im.Item.SetNextWidth(Im.ContentRegion.Available.X);
|
||||
if (Im.Input.Text("##newDesignColor"u8, ref _newName, "New Color Name..."u8, InputTextFlags.EnterReturnsTrue))
|
||||
{
|
||||
changeString = _newName;
|
||||
changeValue = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
|
||||
if (changeString.Length > 0)
|
||||
{
|
||||
if (!changeValue.HasValue)
|
||||
|
|
@ -115,32 +106,26 @@ public class DesignColorUi(DesignColors colors, Configuration config)
|
|||
}
|
||||
}
|
||||
|
||||
public static bool DrawColorButton(string tooltip, uint color, out uint newColor)
|
||||
public static bool DrawColorButton(Utf8StringHandler<LabelStringHandlerBuffer> tooltip, Rgba32 color, out Rgba32 newColor)
|
||||
{
|
||||
var vec = ImGui.ColorConvertU32ToFloat4(color);
|
||||
if (!ImGui.ColorEdit4(tooltip, ref vec, ImGuiColorEditFlags.AlphaPreviewHalf | ImGuiColorEditFlags.NoInputs))
|
||||
{
|
||||
ImGuiUtil.HoverTooltip(tooltip);
|
||||
newColor = color;
|
||||
return false;
|
||||
}
|
||||
|
||||
ImGuiUtil.HoverTooltip(tooltip);
|
||||
|
||||
newColor = ImGui.ColorConvertFloat4ToU32(vec);
|
||||
return newColor != color;
|
||||
var ret = Im.Color.Editor(tooltip, ref color, ColorEditorFlags.AlphaPreviewHalf | ColorEditorFlags.NoInputs);
|
||||
Im.Tooltip.OnHover(ref tooltip);
|
||||
newColor = color;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public class DesignColors : ISavable, IReadOnlyDictionary<string, uint>
|
||||
public class DesignColors : ISavable, IReadOnlyDictionary<string, Rgba32>
|
||||
{
|
||||
public const string AutomaticName = "Automatic";
|
||||
public const string MissingColorName = "Missing Color";
|
||||
public const uint MissingColorDefault = 0xFF0000D0;
|
||||
public const string AutomaticName = "Automatic";
|
||||
public static readonly StringU8 AutomaticNameU8 = new("Automatic"u8);
|
||||
public const string MissingColorName = "Missing Color";
|
||||
public static readonly StringU8 MissingColorNameU8 = new("Missing Color"u8);
|
||||
public const uint MissingColorDefault = 0xFF0000D0;
|
||||
|
||||
private readonly SaveService _saveService;
|
||||
private readonly Dictionary<string, uint> _colors = [];
|
||||
public uint MissingColor { get; private set; } = MissingColorDefault;
|
||||
private readonly SaveService _saveService;
|
||||
private readonly Dictionary<string, Rgba32> _colors = [];
|
||||
public Rgba32 MissingColor { get; private set; } = MissingColorDefault;
|
||||
|
||||
public event Action? ColorChanged;
|
||||
|
||||
|
|
@ -150,37 +135,37 @@ public class DesignColors : ISavable, IReadOnlyDictionary<string, uint>
|
|||
Load();
|
||||
}
|
||||
|
||||
public uint GetColor(Design? design)
|
||||
public Rgba32 GetColor(Design? design)
|
||||
{
|
||||
if (design == null)
|
||||
if (design is null)
|
||||
return ColorId.NormalDesign.Value();
|
||||
|
||||
if (design.Color.Length == 0)
|
||||
if (design.Color.Length is 0)
|
||||
return AutoColor(design);
|
||||
|
||||
return TryGetValue(design.Color, out var color) ? color : MissingColor;
|
||||
}
|
||||
|
||||
public void SetColor(string key, uint newColor)
|
||||
public void SetColor(string key, Rgba32 newColor)
|
||||
{
|
||||
if (key.Length == 0)
|
||||
if (key.Length is 0)
|
||||
return;
|
||||
|
||||
if (key is MissingColorName && MissingColor != newColor)
|
||||
{
|
||||
MissingColor = newColor;
|
||||
MissingColor = newColor.Color;
|
||||
SaveAndInvoke();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_colors.TryAdd(key, newColor))
|
||||
if (_colors.TryAdd(key, newColor.Color))
|
||||
{
|
||||
SaveAndInvoke();
|
||||
return;
|
||||
}
|
||||
|
||||
_colors.TryGetValue(key, out var color);
|
||||
_colors[key] = newColor;
|
||||
_colors[key] = newColor.Color;
|
||||
|
||||
if (color != newColor)
|
||||
SaveAndInvoke();
|
||||
|
|
@ -206,7 +191,7 @@ public class DesignColors : ISavable, IReadOnlyDictionary<string, uint>
|
|||
var jObj = new JObject
|
||||
{
|
||||
["Version"] = 1,
|
||||
["MissingColor"] = MissingColor,
|
||||
["MissingColor"] = MissingColor.Color,
|
||||
["Definitions"] = JToken.FromObject(_colors),
|
||||
};
|
||||
writer.Write(jObj.ToString(Formatting.Indented));
|
||||
|
|
@ -244,7 +229,7 @@ public class DesignColors : ISavable, IReadOnlyDictionary<string, uint>
|
|||
}
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<string, uint>> GetEnumerator()
|
||||
public IEnumerator<KeyValuePair<string, Rgba32>> GetEnumerator()
|
||||
=> _colors.GetEnumerator();
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
|
|
@ -256,15 +241,16 @@ public class DesignColors : ISavable, IReadOnlyDictionary<string, uint>
|
|||
public bool ContainsKey(string key)
|
||||
=> _colors.ContainsKey(key);
|
||||
|
||||
public bool TryGetValue(string key, out uint value)
|
||||
public bool TryGetValue(string key, out Rgba32 value)
|
||||
{
|
||||
if (_colors.TryGetValue(key, out value))
|
||||
{
|
||||
if (value == 0)
|
||||
value = ImGui.GetColorU32(ImGuiCol.Text);
|
||||
if (value.IsTransparent)
|
||||
value = Im.Color.Get(ImGuiColor.Text);
|
||||
return true;
|
||||
}
|
||||
|
||||
value = Rgba32.Transparent;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -281,12 +267,12 @@ public class DesignColors : ISavable, IReadOnlyDictionary<string, uint>
|
|||
};
|
||||
}
|
||||
|
||||
public uint this[string key]
|
||||
public Rgba32 this[string key]
|
||||
=> _colors[key];
|
||||
|
||||
public IEnumerable<string> Keys
|
||||
=> _colors.Keys;
|
||||
|
||||
public IEnumerable<uint> Values
|
||||
public IEnumerable<Rgba32> Values
|
||||
=> _colors.Values;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,13 @@
|
|||
using Glamourer.Designs.History;
|
||||
using Glamourer.Events;
|
||||
using Glamourer.Services;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Filesystem;
|
||||
|
||||
namespace Glamourer.Designs;
|
||||
|
||||
public sealed class DesignFileSystem : FileSystem<Design>, IDisposable, ISavable
|
||||
public sealed class DesignFileSystem : OtterGui.Filesystem.FileSystem<Design>, IDisposable, ISavable
|
||||
{
|
||||
private readonly DesignChanged _designChanged;
|
||||
|
||||
|
|
@ -39,7 +38,7 @@ public sealed class DesignFileSystem : FileSystem<Design>, IDisposable, ISavable
|
|||
_designChanged.Unsubscribe(OnDesignChange);
|
||||
}
|
||||
|
||||
public struct CreationDate : ISortMode<Design>
|
||||
public struct CreationDate : OtterGui.Filesystem.ISortMode<Design>
|
||||
{
|
||||
public ReadOnlySpan<byte> Name
|
||||
=> "Creation Date (Older First)"u8;
|
||||
|
|
@ -51,7 +50,7 @@ public sealed class DesignFileSystem : FileSystem<Design>, IDisposable, ISavable
|
|||
=> f.GetSubFolders().Cast<IPath>().Concat(f.GetLeaves().OrderBy(l => l.Value.CreationDate));
|
||||
}
|
||||
|
||||
public struct UpdateDate : ISortMode<Design>
|
||||
public struct UpdateDate : OtterGui.Filesystem.ISortMode<Design>
|
||||
{
|
||||
public ReadOnlySpan<byte> Name
|
||||
=> "Update Date (Older First)"u8;
|
||||
|
|
@ -63,7 +62,7 @@ public sealed class DesignFileSystem : FileSystem<Design>, IDisposable, ISavable
|
|||
=> f.GetSubFolders().Cast<IPath>().Concat(f.GetLeaves().OrderBy(l => l.Value.LastEdit));
|
||||
}
|
||||
|
||||
public struct InverseCreationDate : ISortMode<Design>
|
||||
public struct InverseCreationDate : OtterGui.Filesystem.ISortMode<Design>
|
||||
{
|
||||
public ReadOnlySpan<byte> Name
|
||||
=> "Creation Date (Newer First)"u8;
|
||||
|
|
@ -75,7 +74,7 @@ public sealed class DesignFileSystem : FileSystem<Design>, IDisposable, ISavable
|
|||
=> f.GetSubFolders().Cast<IPath>().Concat(f.GetLeaves().OrderByDescending(l => l.Value.CreationDate));
|
||||
}
|
||||
|
||||
public struct InverseUpdateDate : ISortMode<Design>
|
||||
public struct InverseUpdateDate : OtterGui.Filesystem.ISortMode<Design>
|
||||
{
|
||||
public ReadOnlySpan<byte> Name
|
||||
=> "Update Date (Newer First)"u8;
|
||||
|
|
@ -87,9 +86,9 @@ public sealed class DesignFileSystem : FileSystem<Design>, IDisposable, ISavable
|
|||
=> f.GetSubFolders().Cast<IPath>().Concat(f.GetLeaves().OrderByDescending(l => l.Value.LastEdit));
|
||||
}
|
||||
|
||||
private void OnChange(FileSystemChangeType type, IPath _1, IPath? _2, IPath? _3)
|
||||
private void OnChange(OtterGui.Filesystem.FileSystemChangeType type, IPath _1, IPath? _2, IPath? _3)
|
||||
{
|
||||
if (type != FileSystemChangeType.Reload)
|
||||
if (type != OtterGui.Filesystem.FileSystemChangeType.Reload)
|
||||
_saveService.QueueSave(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,29 +1,26 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Luna;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using MessageService = OtterGui.Classes.MessageService;
|
||||
using Notification = OtterGui.Classes.Notification;
|
||||
using Luna;
|
||||
using Notification = Luna.Notification;
|
||||
|
||||
namespace Glamourer.Designs.Links;
|
||||
|
||||
public sealed class DesignLinkLoader(DesignStorage designStorage, MessageService messager)
|
||||
: DelayedReferenceLoader<Design, LinkData>(messager), IService
|
||||
: DelayedReferenceLoader<Design, Design, LinkData>(messager), IService
|
||||
{
|
||||
protected override bool TryGetObject(LinkData data, [NotNullWhen(true)] out Design? obj)
|
||||
=> ArrayExtensions.FindFirst(designStorage, d => d.Identifier == data.Identity, out obj);
|
||||
protected override bool TryGetObject(in LinkData data, [NotNullWhen(true)] out Design? obj)
|
||||
{
|
||||
var identity = data.Identity;
|
||||
return designStorage.FindFirst(d => d.Identifier == identity, out obj);
|
||||
}
|
||||
|
||||
protected override bool SetObject(Design parent, Design child, LinkData data, out string error)
|
||||
protected override bool SetObject(Design parent, Design child, in LinkData data, out string error)
|
||||
=> LinkContainer.AddLink(parent, child, data.Type, data.Order, out error);
|
||||
|
||||
protected override void HandleChildNotFound(Design parent, LinkData data)
|
||||
protected override void HandleChildNotFound(Design parent, in LinkData data)
|
||||
{
|
||||
Messager.AddMessage(new Notification(
|
||||
$"Could not find the design {data.Identity}. If this design was deleted, please re-save {parent.Identifier}.",
|
||||
NotificationType.Warning));
|
||||
$"Could not find the design {data.Identity}. If this design was deleted, please re-save {parent.Identifier}."));
|
||||
}
|
||||
|
||||
protected override void HandleChildNotSet(Design parent, Design child, string error)
|
||||
=> Messager.AddMessage(new Notification($"Could not link {child.Identifier} to {parent.Identifier}: {error}",
|
||||
NotificationType.Warning));
|
||||
=> Messager.AddMessage(new Notification($"Could not link {child.Identifier} to {parent.Identifier}: {error}"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Glamourer.Gui;
|
||||
using Glamourer.Services;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui.Classes;
|
||||
using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
||||
|
||||
namespace Glamourer;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ using Glamourer.State;
|
|||
using Luna;
|
||||
using Penumbra.GameData.Interop;
|
||||
using Logger = OtterGui.Log.Logger;
|
||||
using MessageService = OtterGui.Classes.MessageService;
|
||||
|
||||
namespace Glamourer;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,13 @@ using Glamourer.Designs.History;
|
|||
using Glamourer.Designs.Special;
|
||||
using Glamourer.Events;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Log;
|
||||
using OtterGui.Widgets;
|
||||
using MouseWheelType = OtterGui.Widgets.MouseWheelType;
|
||||
|
||||
namespace Glamourer.Gui;
|
||||
|
||||
|
|
@ -52,7 +54,7 @@ public abstract class DesignComboBase : FilterComboCache<Tuple<IDesignStandIn, s
|
|||
{
|
||||
case Design realDesign:
|
||||
{
|
||||
using var color = ImRaii.PushColor(ImGuiCol.Text, DesignColors.GetColor(realDesign));
|
||||
using var color = ImGuiColor.Text.Push(DesignColors.GetColor(realDesign));
|
||||
ret = base.DrawSelectable(globalIdx, selected);
|
||||
DrawPath(path, realDesign);
|
||||
return ret;
|
||||
|
|
@ -92,10 +94,9 @@ public abstract class DesignComboBase : FilterComboCache<Tuple<IDesignStandIn, s
|
|||
InnerWidth = 400 * ImGuiHelpers.GlobalScale;
|
||||
var name = label ?? "Select Design Here...";
|
||||
bool ret;
|
||||
using (_ = currentDesign != null ? ImRaii.PushColor(ImGuiCol.Text, DesignColors.GetColor(currentDesign as Design)) : null)
|
||||
using (currentDesign is not null ? ImGuiColor.Text.Push(DesignColors.GetColor(currentDesign as Design)) : null)
|
||||
{
|
||||
ret = Draw("##design", name, string.Empty, width, ImGui.GetTextLineHeightWithSpacing())
|
||||
&& CurrentSelection != null;
|
||||
ret = Draw("##design", name, string.Empty, width, ImGui.GetTextLineHeightWithSpacing()) && CurrentSelection is not null;
|
||||
}
|
||||
|
||||
if (currentDesign is Design design)
|
||||
|
|
@ -192,7 +193,7 @@ public abstract class DesignComboBase : FilterComboCache<Tuple<IDesignStandIn, s
|
|||
if (linkedDesign != null)
|
||||
{
|
||||
ImGui.TextUnformatted("Currently resolving to ");
|
||||
using var color = ImRaii.PushColor(ImGuiCol.Text, DesignColors.GetColor(linkedDesign));
|
||||
using var color = ImGuiColor.Text.Push(DesignColors.GetColor(linkedDesign));
|
||||
ImGui.SameLine(0, 0);
|
||||
ImGui.TextUnformatted(linkedDesign.Name.Text);
|
||||
}
|
||||
|
|
@ -202,7 +203,7 @@ public abstract class DesignComboBase : FilterComboCache<Tuple<IDesignStandIn, s
|
|||
}
|
||||
}
|
||||
|
||||
private static void DrawRightAligned(string leftText, string text, uint color)
|
||||
private static void DrawRightAligned(string leftText, string text, Rgba32 color)
|
||||
{
|
||||
var start = ImGui.GetItemRectMin();
|
||||
var pos = start.X + ImGui.CalcTextSize(leftText).X;
|
||||
|
|
@ -216,8 +217,7 @@ public abstract class DesignComboBase : FilterComboCache<Tuple<IDesignStandIn, s
|
|||
if (offset < ImGui.GetStyle().ItemSpacing.X)
|
||||
ImGuiUtil.HoverTooltip(text);
|
||||
else
|
||||
ImGui.GetWindowDrawList().AddText(start with { X = pos + offset },
|
||||
color, text);
|
||||
Im.Window.DrawList.Text(start with { X = pos + offset }, color, text);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,16 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Glamourer.Automation;
|
||||
using Glamourer.Designs;
|
||||
using Glamourer.Interop.Penumbra;
|
||||
using Glamourer.State;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.Interop;
|
||||
using Luna;
|
||||
|
||||
namespace Glamourer.Gui;
|
||||
|
||||
|
|
@ -30,7 +29,7 @@ public enum QdbButtons
|
|||
RevertAdvancedCustomization = 0x100,
|
||||
}
|
||||
|
||||
public sealed class DesignQuickBar : Window, IDisposable
|
||||
public sealed class DesignQuickBar : Dalamud.Interface.Windowing.Window, IDisposable
|
||||
{
|
||||
private ImGuiWindowFlags GetFlags
|
||||
=> _config.Ephemeral.LockDesignQuickBar
|
||||
|
|
@ -516,12 +515,12 @@ public sealed class DesignQuickBar : Window, IDisposable
|
|||
_config.Ephemeral.Save();
|
||||
}
|
||||
|
||||
private bool CheckKeyState(ModifiableHotkey key, bool noKey)
|
||||
private bool CheckKeyState(Luna.ModifiableHotkey key, bool noKey)
|
||||
{
|
||||
if (key.Hotkey == VirtualKey.NO_KEY)
|
||||
return noKey;
|
||||
|
||||
return _keyState[key.Hotkey] && key.Modifier1.IsActive() && key.Modifier2.IsActive();
|
||||
return _keyState[key.Hotkey] && key.Modifiers.IsActive();
|
||||
}
|
||||
|
||||
private float UpdateWidth()
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -14,12 +14,10 @@ using Glamourer.Interop.Penumbra;
|
|||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Custom;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
using Changelog = OtterGui.Widgets.Changelog;
|
||||
using Changelog = Luna.Changelog;
|
||||
using ITab = OtterGui.Widgets.ITab;
|
||||
using Window = Dalamud.Interface.Windowing.Window;
|
||||
|
||||
|
|
@ -53,7 +51,7 @@ public class MainWindow : Window, IDisposable
|
|||
private readonly TabSelected _event;
|
||||
private readonly MainWindowPosition _position;
|
||||
private readonly ITab[] _tabs;
|
||||
private bool _ignorePenumbra = false;
|
||||
private bool _ignorePenumbra;
|
||||
|
||||
public readonly SettingsTab Settings;
|
||||
public readonly ActorTab Actors;
|
||||
|
|
@ -208,13 +206,13 @@ public class MainWindow : Window, IDisposable
|
|||
var width = ImUtf8.CalcTextSize(SupportInfoButtonText).X + ImGui.GetStyle().FramePadding.X * 2;
|
||||
var xPos = ImGui.GetWindowWidth() - width;
|
||||
ImGui.SetCursorPos(new Vector2(xPos, 0));
|
||||
CustomGui.DrawDiscordButton(Glamourer.Messager, width);
|
||||
SupportButton.Discord(Glamourer.Messager, width);
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(xPos, ImGui.GetFrameHeightWithSpacing()));
|
||||
DrawSupportButton(glamourer);
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(xPos, 2 * ImGui.GetFrameHeightWithSpacing()));
|
||||
CustomGui.DrawGuideButton(Glamourer.Messager, width);
|
||||
SupportButton.ReniGuide(Glamourer.Messager, width);
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(xPos, 3 * ImGui.GetFrameHeightWithSpacing()));
|
||||
if (ImGui.Button("Show Changelogs", new Vector2(width, 0)))
|
||||
|
|
@ -270,7 +268,7 @@ public class MainWindow : Window, IDisposable
|
|||
|
||||
ImGui.NewLine();
|
||||
ImGui.NewLine();
|
||||
CustomGui.DrawDiscordButton(Glamourer.Messager, 0);
|
||||
SupportButton.Discord(Glamourer.Messager, 0);
|
||||
ImGui.SameLine();
|
||||
ImGui.NewLine();
|
||||
ImGui.NewLine();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ using Penumbra.GameData.Enums;
|
|||
using Penumbra.GameData.Files.MaterialStructs;
|
||||
using Penumbra.GameData.Interop;
|
||||
using Penumbra.String;
|
||||
using Notification = OtterGui.Classes.Notification;
|
||||
using Notification = Luna.Notification;
|
||||
|
||||
namespace Glamourer.Gui.Materials;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ using Glamourer.Gui.Materials;
|
|||
using Glamourer.Interop;
|
||||
using Glamourer.State;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Text.HelperObjects;
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
using Glamourer.Designs;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Widgets;
|
||||
using MouseWheelType = OtterGui.Widgets.MouseWheelType;
|
||||
|
||||
namespace Glamourer.Gui.Tabs.DesignTab;
|
||||
|
||||
public sealed class DesignColorCombo(DesignColors _designColors, bool _skipAutomatic) :
|
||||
FilterComboCache<string>(_skipAutomatic
|
||||
? _designColors.Keys.OrderBy(k => k)
|
||||
: _designColors.Keys.OrderBy(k => k).Prepend(DesignColors.AutomaticName),
|
||||
public sealed class DesignColorCombo(DesignColors designColors, bool skipAutomatic) :
|
||||
FilterComboCache<string>(skipAutomatic
|
||||
? designColors.Keys.OrderBy(k => k)
|
||||
: designColors.Keys.OrderBy(k => k).Prepend(DesignColors.AutomaticName),
|
||||
MouseWheelType.Control, Glamourer.Log)
|
||||
{
|
||||
protected override bool DrawSelectable(int globalIdx, bool selected)
|
||||
{
|
||||
var isAutomatic = !_skipAutomatic && globalIdx == 0;
|
||||
var isAutomatic = !skipAutomatic && globalIdx is 0;
|
||||
var key = Items[globalIdx];
|
||||
var color = isAutomatic ? 0 : _designColors[key];
|
||||
using var c = ImRaii.PushColor(ImGuiCol.Text, color, color != 0);
|
||||
var color = isAutomatic ? 0 : designColors[key];
|
||||
using var c = ImGuiColor.Text.Push(color, !color.IsTransparent);
|
||||
var ret = base.DrawSelectable(globalIdx, selected);
|
||||
if (isAutomatic)
|
||||
ImGuiUtil.HoverTooltip(
|
||||
|
|
|
|||
|
|
@ -3,11 +3,13 @@ using Dalamud.Interface.ImGuiNotification;
|
|||
using Glamourer.Designs;
|
||||
using Glamourer.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
using TagButtons = OtterGui.Widgets.TagButtons;
|
||||
|
||||
namespace Glamourer.Gui.Tabs.DesignTab;
|
||||
|
||||
|
|
@ -189,7 +191,8 @@ public class DesignDetailTab
|
|||
else if (_selector.Selected!.Color.Length != 0)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImUtf8.Icon(FontAwesomeIcon.ExclamationCircle, "The color associated with this design does not exist."u8, _colors.MissingColor);
|
||||
ImEx.Icon.Draw(LunaStyle.WarningIcon, _colors.MissingColor);
|
||||
Im.Tooltip.OnHover("The color associated with this design does not exist."u8);
|
||||
}
|
||||
|
||||
ImUtf8.DrawFrameColumn("Creation Date"u8);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Glamourer.Designs.History;
|
|||
using Glamourer.Events;
|
||||
using Glamourer.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Filesystem;
|
||||
|
|
@ -13,6 +14,7 @@ using OtterGui.FileSystem.Selector;
|
|||
using OtterGui.Log;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Luna;
|
||||
|
||||
namespace Glamourer.Gui.Tabs.DesignTab;
|
||||
|
||||
|
|
@ -43,7 +45,7 @@ public sealed class DesignFileSystemSelector : FileSystemSelector<Design, Design
|
|||
public new DesignFileSystem.Leaf? SelectedLeaf
|
||||
=> base.SelectedLeaf;
|
||||
|
||||
public record struct DesignState(uint Color)
|
||||
public record struct DesignState(Rgba32 Color)
|
||||
{ }
|
||||
|
||||
protected override float CurrentWidth
|
||||
|
|
@ -70,7 +72,7 @@ public sealed class DesignFileSystemSelector : FileSystemSelector<Design, Design
|
|||
}
|
||||
|
||||
public DesignFileSystemSelector(DesignManager designManager, DesignFileSystem fileSystem, IKeyState keyState, DesignChanged @event,
|
||||
Configuration config, DesignConverter converter, TabSelected selectionEvent, Logger log, DesignColors designColors,
|
||||
Configuration config, DesignConverter converter, TabSelected selectionEvent, OtterGui.Log.Logger log, DesignColors designColors,
|
||||
DesignApplier designApplier)
|
||||
: base(fileSystem, keyState, log, allowMultipleSelection: true)
|
||||
{
|
||||
|
|
@ -174,7 +176,7 @@ public sealed class DesignFileSystemSelector : FileSystemSelector<Design, Design
|
|||
{
|
||||
var flag = selected ? ImGuiTreeNodeFlags.Selected | LeafFlags : LeafFlags;
|
||||
var name = IncognitoMode ? leaf.Value.Incognito : leaf.Value.Name.Text;
|
||||
using var color = ImRaii.PushColor(ImGuiCol.Text, state.Color);
|
||||
using var color = ImGuiColor.Text.Push(state.Color);
|
||||
using var _ = ImUtf8.TreeNode(name, flag);
|
||||
if (_config.AllowDoubleClickToApply && ImGui.IsItemHovered() && ImGui.IsMouseDoubleClicked(ImGuiMouseButton.Left))
|
||||
_designApplier.ApplyToPlayer(leaf.Value);
|
||||
|
|
@ -271,7 +273,9 @@ public sealed class DesignFileSystemSelector : FileSystemSelector<Design, Design
|
|||
}
|
||||
|
||||
private void DeleteButton(Vector2 size)
|
||||
=> DeleteSelectionButton(size, _config.DeleteDesignModifier, "design", "designs", _designManager.Delete);
|
||||
=> DeleteSelectionButton(size,
|
||||
new OtterGui.Classes.DoubleModifier(new OtterGui.Classes.ModifierHotkey(_config.DeleteDesignModifier.Modifier1),
|
||||
new OtterGui.Classes.ModifierHotkey(_config.DeleteDesignModifier.Modifier2)), "design", "designs", _designManager.Delete);
|
||||
|
||||
private void DrawNewDesignPopup()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Glamourer.Automation;
|
|||
using Glamourer.Designs;
|
||||
using Glamourer.Designs.Links;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
|
|
@ -97,13 +98,13 @@ public class DesignLinkDrawer(
|
|||
var color = colorManager.GetColor(selector.Selected!);
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
using var c = ImRaii.PushColor(ImGuiCol.Text, color);
|
||||
using var c = ImGuiColor.Text.Push(color);
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGuiUtil.RightAlign(FontAwesomeIcon.ArrowRightLong.ToIconString());
|
||||
}
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, color))
|
||||
using (ImGuiColor.Text.Push(color))
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.Selectable(selector.IncognitoMode ? selector.Selected!.Incognito : selector.Selected!.Name.Text);
|
||||
|
|
@ -114,7 +115,7 @@ public class DesignLinkDrawer(
|
|||
ImGui.TableNextColumn();
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
using var c = ImRaii.PushColor(ImGuiCol.Text, color);
|
||||
using var c = ImGuiColor.Text.Push(color);
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.ArrowLeftLong.ToIconString());
|
||||
}
|
||||
|
|
@ -134,7 +135,7 @@ public class DesignLinkDrawer(
|
|||
var (design, flags) = list[i];
|
||||
ImGui.TableNextColumn();
|
||||
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, colorManager.GetColor(design)))
|
||||
using (ImGuiColor.Text.Push(colorManager.GetColor(design)))
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.Selectable(selector.IncognitoMode ? design.Incognito : design.Name.Text);
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ using Glamourer.Gui.Materials;
|
|||
using Glamourer.Interop;
|
||||
using Glamourer.State;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
|
|
|||
|
|
@ -1,30 +1,28 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Glamourer.Designs;
|
||||
using Glamourer.Interop;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Widgets;
|
||||
using Luna;
|
||||
|
||||
namespace Glamourer.Gui.Tabs.DesignTab;
|
||||
|
||||
public class DesignTab(DesignFileSystemSelector _selector, DesignPanel _panel, ImportService _importService, DesignManager _manager)
|
||||
: ITab
|
||||
public class DesignTab(DesignFileSystemSelector selector, DesignPanel panel, ImportService importService, DesignManager manager)
|
||||
: OtterGui.Widgets.ITab
|
||||
{
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Designs"u8;
|
||||
|
||||
public void DrawContent()
|
||||
{
|
||||
_selector.Draw();
|
||||
if (_importService.CreateCharaTarget(out var designBase, out var name))
|
||||
selector.Draw();
|
||||
if (importService.CreateCharaTarget(out var designBase, out var name))
|
||||
{
|
||||
var newDesign = _manager.CreateClone(designBase, name, true);
|
||||
var newDesign = manager.CreateClone(designBase, name, true);
|
||||
Glamourer.Messager.NotificationMessage($"Imported Anamnesis .chara file {name} as new design {newDesign.Name}", NotificationType.Success, false);
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
_panel.Draw();
|
||||
_importService.CreateCharaSource();
|
||||
panel.Draw();
|
||||
importService.CreateCharaSource();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Glamourer.Designs;
|
|||
using Glamourer.Interop.Penumbra;
|
||||
using Glamourer.State;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
using OtterGui.Classes;
|
||||
using OtterGui.Widgets;
|
||||
using Luna;
|
||||
using ITab = OtterGui.Widgets.ITab;
|
||||
|
||||
namespace Glamourer.Gui.Tabs;
|
||||
|
||||
public class MessagesTab : ITab
|
||||
public class MessagesTab(MessageService messages) : ITab
|
||||
{
|
||||
private readonly MessageService _messages;
|
||||
|
||||
public MessagesTab(MessageService messages)
|
||||
=> _messages = messages;
|
||||
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Messages"u8;
|
||||
|
||||
public bool IsVisible
|
||||
=> _messages.Count > 0;
|
||||
=> messages.Count > 0;
|
||||
|
||||
public void DrawContent()
|
||||
=> _messages.Draw();
|
||||
=> messages.DrawNotificationLog();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
using Glamourer.Designs;
|
||||
using Glamourer.GameData;
|
||||
using Glamourer.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ public class LocalNpcAppearanceData : ISavable
|
|||
public bool IsFavorite(in NpcData data)
|
||||
=> _data.TryGetValue(ToKey(data), out var tuple) && tuple.Favorite;
|
||||
|
||||
public (uint Color, bool Favorite) GetData(in NpcData data)
|
||||
public (Rgba32 Color, bool Favorite) GetData(in NpcData data)
|
||||
=> _data.TryGetValue(ToKey(data), out var t)
|
||||
? (GetColor(t.Color, t.Favorite, data.Kind), t.Favorite)
|
||||
: (GetColor(string.Empty, false, data.Kind), false);
|
||||
|
|
@ -34,7 +34,7 @@ public class LocalNpcAppearanceData : ISavable
|
|||
public string GetColor(in NpcData data)
|
||||
=> _data.TryGetValue(ToKey(data), out var t) ? t.Color : string.Empty;
|
||||
|
||||
private uint GetColor(string color, bool favorite, ObjectKind kind)
|
||||
private Rgba32 GetColor(string color, bool favorite, ObjectKind kind)
|
||||
{
|
||||
if (color.Length == 0)
|
||||
{
|
||||
|
|
@ -47,7 +47,7 @@ public class LocalNpcAppearanceData : ISavable
|
|||
}
|
||||
|
||||
if (_colors.TryGetValue(color, out var value))
|
||||
return value == 0 ? ImGui.GetColorU32(ImGuiCol.Text) : value;
|
||||
return value.IsTransparent ? Im.Color.Get(ImGuiColor.Text) : value;
|
||||
|
||||
return _colors.MissingColor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ using Glamourer.Gui.Equipment;
|
|||
using Glamourer.Gui.Tabs.DesignTab;
|
||||
using Glamourer.State;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using ImSharp;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
|
|
@ -279,12 +281,12 @@ public class NpcPanel
|
|||
if (DesignColorUi.DrawColorButton($"Color associated with {color}", currentColor, out var newColor))
|
||||
_colors.SetColor(color, newColor);
|
||||
}
|
||||
else if (color.Length != 0)
|
||||
else if (color.Length is not 0)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
var size = new Vector2(ImGui.GetFrameHeight());
|
||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||
ImGuiUtil.DrawTextButton(FontAwesomeIcon.ExclamationCircle.ToIconString(), size, 0, _colors.MissingColor);
|
||||
ImEx.TextFramed(LunaStyle.WarningIcon.Span, size, _colors.MissingColor);
|
||||
ImUtf8.HoverTooltip("The color associated with this design does not exist."u8);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Glamourer.GameData;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui;
|
||||
using ImSharp;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Raii;
|
||||
using ImGuiClip = OtterGui.ImGuiClip;
|
||||
|
|
@ -85,7 +85,7 @@ public class NpcSelector : IDisposable
|
|||
private void DrawSelectable(int globalIndex)
|
||||
{
|
||||
using var id = ImRaii.PushId(globalIndex);
|
||||
using var color = ImRaii.PushColor(ImGuiCol.Text, _favorites.GetData(_npcs[globalIndex]).Color);
|
||||
using var color = ImGuiColor.Text.Push(_favorites.GetData(_npcs[globalIndex]).Color);
|
||||
if (ImGui.Selectable(_npcs[globalIndex].Name, _selectedGlobalIndex == globalIndex, ImGuiSelectableFlags.AllowItemOverlap))
|
||||
_selectedGlobalIndex = globalIndex;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,10 +12,13 @@ using Glamourer.Interop;
|
|||
using Glamourer.Interop.PalettePlus;
|
||||
using Glamourer.Interop.Penumbra;
|
||||
using Glamourer.Services;
|
||||
using ImSharp;
|
||||
using Luna;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
using ITab = OtterGui.Widgets.ITab;
|
||||
|
||||
namespace Glamourer.Gui.Tabs.SettingsTab;
|
||||
|
||||
|
|
@ -194,9 +197,8 @@ public class SettingsTab(
|
|||
EphemeralCheckbox("Lock Quick Design Bar"u8, "Prevent the quick design bar from being moved and lock it in place."u8,
|
||||
config.Ephemeral.LockDesignQuickBar,
|
||||
v => config.Ephemeral.LockDesignQuickBar = v);
|
||||
if (Widget.ModifiableKeySelector("Hotkey to Toggle Quick Design Bar", "Set a hotkey that opens or closes the quick design bar.",
|
||||
100 * ImGuiHelpers.GlobalScale,
|
||||
config.ToggleQuickDesignBar, v => config.ToggleQuickDesignBar = v, _validKeys))
|
||||
if (KeySelector.ModifiableKeySelector("Hotkey to Toggle Quick Design Bar"u8, "Set a hotkey that opens or closes the quick design bar."u8,
|
||||
100 * ImGuiHelpers.GlobalScale, config.ToggleQuickDesignBar, v => config.ToggleQuickDesignBar = v, _validKeys))
|
||||
config.Save();
|
||||
|
||||
Checkbox("Show Quick Design Bar in Main Window"u8,
|
||||
|
|
@ -246,12 +248,12 @@ public class SettingsTab(
|
|||
Checkbox("Show Application Checkboxes"u8,
|
||||
"Show the application checkboxes in the Customization and Equipment panels of the design tab, instead of only showing them under Application Rules."u8,
|
||||
!config.HideApplyCheckmarks, v => config.HideApplyCheckmarks = !v);
|
||||
if (Widget.DoubleModifierSelector("Design Deletion Modifier",
|
||||
"A modifier you need to hold while clicking the Delete Design button for it to take effect.", 100 * ImGuiHelpers.GlobalScale,
|
||||
if (KeySelector.DoubleModifier("Design Deletion Modifier"u8,
|
||||
"A modifier you need to hold while clicking the Delete Design button for it to take effect."u8, 100 * ImGuiHelpers.GlobalScale,
|
||||
config.DeleteDesignModifier, v => config.DeleteDesignModifier = v))
|
||||
config.Save();
|
||||
if (Widget.DoubleModifierSelector("Incognito Modifier",
|
||||
"A modifier you need to hold while clicking the Incognito button for it to take effect.", 100 * ImGuiHelpers.GlobalScale,
|
||||
if (KeySelector.DoubleModifier("Incognito Modifier"u8,
|
||||
"A modifier you need to hold while clicking the Incognito button for it to take effect."u8, 100 * ImGuiHelpers.GlobalScale,
|
||||
config.IncognitoModifier, v => config.IncognitoModifier = v))
|
||||
config.Save();
|
||||
DrawRenameSettings();
|
||||
|
|
|
|||
|
|
@ -4,24 +4,24 @@ using Glamourer.Designs;
|
|||
using Glamourer.Interop.CharaFile;
|
||||
using Glamourer.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui.Classes;
|
||||
using Luna;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Files;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
||||
namespace Glamourer.Interop;
|
||||
|
||||
public class ImportService(CustomizeService _customizations, IDragDropManager _dragDropManager, ItemManager _items)
|
||||
public class ImportService(CustomizeService customizations, IDragDropManager dragDropManager, ItemManager items)
|
||||
{
|
||||
public void CreateDatSource()
|
||||
=> _dragDropManager.CreateImGuiSource("DatDragger", m => m.Files.Count == 1 && m.Extensions.Contains(".dat"), m =>
|
||||
=> dragDropManager.CreateImGuiSource("DatDragger", m => m.Files.Count == 1 && m.Extensions.Contains(".dat"), m =>
|
||||
{
|
||||
ImGui.TextUnformatted($"Dragging {Path.GetFileName(m.Files[0])} to import customizations for Glamourer...");
|
||||
return true;
|
||||
});
|
||||
|
||||
public void CreateCharaSource()
|
||||
=> _dragDropManager.CreateImGuiSource("CharaDragger", m => m.Files.Count == 1 && m.Extensions.Contains(".chara") || m.Extensions.Contains(".cma"), m =>
|
||||
=> dragDropManager.CreateImGuiSource("CharaDragger", m => m.Files.Count == 1 && m.Extensions.Contains(".chara") || m.Extensions.Contains(".cma"), m =>
|
||||
{
|
||||
ImGui.TextUnformatted($"Dragging {Path.GetFileName(m.Files[0])} to import Anamnesis/CMTool data for Glamourer...");
|
||||
return true;
|
||||
|
|
@ -29,7 +29,7 @@ public class ImportService(CustomizeService _customizations, IDragDropManager _d
|
|||
|
||||
public bool CreateDatTarget(out DatCharacterFile file)
|
||||
{
|
||||
if (!_dragDropManager.CreateImGuiTarget("DatDragger", out var files, out _) || files.Count != 1)
|
||||
if (!dragDropManager.CreateImGuiTarget("DatDragger", out var files, out _) || files.Count != 1)
|
||||
{
|
||||
file = default;
|
||||
return false;
|
||||
|
|
@ -40,7 +40,7 @@ public class ImportService(CustomizeService _customizations, IDragDropManager _d
|
|||
|
||||
public bool CreateCharaTarget([NotNullWhen(true)] out DesignBase? design, out string name)
|
||||
{
|
||||
if (!_dragDropManager.CreateImGuiTarget("CharaDragger", out var files, out _) || files.Count != 1)
|
||||
if (!dragDropManager.CreateImGuiTarget("CharaDragger", out var files, out _) || files.Count != 1)
|
||||
{
|
||||
design = null;
|
||||
name = string.Empty;
|
||||
|
|
@ -62,10 +62,10 @@ public class ImportService(CustomizeService _customizations, IDragDropManager _d
|
|||
try
|
||||
{
|
||||
var text = File.ReadAllText(path);
|
||||
var file = CharaFile.CharaFile.ParseData(_items, text, Path.GetFileNameWithoutExtension(path));
|
||||
var file = CharaFile.CharaFile.ParseData(items, text, Path.GetFileNameWithoutExtension(path));
|
||||
|
||||
name = file.Name;
|
||||
design = new DesignBase(_customizations, file.Data, file.ApplyEquip, file.ApplyCustomize, file.ApplyBonus);
|
||||
design = new DesignBase(customizations, file.Data, file.ApplyEquip, file.ApplyCustomize, file.ApplyBonus);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -90,12 +90,12 @@ public class ImportService(CustomizeService _customizations, IDragDropManager _d
|
|||
try
|
||||
{
|
||||
var text = File.ReadAllText(path);
|
||||
var file = CmaFile.ParseData(_items, text, Path.GetFileNameWithoutExtension(path));
|
||||
var file = CmaFile.ParseData(items, text, Path.GetFileNameWithoutExtension(path));
|
||||
if (file == null)
|
||||
throw new Exception();
|
||||
|
||||
name = file.Name;
|
||||
design = new DesignBase(_customizations, file.Data, EquipFlagExtensions.All, CustomizeFlagExtensions.AllRelevant, 0);
|
||||
design = new DesignBase(customizations, file.Data, EquipFlagExtensions.All, CustomizeFlagExtensions.AllRelevant, 0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -166,14 +166,14 @@ public class ImportService(CustomizeService _customizations, IDragDropManager _d
|
|||
public bool Verify(in CustomizeArray input, out byte voice, byte? inputVoice = null)
|
||||
{
|
||||
voice = 0;
|
||||
if (_customizations.ValidateClan(input.Clan, input.Race, out _, out _).Length > 0)
|
||||
if (customizations.ValidateClan(input.Clan, input.Race, out _, out _).Length > 0)
|
||||
return false;
|
||||
if (!_customizations.IsGenderValid(input.Race, input.Gender))
|
||||
if (!customizations.IsGenderValid(input.Race, input.Gender))
|
||||
return false;
|
||||
if (input.BodyType.Value != 1)
|
||||
return false;
|
||||
|
||||
var set = _customizations.Manager.GetSet(input.Clan, input.Gender);
|
||||
var set = customizations.Manager.GetSet(input.Clan, input.Gender);
|
||||
voice = set.Voices[0];
|
||||
if (inputVoice.HasValue && !set.Voices.Contains(inputVoice.Value))
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ using Dalamud.Plugin;
|
|||
using Dalamud.Plugin.Ipc.Exceptions;
|
||||
using Glamourer.Events;
|
||||
using Glamourer.State;
|
||||
using Luna;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Api.Helpers;
|
||||
using Penumbra.GameData.Interop;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using OtterGui.Extensions;
|
|||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.Interop;
|
||||
using Extensions = OtterGui.Filesystem.Extensions;
|
||||
using Notification = OtterGui.Classes.Notification;
|
||||
using Notification = Luna.Notification;
|
||||
|
||||
namespace Glamourer.Services;
|
||||
|
||||
|
|
@ -165,8 +165,7 @@ public sealed class CollectionOverrideService : IService, ISavable
|
|||
if (collection == null)
|
||||
{
|
||||
Glamourer.Messager.AddMessage(new Notification(
|
||||
$"The overridden collection for identifier {identifier.Incognito(null)} with name {collectionIdentifier} could not be found by Penumbra for migration.",
|
||||
NotificationType.Warning));
|
||||
$"The overridden collection for identifier {identifier.Incognito(null)} with name {collectionIdentifier} could not be found by Penumbra for migration."));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ using Penumbra.GameData.Interop;
|
|||
using Penumbra.GameData.Structs;
|
||||
using FrameworkManager = OtterGui.Classes.FrameworkManager;
|
||||
using Logger = OtterGui.Log.Logger;
|
||||
using MessageService = OtterGui.Classes.MessageService;
|
||||
using MessageService = Luna.MessageService;
|
||||
|
||||
namespace Glamourer.Services;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,11 @@ using Glamourer.GameData;
|
|||
using Glamourer.Gui;
|
||||
using Glamourer.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Extensions;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Interop;
|
||||
using Penumbra.GameData.Structs;
|
||||
using CustomizeIndex = Penumbra.GameData.Enums.CustomizeIndex;
|
||||
using Luna;
|
||||
|
||||
namespace Glamourer.State;
|
||||
|
||||
|
|
@ -290,7 +288,7 @@ public unsafe class FunModule : IDisposable
|
|||
switch (_codes.Masked(CodeService.GearCodes))
|
||||
{
|
||||
case CodeService.CodeFlag.Emperor:
|
||||
foreach (var (slot, idx) in EquipSlotExtensions.EqdpSlots.WithIndex())
|
||||
foreach (var (idx, slot) in EquipSlotExtensions.EqdpSlots.Index())
|
||||
SetRandomItem(slot, ref armor[idx]);
|
||||
break;
|
||||
case CodeService.CodeFlag.Elephants:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Glamourer.Services;
|
||||
using Luna;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Dalamud.Interface.ImGuiNotification;
|
||||
using OtterGui.Classes;
|
||||
using Luna;
|
||||
|
||||
namespace Glamourer.Unlocks;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue