mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Update gamedata and services.
This commit is contained in:
parent
36d95c37bc
commit
a982c0a1c1
74 changed files with 907 additions and 960 deletions
|
|
@ -7,13 +7,13 @@ using Glamourer.Interop.Structs;
|
|||
using Glamourer.Services;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using System;
|
||||
using Dalamud.Game.ClientState.Conditions;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Glamourer.Structs;
|
||||
using Penumbra.GameData.DataContainers;
|
||||
|
||||
namespace Glamourer.State;
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ namespace Glamourer.State;
|
|||
public class StateListener : IDisposable
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly ActorService _actors;
|
||||
private readonly ActorManager _actors;
|
||||
private readonly ObjectManager _objects;
|
||||
private readonly StateManager _manager;
|
||||
private readonly StateApplier _applier;
|
||||
|
|
@ -50,7 +50,7 @@ public class StateListener : IDisposable
|
|||
private ActorState? _creatingState;
|
||||
private CharacterWeapon _lastFistOffhand = CharacterWeapon.Empty;
|
||||
|
||||
public StateListener(StateManager manager, ItemManager items, PenumbraService penumbra, ActorService actors, Configuration config,
|
||||
public StateListener(StateManager manager, ItemManager items, PenumbraService penumbra, ActorManager actors, Configuration config,
|
||||
SlotUpdating slotUpdating, WeaponLoading weaponLoading, VisorStateChanged visorState, WeaponVisibilityChanged weaponVisibility,
|
||||
HeadGearVisibilityChanged headGearVisibility, AutoDesignApplier autoDesignApplier, FunModule funModule, HumanModelList humans,
|
||||
StateApplier applier, MovedEquipment movedEquipment, ObjectManager objects, GPoseService gPose,
|
||||
|
|
@ -111,7 +111,7 @@ public class StateListener : IDisposable
|
|||
if (_condition[ConditionFlag.CreatingCharacter] && actor.Index >= ObjectIndex.CutsceneStart)
|
||||
return;
|
||||
|
||||
_creatingIdentifier = actor.GetIdentifier(_actors.AwaitedService);
|
||||
_creatingIdentifier = actor.GetIdentifier(_actors);
|
||||
|
||||
ref var modelId = ref *(uint*)modelPtr;
|
||||
ref var customize = ref *(Customize*)customizePtr;
|
||||
|
|
@ -149,7 +149,7 @@ public class StateListener : IDisposable
|
|||
if (_condition[ConditionFlag.CreatingCharacter] && actor.Index >= ObjectIndex.CutsceneStart)
|
||||
return;
|
||||
|
||||
if (!actor.Identifier(_actors.AwaitedService, out var identifier)
|
||||
if (!actor.Identifier(_actors, out var identifier)
|
||||
|| !_manager.TryGetValue(identifier, out var state))
|
||||
return;
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ public class StateListener : IDisposable
|
|||
return;
|
||||
}
|
||||
|
||||
var set = _customizations.AwaitedService.GetList(model.Clan, model.Gender);
|
||||
var set = _customizations.Service.GetList(model.Clan, model.Gender);
|
||||
foreach (var index in CustomizationExtensions.AllBasic)
|
||||
{
|
||||
if (state[index] is not StateChanged.Source.Fixed)
|
||||
|
|
@ -211,7 +211,7 @@ public class StateListener : IDisposable
|
|||
// then we do not want to use our restricted gear protection
|
||||
// since we assume the player has that gear modded to availability.
|
||||
var locked = false;
|
||||
if (actor.Identifier(_actors.AwaitedService, out var identifier)
|
||||
if (actor.Identifier(_actors, out var identifier)
|
||||
&& _manager.TryGetValue(identifier, out var state))
|
||||
{
|
||||
HandleEquipSlot(actor, state, slot, ref armor.Value);
|
||||
|
|
@ -238,7 +238,7 @@ public class StateListener : IDisposable
|
|||
var currentItem = state.BaseData.Item(slot);
|
||||
var model = state.ModelData.Weapon(slot);
|
||||
var current = currentItem.Weapon(state.BaseData.Stain(slot));
|
||||
if (model.Value == current.Value || !_items.ItemService.AwaitedService.TryGetValue(item, EquipSlot.MainHand, out var changedItem))
|
||||
if (model.Value == current.Value || !_items.ItemData.TryGetValue(item, EquipSlot.MainHand, out var changedItem))
|
||||
continue;
|
||||
|
||||
var changed = changedItem.Weapon(stain);
|
||||
|
|
@ -272,10 +272,10 @@ public class StateListener : IDisposable
|
|||
return;
|
||||
|
||||
// Fist weapon gauntlet hack.
|
||||
if (slot is EquipSlot.OffHand && weapon.Value.Variant == 0 && weapon.Value.Set.Id != 0 && _lastFistOffhand.Set.Id != 0)
|
||||
if (slot is EquipSlot.OffHand && weapon.Value.Variant == 0 && weapon.Value.Y.Id != 0 && _lastFistOffhand.Y.Id != 0)
|
||||
weapon.Value = _lastFistOffhand;
|
||||
|
||||
if (!actor.Identifier(_actors.AwaitedService, out var identifier)
|
||||
if (!actor.Identifier(_actors, out var identifier)
|
||||
|| !_manager.TryGetValue(identifier, out var state))
|
||||
return;
|
||||
|
||||
|
|
@ -308,13 +308,13 @@ public class StateListener : IDisposable
|
|||
var newWeapon = state.ModelData.Weapon(slot);
|
||||
if (baseType is FullEquipType.Unknown || baseType == state.ModelData.Item(slot).Type || _gPose.InGPose && actor.IsGPoseOrCutscene)
|
||||
actorWeapon = newWeapon;
|
||||
else if (actorWeapon.Set.Id != 0)
|
||||
else if (actorWeapon.X.Id != 0)
|
||||
actorWeapon = actorWeapon.With(newWeapon.Stain);
|
||||
}
|
||||
|
||||
// Fist Weapon Offhand hack.
|
||||
if (slot is EquipSlot.MainHand && weapon.Value.Set.Id is > 1600 and < 1651)
|
||||
_lastFistOffhand = new CharacterWeapon((SetId)(weapon.Value.Set.Id + 50), weapon.Value.Type, weapon.Value.Variant,
|
||||
if (slot is EquipSlot.MainHand && weapon.Value.X.Id is > 1600 and < 1651)
|
||||
_lastFistOffhand = new CharacterWeapon((PrimaryId)(weapon.Value.X.Id + 50), weapon.Value.Y, weapon.Value.Variant,
|
||||
weapon.Value.Stain);
|
||||
|
||||
_funModule.ApplyFun(actor, ref weapon.Value, slot);
|
||||
|
|
@ -329,7 +329,7 @@ public class StateListener : IDisposable
|
|||
return false;
|
||||
|
||||
var offhand = actor.GetOffhand();
|
||||
return offhand.Variant == 0 && offhand.Set.Id != 0 && armor.Set.Id == offhand.Set.Id;
|
||||
return offhand.Variant == 0 && offhand.Y.Id != 0 && armor.Set.Id == offhand.Y.Id;
|
||||
}
|
||||
|
||||
var actorArmor = actor.GetArmor(slot);
|
||||
|
|
@ -413,7 +413,7 @@ public class StateListener : IDisposable
|
|||
if (_condition[ConditionFlag.CreatingCharacter] && actor.Index >= ObjectIndex.CutsceneStart)
|
||||
return;
|
||||
|
||||
if (!actor.Identifier(_actors.AwaitedService, out var identifier)
|
||||
if (!actor.Identifier(_actors, out var identifier)
|
||||
|| !_manager.TryGetValue(identifier, out var state))
|
||||
return;
|
||||
|
||||
|
|
@ -439,7 +439,7 @@ public class StateListener : IDisposable
|
|||
if (_condition[ConditionFlag.CreatingCharacter] && actor.Index >= ObjectIndex.CutsceneStart)
|
||||
return;
|
||||
|
||||
if (!actor.Identifier(_actors.AwaitedService, out var identifier)
|
||||
if (!actor.Identifier(_actors, out var identifier)
|
||||
|| !_manager.TryGetValue(identifier, out var state))
|
||||
return;
|
||||
|
||||
|
|
@ -474,7 +474,7 @@ public class StateListener : IDisposable
|
|||
var change = UpdateState.NoChange;
|
||||
|
||||
// Fist weapon bug hack
|
||||
if (slot is EquipSlot.OffHand && weapon.Value == 0 && actor.GetMainhand().Set.Id is > 1600 and < 1651)
|
||||
if (slot is EquipSlot.OffHand && weapon.Value == 0 && actor.GetMainhand().X.Id is > 1600 and < 1651)
|
||||
return UpdateState.NoChange;
|
||||
|
||||
if (baseData.Stain != weapon.Stain)
|
||||
|
|
@ -483,9 +483,9 @@ public class StateListener : IDisposable
|
|||
change = UpdateState.Change;
|
||||
}
|
||||
|
||||
if (baseData.Set.Id != weapon.Set.Id || baseData.Type.Id != weapon.Type.Id || baseData.Variant != weapon.Variant)
|
||||
if (baseData.X.Id != weapon.X.Id || baseData.Y.Id != weapon.Y.Id || baseData.Variant != weapon.Variant)
|
||||
{
|
||||
var item = _items.Identify(slot, weapon.Set, weapon.Type, weapon.Variant,
|
||||
var item = _items.Identify(slot, weapon.X, weapon.Y, weapon.Variant,
|
||||
slot is EquipSlot.OffHand ? state.BaseData.Item(EquipSlot.MainHand).Type : FullEquipType.Unknown);
|
||||
state.BaseData.SetItem(slot, item);
|
||||
change = UpdateState.Change;
|
||||
|
|
@ -555,7 +555,7 @@ public class StateListener : IDisposable
|
|||
if (_condition[ConditionFlag.CreatingCharacter] && actor.Index >= ObjectIndex.CutsceneStart)
|
||||
return;
|
||||
|
||||
if (!actor.Identifier(_actors.AwaitedService, out var identifier))
|
||||
if (!actor.Identifier(_actors, out var identifier))
|
||||
return;
|
||||
|
||||
if (!_manager.TryGetValue(identifier, out var state))
|
||||
|
|
@ -588,7 +588,7 @@ public class StateListener : IDisposable
|
|||
// We do not need to handle fixed designs,
|
||||
// if there is no model that caused a fixed design to exist yet,
|
||||
// we also do not care about the invisible model.
|
||||
if (!actor.Identifier(_actors.AwaitedService, out var identifier))
|
||||
if (!actor.Identifier(_actors, out var identifier))
|
||||
return;
|
||||
|
||||
if (!_manager.TryGetValue(identifier, out var state))
|
||||
|
|
@ -621,7 +621,7 @@ public class StateListener : IDisposable
|
|||
// We do not need to handle fixed designs,
|
||||
// if there is no model that caused a fixed design to exist yet,
|
||||
// we also do not care about the invisible model.
|
||||
if (!actor.Identifier(_actors.AwaitedService, out var identifier))
|
||||
if (!actor.Identifier(_actors, out var identifier))
|
||||
return;
|
||||
|
||||
if (!_manager.TryGetValue(identifier, out var state))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue