mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-01-02 05:43:42 +01:00
Fix design color display on customizations.
This commit is contained in:
parent
108cfbd828
commit
8f60688e44
2 changed files with 18 additions and 14 deletions
|
|
@ -40,7 +40,7 @@ public unsafe struct DesignData
|
||||||
public DesignData()
|
public DesignData()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public bool ContainsName(LowerString name)
|
public readonly bool ContainsName(LowerString name)
|
||||||
=> name.IsContained(_nameHead)
|
=> name.IsContained(_nameHead)
|
||||||
|| name.IsContained(_nameBody)
|
|| name.IsContained(_nameBody)
|
||||||
|| name.IsContained(_nameHands)
|
|| name.IsContained(_nameHands)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using Dalamud.Plugin.Services;
|
||||||
using Glamourer.Customization;
|
using Glamourer.Customization;
|
||||||
using Glamourer.Designs;
|
using Glamourer.Designs;
|
||||||
using Glamourer.Events;
|
using Glamourer.Events;
|
||||||
|
using Glamourer.Services;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Classes;
|
using OtterGui.Classes;
|
||||||
|
|
@ -19,11 +20,12 @@ namespace Glamourer.Gui.Tabs.DesignTab;
|
||||||
|
|
||||||
public sealed class DesignFileSystemSelector : FileSystemSelector<Design, DesignFileSystemSelector.DesignState>
|
public sealed class DesignFileSystemSelector : FileSystemSelector<Design, DesignFileSystemSelector.DesignState>
|
||||||
{
|
{
|
||||||
private readonly DesignManager _designManager;
|
private readonly DesignManager _designManager;
|
||||||
private readonly DesignChanged _event;
|
private readonly DesignChanged _event;
|
||||||
private readonly Configuration _config;
|
private readonly Configuration _config;
|
||||||
private readonly DesignConverter _converter;
|
private readonly DesignConverter _converter;
|
||||||
private readonly TabSelected _selectionEvent;
|
private readonly TabSelected _selectionEvent;
|
||||||
|
private readonly CustomizationService _customizationService;
|
||||||
|
|
||||||
private string? _clipboardText;
|
private string? _clipboardText;
|
||||||
private Design? _cloneDesign;
|
private Design? _cloneDesign;
|
||||||
|
|
@ -48,14 +50,15 @@ public sealed class DesignFileSystemSelector : FileSystemSelector<Design, Design
|
||||||
}
|
}
|
||||||
|
|
||||||
public DesignFileSystemSelector(DesignManager designManager, DesignFileSystem fileSystem, IKeyState keyState, DesignChanged @event,
|
public DesignFileSystemSelector(DesignManager designManager, DesignFileSystem fileSystem, IKeyState keyState, DesignChanged @event,
|
||||||
Configuration config, DesignConverter converter, TabSelected selectionEvent, Logger log)
|
Configuration config, DesignConverter converter, TabSelected selectionEvent, Logger log, CustomizationService customizationService)
|
||||||
: base(fileSystem, keyState, log, allowMultipleSelection: true)
|
: base(fileSystem, keyState, log, allowMultipleSelection: true)
|
||||||
{
|
{
|
||||||
_designManager = designManager;
|
_designManager = designManager;
|
||||||
_event = @event;
|
_event = @event;
|
||||||
_config = config;
|
_config = config;
|
||||||
_converter = converter;
|
_converter = converter;
|
||||||
_selectionEvent = selectionEvent;
|
_selectionEvent = selectionEvent;
|
||||||
|
_customizationService = customizationService;
|
||||||
_event.Subscribe(OnDesignChange, DesignChanged.Priority.DesignFileSystemSelector);
|
_event.Subscribe(OnDesignChange, DesignChanged.Priority.DesignFileSystemSelector);
|
||||||
_selectionEvent.Subscribe(OnTabSelected, TabSelected.Priority.DesignSelector);
|
_selectionEvent.Subscribe(OnTabSelected, TabSelected.Priority.DesignSelector);
|
||||||
|
|
||||||
|
|
@ -271,8 +274,9 @@ public sealed class DesignFileSystemSelector : FileSystemSelector<Design, Design
|
||||||
/// <summary> Combined wrapper for handling all filters and setting state. </summary>
|
/// <summary> Combined wrapper for handling all filters and setting state. </summary>
|
||||||
private bool ApplyFiltersAndState(DesignFileSystem.Leaf leaf, out DesignState state)
|
private bool ApplyFiltersAndState(DesignFileSystem.Leaf leaf, out DesignState state)
|
||||||
{
|
{
|
||||||
var applyEquip = leaf.Value.ApplyEquip != 0;
|
var applyEquip = leaf.Value.ApplyEquip != 0;
|
||||||
var applyCustomize = (leaf.Value.ApplyCustomize & ~(CustomizeFlag.BodyType | CustomizeFlag.Race)) != 0;
|
var list = _customizationService.AwaitedService.GetList(leaf.Value.DesignData.Customize.Clan, leaf.Value.DesignData.Customize.Gender);
|
||||||
|
var applyCustomize = leaf.Value.ApplyCustomize.FixApplication(list) != 0;
|
||||||
|
|
||||||
state.Color = (applyEquip, applyCustomize) switch
|
state.Color = (applyEquip, applyCustomize) switch
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue