using System; using Glamourer.Interop.Structs; using Glamourer.State; using OtterGui.Classes; using Penumbra.GameData.Actors; namespace Glamourer.Events; /// /// Triggered when a Design is edited in any way. /// /// Parameter is the type of the change /// Parameter is the changed saved state. /// Parameter is the existing actors using this saved state. /// Parameter is any additional data depending on the type of change. /// /// public sealed class StateChanged : EventWrapper, StateChanged.Priority> { public enum Type { /// A characters saved state had the model id changed. This means everything may have changed. Data is the old model id and the new model id. [(uint, uint)] Model, /// A characters saved state had multiple customization values changed. TData is the old customize array and the applied changes. [(Customize, CustomizeFlag)] EntireCustomize, /// A characters saved state had a customization value changed. Data is the old value, the new value and the type. [(CustomizeValue, CustomizeValue, CustomizeIndex)]. Customize, /// A characters saved state had an equipment piece changed. Data is the old value, the new value and the slot [(EquipItem, EquipItem, EquipSlot)]. Equip, /// A characters saved state had its weapons changed. Data is the old mainhand, the old offhand, the new mainhand and the new offhand [(EquipItem, EquipItem, EquipItem, EquipItem)]. Weapon, /// A characters saved state had a stain changed. Data is the old stain id, the new stain id and the slot [(StainId, StainId, EquipSlot)]. Stain, /// A characters saved state had a design applied. This means everything may have changed. Data is the applied design. [DesignBase] Design, /// A characters saved state had its state reset to its game values. This means everything may have changed. Data is null. Reset, /// A characters saved state had a meta toggle changed. Data is the old stain id, the new stain id and the slot [(StainId, StainId, EquipSlot)]. Other, } public enum Source : byte { Game, Manual, Fixed, Ipc, } public enum Priority { } public StateChanged() : base(nameof(StateChanged)) { } public void Invoke(Type type, Source source, ActorState state, ActorData actors, object? data = null) => Invoke(this, type, source, state, actors, data); }