Rework and improve CustomizationManager and stuff.

This commit is contained in:
Ottermandias 2023-12-23 19:33:50 +01:00
parent aae4141550
commit ab76d3508b
34 changed files with 916 additions and 1025 deletions

View file

@ -27,7 +27,7 @@ public unsafe class FunModule : IDisposable
private readonly WorldSets _worldSets = new();
private readonly ItemManager _items;
private readonly CustomizationService _customizations;
private readonly CustomizeService _customizations;
private readonly Configuration _config;
private readonly CodeService _codes;
private readonly Random _rng;
@ -67,7 +67,7 @@ public unsafe class FunModule : IDisposable
internal void ResetFestival()
=> OnDayChange(DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year);
public FunModule(CodeService codes, CustomizationService customizations, ItemManager items, Configuration config,
public FunModule(CodeService codes, CustomizeService customizations, ItemManager items, Configuration config,
GenericPopupWindow popupWindow, StateManager stateManager, ObjectManager objects, DesignConverter designConverter,
DesignManager designManager)
{
@ -197,7 +197,7 @@ public unsafe class FunModule : IDisposable
if (!_codes.EnabledIndividual)
return;
var set = _customizations.Service.GetList(customize.Clan, customize.Gender);
var set = _customizations.Manager.GetSet(customize.Clan, customize.Gender);
foreach (var index in Enum.GetValues<CustomizeIndex>())
{
if (index is CustomizeIndex.Face || !set.IsAvailable(index))

View file

@ -12,12 +12,12 @@ namespace Glamourer.State;
public class StateEditor
{
private readonly ItemManager _items;
private readonly CustomizationService _customizations;
private readonly CustomizeService _customizations;
private readonly HumanModelList _humans;
private readonly GPoseService _gPose;
private readonly ICondition _condition;
public StateEditor(CustomizationService customizations, HumanModelList humans, ItemManager items, GPoseService gPose, ICondition condition)
public StateEditor(CustomizeService customizations, HumanModelList humans, ItemManager items, GPoseService gPose, ICondition condition)
{
_customizations = customizations;
_humans = humans;
@ -72,7 +72,7 @@ public class StateEditor
state[CustomizeIndex.Clan] = source;
state[CustomizeIndex.Gender] = source;
var set = _customizations.Service.GetList(state.ModelData.Customize.Clan, state.ModelData.Customize.Gender);
var set = _customizations.Manager.GetSet(state.ModelData.Customize.Clan, state.ModelData.Customize.Gender);
foreach (var index in Enum.GetValues<CustomizeIndex>().Where(set.IsAvailable))
state[index] = source;
}

View file

@ -28,7 +28,7 @@ public class StateListener : IDisposable
private readonly StateManager _manager;
private readonly StateApplier _applier;
private readonly ItemManager _items;
private readonly CustomizationService _customizations;
private readonly CustomizeService _customizations;
private readonly PenumbraService _penumbra;
private readonly SlotUpdating _slotUpdating;
private readonly WeaponLoading _weaponLoading;
@ -52,7 +52,7 @@ public class StateListener : IDisposable
SlotUpdating slotUpdating, WeaponLoading weaponLoading, VisorStateChanged visorState, WeaponVisibilityChanged weaponVisibility,
HeadGearVisibilityChanged headGearVisibility, AutoDesignApplier autoDesignApplier, FunModule funModule, HumanModelList humans,
StateApplier applier, MovedEquipment movedEquipment, ObjectManager objects, GPoseService gPose,
ChangeCustomizeService changeCustomizeService, CustomizationService customizations, ICondition condition, CrestService crestService)
ChangeCustomizeService changeCustomizeService, CustomizeService customizations, ICondition condition, CrestService crestService)
{
_manager = manager;
_items = items;
@ -167,7 +167,7 @@ public class StateListener : IDisposable
return;
}
var set = _customizations.Service.GetList(model.Clan, model.Gender);
var set = _customizations.Manager.GetSet(model.Clan, model.Gender);
foreach (var index in CustomizationExtensions.AllBasic)
{
if (state[index] is not StateChanged.Source.Fixed)