mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-15 20:17:42 +01:00
Add toggle for always applying mod associations.
This commit is contained in:
parent
818bf71032
commit
d10043a69a
6 changed files with 84 additions and 21 deletions
|
|
@ -2,6 +2,7 @@ using Glamourer.Designs;
|
|||
using Glamourer.Designs.Links;
|
||||
using Glamourer.Events;
|
||||
using Glamourer.GameData;
|
||||
using Glamourer.Interop.Penumbra;
|
||||
using Glamourer.Interop.Structs;
|
||||
using Glamourer.Services;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
|
@ -16,7 +17,8 @@ public class StateEditor(
|
|||
JobChangeState jobChange,
|
||||
Configuration config,
|
||||
ItemManager items,
|
||||
DesignMerger merger) : IDesignEditor
|
||||
DesignMerger merger,
|
||||
ModSettingApplier modApplier) : IDesignEditor
|
||||
{
|
||||
protected readonly InternalStateEditor Editor = editor;
|
||||
protected readonly StateApplier Applier = applier;
|
||||
|
|
@ -181,6 +183,7 @@ public class StateEditor(
|
|||
public void ApplyDesign(object data, MergedDesign mergedDesign, ApplySettings settings)
|
||||
{
|
||||
var state = (ActorState)data;
|
||||
modApplier.HandleStateApplication(state, mergedDesign);
|
||||
if (!Editor.ChangeModelId(state, mergedDesign.Design.DesignData.ModelId, mergedDesign.Design.DesignData.Customize,
|
||||
mergedDesign.Design.GetDesignDataRef().GetEquipmentPtr(), settings.Source, out var oldModelId, settings.Key))
|
||||
return;
|
||||
|
|
@ -294,7 +297,7 @@ public class StateEditor(
|
|||
public void ApplyDesign(object data, DesignBase design, ApplySettings settings)
|
||||
{
|
||||
var merged = settings.MergeLinks && design is Design d
|
||||
? merger.Merge(d.AllLinks, ((ActorState)data).ModelData, false, false)
|
||||
? merger.Merge(d.AllLinks, ((ActorState)data).ModelData, false, Config.AlwaysApplyAssociatedMods)
|
||||
: new MergedDesign(design);
|
||||
|
||||
ApplyDesign(data, merged, settings with
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Glamourer.Designs.Links;
|
|||
using Glamourer.Events;
|
||||
using Glamourer.GameData;
|
||||
using Glamourer.Interop;
|
||||
using Glamourer.Interop.Penumbra;
|
||||
using Glamourer.Interop.Structs;
|
||||
using Glamourer.Services;
|
||||
using Penumbra.GameData.Actors;
|
||||
|
|
@ -23,8 +24,9 @@ public sealed class StateManager(
|
|||
IClientState _clientState,
|
||||
Configuration config,
|
||||
JobChangeState jobChange,
|
||||
DesignMerger merger)
|
||||
: StateEditor(editor, applier, @event, jobChange, config, items, merger), IReadOnlyDictionary<ActorIdentifier, ActorState>
|
||||
DesignMerger merger,
|
||||
ModSettingApplier modApplier)
|
||||
: StateEditor(editor, applier, @event, jobChange, config, items, merger, modApplier), IReadOnlyDictionary<ActorIdentifier, ActorState>
|
||||
{
|
||||
private readonly Dictionary<ActorIdentifier, ActorState> _states = [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue