Fix design coloring and Apply All Customization display.

This commit is contained in:
Ottermandias 2023-12-29 18:37:46 +01:00
parent 53388739ca
commit 24c3a52f6a
3 changed files with 8 additions and 5 deletions

View file

@ -74,9 +74,12 @@ public class DesignBase
internal CustomizeFlag ApplyCustomize
{
get => _applyCustomize.FixApplication(CustomizeSet);
set => _applyCustomize = value & CustomizeFlagExtensions.AllRelevant;
set => _applyCustomize = (value & CustomizeFlagExtensions.AllRelevant) | CustomizeFlag.BodyType;
}
internal CustomizeFlag ApplyCustomizeExcludingBodyType
=> _applyCustomize.FixApplication(CustomizeSet) & ~CustomizeFlag.BodyType;
internal CustomizeFlag ApplyCustomizeRaw
=> _applyCustomize;

View file

@ -282,7 +282,7 @@ public class DesignColors : ISavable, IReadOnlyDictionary<string, uint>
public static uint AutoColor(DesignBase design)
{
var customize = design.ApplyCustomize == 0;
var customize = design.ApplyCustomizeExcludingBodyType == 0;
var equip = design.ApplyEquip == 0;
return (customize, equip) switch
{

View file

@ -154,9 +154,9 @@ public class DesignPanel(DesignFileSystemSelector _selector, CustomizationDrawer
private void DrawCustomizeApplication()
{
var set = _selector.Selected!.CustomizeSet;
var available = set.SettingAvailable | CustomizeFlag.Clan | CustomizeFlag.Gender;
var flags = _selector.Selected!.ApplyCustomize == 0 ? 0 : (_selector.Selected!.ApplyCustomize & available) == available ? 3 : 1;
var set = _selector.Selected!.CustomizeSet;
var available = set.SettingAvailable | CustomizeFlag.Clan | CustomizeFlag.Gender | CustomizeFlag.BodyType;
var flags = _selector.Selected!.ApplyCustomizeExcludingBodyType == 0 ? 0 : (_selector.Selected!.ApplyCustomize & available) == available ? 3 : 1;
if (ImGui.CheckboxFlags("Apply All Customizations", ref flags, 3))
{
var newFlags = flags == 3;