Remove some warnings.

This commit is contained in:
Ottermandias 2024-08-04 12:38:38 +02:00
parent 34caf29b32
commit f69915dcb3
3 changed files with 14 additions and 9 deletions

View file

@ -70,6 +70,9 @@ public sealed class DesignQuickBar : Window, IDisposable
IsOpen = _config.Ephemeral.ShowDesignQuickBar && _config.QdbButtons != 0;
}
public override bool DrawConditions()
=> _objects.Player.Valid;
public override void PreDraw()
{
Flags = GetFlags;

View file

@ -40,7 +40,7 @@ public class ObjectManager(
return false;
_identifierUpdate = LastUpdate;
World = (ushort)(this[0].Valid ? this[0].HomeWorld : 0);
World = (ushort)(Player.Valid ? Player.HomeWorld : 0);
_identifiers.Clear();
_allWorldIdentifiers.Clear();
_nonOwnedIdentifiers.Clear();

View file

@ -6,6 +6,7 @@ using Dalamud.Utility.Signatures;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using Glamourer.GameData;
using Glamourer.Events;
using Glamourer.Interop;
using Glamourer.Services;
using Lumina.Excel.GeneratedSheets;
using Penumbra.GameData;
@ -18,7 +19,7 @@ public class CustomizeUnlockManager : IDisposable, ISavable
private readonly SaveService _saveService;
private readonly IClientState _clientState;
private readonly ObjectUnlocked _event;
private readonly ObjectManager _objects;
private readonly Dictionary<uint, long> _unlocked = new();
public readonly IReadOnlyDictionary<CustomizeData, (uint Data, string Name)> Unlockable;
@ -27,12 +28,13 @@ public class CustomizeUnlockManager : IDisposable, ISavable
=> _unlocked;
public CustomizeUnlockManager(SaveService saveService, CustomizeService customizations, IDataManager gameData,
IClientState clientState, ObjectUnlocked @event, IGameInteropProvider interop)
IClientState clientState, ObjectUnlocked @event, IGameInteropProvider interop, ObjectManager objects)
{
interop.InitializeFromAttributes(this);
_saveService = saveService;
_clientState = clientState;
_event = @event;
_objects = objects;
Unlockable = CreateUnlockableCustomizations(customizations, gameData);
Load();
_setUnlockLinkValueHook.Enable();
@ -94,7 +96,7 @@ public class CustomizeUnlockManager : IDisposable, ISavable
/// <summary> Scan and update all unlockable customizations for their current game state. </summary>
public unsafe void Scan()
{
if (_clientState.LocalPlayer == null)
if (!_objects.Player.Valid)
return;
Glamourer.Log.Debug("[UnlockManager] Scanning for new unlocked customizations.");