From 7a0ee537565a32ac331ddadd02acc9a83a145491 Mon Sep 17 00:00:00 2001
From: RisaDev <151885272+RisaDev@users.noreply.github.com>
Date: Tue, 8 Oct 2024 00:32:58 +0300
Subject: [PATCH] Hopefully this doesn't break anything, I can't test this
properly on my free trial account
Removed "Limit to my creatures", the code now automatically detects this for all owned actors. If you liked to apply edits to minions and stuff of other players... too bad.
Implemented UI for setting profiles to NPC, minions and mounts (still WIP, will probably have to implement multiple characters per profile)
---
.../Extensions/ActorIdentifierExtensions.cs | 29 ++++++
CustomizePlus/Api/Data/IPCCharacterProfile.cs | 1 -
.../Armatures/Services/ArmatureManager.cs | 23 +----
.../Helpers/V3ProfileToV4Converter.cs | 1 -
CustomizePlus/Core/ServiceManagerBuilder.cs | 3 +-
.../Core/Services/SupportLogBuilderService.cs | 1 -
CustomizePlus/Profiles/Data/Profile.cs | 4 +-
.../Profiles/Events/ProfileChanged.cs | 1 -
.../Profiles/ProfileManager.ProfileLoading.cs | 1 -
CustomizePlus/Profiles/ProfileManager.cs | 41 ++++-----
.../Templates/Events/TemplateChanged.cs | 1 -
.../Templates/TemplateEditorManager.cs | 12 ---
.../UI/Windows/Controls/ActorAssignmentUi.cs | 88 ++++++-------------
.../Tabs/Debug/StateMonitoringTab.cs | 1 -
.../Profiles/ProfileFileSystemSelector.cs | 5 +-
.../MainWindow/Tabs/Profiles/ProfilePanel.cs | 80 ++++++-----------
.../Tabs/Templates/BoneEditorPanel.cs | 65 +++++++-------
17 files changed, 141 insertions(+), 216 deletions(-)
diff --git a/CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs b/CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs
index 122d125..8e3d834 100644
--- a/CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs
+++ b/CustomizePlus.GameData/Extensions/ActorIdentifierExtensions.cs
@@ -28,6 +28,35 @@ public static class ActorIdentifierExtensions
return PenumbraExtensions.Manager.Data.ToName(identifier.Kind, identifier.DataId);
}
+ ///
+ /// Compares two actor identifiers while ignoring ownership for owned objects. For all other identifier types will use Matches() method.
+ ///
+ public static bool CompareIgnoringOwnership(this ActorIdentifier identifier, ActorIdentifier other)
+ {
+ if (identifier.Type != other.Type)
+ return false;
+
+ return identifier.Type switch
+ {
+ IdentifierType.Owned => PenumbraExtensions.Manager.DataIdEquals(identifier, other),
+ _ => identifier.Matches(other)
+ };
+ }
+
+ ///
+ /// Check if owned actor is owned by local player. Will return false if Type is not Owned.
+ ///
+ public static bool IsOwnedByLocalPlayer(this ActorIdentifier identifier)
+ {
+ if (identifier.Type != IdentifierType.Owned)
+ return false;
+
+ if (PenumbraExtensions.Manager == null)
+ return false;
+
+ return identifier.PlayerName == PenumbraExtensions.Manager.GetCurrentPlayer().PlayerName;
+ }
+
///
/// Wrapper around Incognito which returns non-incognito name in debug builds
///
diff --git a/CustomizePlus/Api/Data/IPCCharacterProfile.cs b/CustomizePlus/Api/Data/IPCCharacterProfile.cs
index c0f75c2..262e8cc 100644
--- a/CustomizePlus/Api/Data/IPCCharacterProfile.cs
+++ b/CustomizePlus/Api/Data/IPCCharacterProfile.cs
@@ -53,7 +53,6 @@ public class IPCCharacterProfile
CreationDate = DateTimeOffset.UtcNow,
ModifiedDate = DateTimeOffset.UtcNow,
Enabled = true,
- LimitLookupToOwnedObjects = false,
UniqueId = Guid.NewGuid(),
Templates = new List(1),
ProfileType = isTemporary ? Profiles.Enums.ProfileType.Temporary : Profiles.Enums.ProfileType.Normal
diff --git a/CustomizePlus/Armatures/Services/ArmatureManager.cs b/CustomizePlus/Armatures/Services/ArmatureManager.cs
index ece42c0..7575350 100644
--- a/CustomizePlus/Armatures/Services/ArmatureManager.cs
+++ b/CustomizePlus/Armatures/Services/ArmatureManager.cs
@@ -359,7 +359,6 @@ public unsafe sealed class ArmatureManager : IDisposable
if (type is not TemplateChanged.Type.NewBone &&
type is not TemplateChanged.Type.DeletedBone &&
type is not TemplateChanged.Type.EditorCharacterChanged &&
- type is not TemplateChanged.Type.EditorLimitLookupToOwnedChanged &&
type is not TemplateChanged.Type.EditorEnabled &&
type is not TemplateChanged.Type.EditorDisabled)
return;
@@ -405,21 +404,6 @@ public unsafe sealed class ArmatureManager : IDisposable
return;
}
- if(type == TemplateChanged.Type.EditorLimitLookupToOwnedChanged)
- {
- var profile = (Profile)arg3!;
-
- if (profile.Armatures.Count == 0)
- return;
-
- foreach (var armature in profile.Armatures)
- armature.IsPendingProfileRebind = true;
-
- _logger.Debug($"ArmatureManager.OnTemplateChange Editor profile limit lookup setting changed, armature rebind scheduled: {type}, profile: {profile.Name.Text.Incognify()}->{profile.Enabled}");
-
- return;
- }
-
if (type == TemplateChanged.Type.EditorEnabled ||
type == TemplateChanged.Type.EditorDisabled)
{
@@ -445,7 +429,6 @@ public unsafe sealed class ArmatureManager : IDisposable
type is not ProfileChanged.Type.TemporaryProfileDeleted &&
type is not ProfileChanged.Type.ChangedCharacter &&
type is not ProfileChanged.Type.ChangedDefaultProfile &&
- type is not ProfileChanged.Type.LimitLookupToOwnedChanged &&
type is not ProfileChanged.Type.ApplyToCurrentlyActiveCharacterChanged)
return;
@@ -522,7 +505,6 @@ public unsafe sealed class ArmatureManager : IDisposable
if (type == ProfileChanged.Type.ChangedCharacter ||
type == ProfileChanged.Type.Deleted ||
type == ProfileChanged.Type.TemporaryProfileDeleted ||
- type == ProfileChanged.Type.LimitLookupToOwnedChanged ||
type == ProfileChanged.Type.ApplyToCurrentlyActiveCharacterChanged)
{
if (profile.Armatures.Count == 0)
@@ -536,7 +518,7 @@ public unsafe sealed class ArmatureManager : IDisposable
armature.IsPendingProfileRebind = true;
}
- _logger.Debug($"ArmatureManager.OnProfileChange CC/DEL/TPD/LLTOC/ATCACC, armature rebind scheduled: {type}, data payload: {arg3?.ToString()?.Incognify()}, profile: {profile.Name.Text.Incognify()}->{profile.Enabled}");
+ _logger.Debug($"ArmatureManager.OnProfileChange CC/DEL/TPD/ATCACC, armature rebind scheduled: {type}, data payload: {arg3?.ToString()?.Incognify()}, profile: {profile.Name.Text.Incognify()}->{profile.Enabled}");
return;
}
@@ -567,7 +549,8 @@ public unsafe sealed class ArmatureManager : IDisposable
{
(var armatureActorIdentifier, _) = _gameObjectService.GetTrueActorForSpecialTypeActor(kvPair.Key);
- if (armatureActorIdentifier.IsValid && armatureActorIdentifier.Matches(armatureActorIdentifier))
+ if (actorIdentifier.IsValid && armatureActorIdentifier.CompareIgnoringOwnership(actorIdentifier) &&
+ (armatureActorIdentifier.Type != IdentifierType.Owned || armatureActorIdentifier.IsOwnedByLocalPlayer()))
yield return kvPair.Value;
}
}
diff --git a/CustomizePlus/Configuration/Helpers/V3ProfileToV4Converter.cs b/CustomizePlus/Configuration/Helpers/V3ProfileToV4Converter.cs
index 4571faa..f4cdac4 100644
--- a/CustomizePlus/Configuration/Helpers/V3ProfileToV4Converter.cs
+++ b/CustomizePlus/Configuration/Helpers/V3ProfileToV4Converter.cs
@@ -18,7 +18,6 @@ internal static class V3ProfileToV4Converter
CreationDate = v3Profile.CreationDate,
ModifiedDate = DateTimeOffset.UtcNow,
Enabled = v3Profile.Enabled,
- LimitLookupToOwnedObjects = v3Profile.OwnedOnly,
UniqueId = Guid.NewGuid(),
Templates = new List(1)
};
diff --git a/CustomizePlus/Core/ServiceManagerBuilder.cs b/CustomizePlus/Core/ServiceManagerBuilder.cs
index 308f4e6..cb45dd4 100644
--- a/CustomizePlus/Core/ServiceManagerBuilder.cs
+++ b/CustomizePlus/Core/ServiceManagerBuilder.cs
@@ -206,8 +206,7 @@ public static class ServiceManagerBuilder
.AddSingleton()
.AddSingleton()
.AddSingleton(p => new CutsceneResolver(idx => (short)p.GetRequiredService().GetParentIndex(idx)))
- .AddSingleton()
- .AddSingleton();
+ .AddSingleton();
return services;
}
diff --git a/CustomizePlus/Core/Services/SupportLogBuilderService.cs b/CustomizePlus/Core/Services/SupportLogBuilderService.cs
index 1771744..25c4aa0 100644
--- a/CustomizePlus/Core/Services/SupportLogBuilderService.cs
+++ b/CustomizePlus/Core/Services/SupportLogBuilderService.cs
@@ -74,7 +74,6 @@ public class SupportLogBuilderService
sb.Append($"> > **`Name: `** {profile.Name.Text.Incognify()}\n");
sb.Append($"> > **`Type: `** {profile.ProfileType} \n");
sb.Append($"> > **`Character name: `** {profile.CharacterName.Text.Incognify()}\n");
- sb.Append($"> > **`Limit to my creatures: `** {profile.LimitLookupToOwnedObjects}\n");
sb.Append($"> > **`Templates:`**\n");
sb.Append($"> > > **`Count: `** {profile.Templates.Count}\n");
foreach (var template in profile.Templates)
diff --git a/CustomizePlus/Profiles/Data/Profile.cs b/CustomizePlus/Profiles/Data/Profile.cs
index faf755d..35603aa 100644
--- a/CustomizePlus/Profiles/Data/Profile.cs
+++ b/CustomizePlus/Profiles/Data/Profile.cs
@@ -40,7 +40,7 @@ public sealed class Profile : ISavable
///
/// Whether to search only through local player owned characters or all characters when searching for game object by name
///
- public bool LimitLookupToOwnedObjects { get; set; } = false;
+ //public bool LimitLookupToOwnedObjects { get; set; } = false;
public bool Enabled { get; set; }
public DateTimeOffset CreationDate { get; set; } = DateTime.UtcNow;
@@ -80,7 +80,6 @@ public sealed class Profile : ISavable
public Profile(Profile original) : this()
{
Character = original.Character;
- LimitLookupToOwnedObjects = original.LimitLookupToOwnedObjects;
ApplyToCurrentlyActiveCharacter = original.ApplyToCurrentlyActiveCharacter;
foreach (var template in original.Templates)
@@ -108,7 +107,6 @@ public sealed class Profile : ISavable
["Character"] = Character.ToJson(),
["ApplyToCurrentlyActiveCharacter"] = ApplyToCurrentlyActiveCharacter,
["Name"] = Name.Text,
- ["LimitLookupToOwnedObjects"] = LimitLookupToOwnedObjects,
["Enabled"] = Enabled,
["IsWriteProtected"] = IsWriteProtected,
["Templates"] = SerializeTemplates()
diff --git a/CustomizePlus/Profiles/Events/ProfileChanged.cs b/CustomizePlus/Profiles/Events/ProfileChanged.cs
index 1869311..a0f63d1 100644
--- a/CustomizePlus/Profiles/Events/ProfileChanged.cs
+++ b/CustomizePlus/Profiles/Events/ProfileChanged.cs
@@ -22,7 +22,6 @@ public sealed class ProfileChanged() : EventWrapper() ?? throw new ArgumentNullException("UniqueId"),
Name = new LowerString(obj["Name"]?.ToObject()?.Trim() ?? throw new ArgumentNullException("Name")),
- LimitLookupToOwnedObjects = obj["LimitLookupToOwnedObjects"]?.ToObject() ?? throw new ArgumentNullException("LimitLookupToOwnedObjects"),
Enabled = obj["Enabled"]?.ToObject() ?? throw new ArgumentNullException("Enabled"),
ModifiedDate = obj["ModifiedDate"]?.ToObject() ?? creationDate,
IsWriteProtected = obj["IsWriteProtected"]?.ToObject() ?? false,
diff --git a/CustomizePlus/Profiles/ProfileManager.cs b/CustomizePlus/Profiles/ProfileManager.cs
index 19c41df..adba325 100644
--- a/CustomizePlus/Profiles/ProfileManager.cs
+++ b/CustomizePlus/Profiles/ProfileManager.cs
@@ -172,7 +172,7 @@ public partial class ProfileManager : IDisposable
///
public void ChangeCharacter(Profile profile, ActorIdentifier actorIdentifier)
{
- if (!actorIdentifier.IsValid || actorIdentifier.Matches(profile.Character))
+ if (!actorIdentifier.IsValid || actorIdentifier.CompareIgnoringOwnership(profile.Character))
return;
var oldCharacter = profile.Character;
@@ -227,7 +227,7 @@ public partial class ProfileManager : IDisposable
_logger.Debug($"Setting {profile} as enabled...");
foreach (var otherProfile in Profiles
- .Where(x => x.Character.Matches(profile.Character) && x != profile && x.Enabled && !x.IsTemporary))
+ .Where(x => x.Character.CompareIgnoringOwnership(profile.Character) && x != profile && x.Enabled && !x.IsTemporary))
{
_logger.Debug($"\t-> {otherProfile} disabled");
SetEnabled(otherProfile, false);
@@ -254,17 +254,6 @@ public partial class ProfileManager : IDisposable
else
throw new ProfileNotFoundException();
}
- public void SetLimitLookupToOwned(Profile profile, bool value)
- {
- if (profile.LimitLookupToOwnedObjects != value)
- {
- profile.LimitLookupToOwnedObjects = value;
-
- SaveProfile(profile);
-
- _event.Invoke(ProfileChanged.Type.LimitLookupToOwnedChanged, profile, value);
- }
- }
public void SetApplyToCurrentlyActiveCharacter(Profile profile, bool value)
{
@@ -361,9 +350,8 @@ public partial class ProfileManager : IDisposable
profile.Enabled = true;
profile.ProfileType = ProfileType.Temporary;
profile.Character = identifier;
- profile.LimitLookupToOwnedObjects = false;
- var existingProfile = Profiles.FirstOrDefault(x => x.Character.Matches(profile.Character) && x.IsTemporary);
+ var existingProfile = Profiles.FirstOrDefault(x => x.Character.CompareIgnoringOwnership(profile.Character) && x.IsTemporary);
if (existingProfile != null)
{
_logger.Debug($"Temporary profile for {existingProfile.Character.Incognito(null)} already exists, removing...");
@@ -421,11 +409,19 @@ public partial class ProfileManager : IDisposable
if (!actorIdentifier.IsValid)
return null;
- var query = Profiles.Where(x => x.Character.Matches(actorIdentifier) && !x.IsTemporary);
+ var query = Profiles.Where(x => x.Character.CompareIgnoringOwnership(actorIdentifier) && !x.IsTemporary);
if (enabledOnly)
query = query.Where(x => x.Enabled);
- return query.FirstOrDefault();
+ var profile = query.FirstOrDefault();
+
+ if (profile == null)
+ return null;
+
+ if (actorIdentifier.Type == IdentifierType.Owned && !actorIdentifier.IsOwnedByLocalPlayer())
+ return null;
+
+ return profile;
}
//todo: replace with dictionary
@@ -462,13 +458,13 @@ public partial class ProfileManager : IDisposable
return true;
var currentPlayer = _actorManager.GetCurrentPlayer();
- return currentPlayer.IsValid && _actorManager.GetCurrentPlayer().Matches(actorIdentifier);
+ return currentPlayer.IsValid && _actorManager.GetCurrentPlayer().CompareIgnoringOwnership(actorIdentifier);
}
- return (profile.CharacterName.Text == name || profile.Character.Matches(actorIdentifier)) &&
- (!profile.LimitLookupToOwnedObjects ||
- (actorIdentifier.Type == IdentifierType.Owned &&
- actorIdentifier.PlayerName == _actorManager.GetCurrentPlayer().PlayerName));
+ if (actorIdentifier.Type == IdentifierType.Owned && !actorIdentifier.IsOwnedByLocalPlayer())
+ return false;
+
+ return profile.CharacterName.Text == name || profile.Character.CompareIgnoringOwnership(actorIdentifier);
}
if (_templateEditorManager.IsEditorActive && _templateEditorManager.EditorProfile.Enabled && IsProfileAppliesToCurrentActor(_templateEditorManager.EditorProfile))
@@ -479,6 +475,7 @@ public partial class ProfileManager : IDisposable
if(IsProfileAppliesToCurrentActor(profile))
{
//todo: temp for migrations to v5
+ //todo: make sure this works for minions and stuff
if (!profile.Character.IsValid)
{
_logger.Warning($"No character for profile {profile}, but character has been found as: {actorIdentifier}, will set.");
diff --git a/CustomizePlus/Templates/Events/TemplateChanged.cs b/CustomizePlus/Templates/Events/TemplateChanged.cs
index 0ac4702..d118bd3 100644
--- a/CustomizePlus/Templates/Events/TemplateChanged.cs
+++ b/CustomizePlus/Templates/Events/TemplateChanged.cs
@@ -20,7 +20,6 @@ public class TemplateChanged() : EventWrapper
/// Resets changes in currently edited template to default values
///
diff --git a/CustomizePlus/UI/Windows/Controls/ActorAssignmentUi.cs b/CustomizePlus/UI/Windows/Controls/ActorAssignmentUi.cs
index 0003320..fbc32de 100644
--- a/CustomizePlus/UI/Windows/Controls/ActorAssignmentUi.cs
+++ b/CustomizePlus/UI/Windows/Controls/ActorAssignmentUi.cs
@@ -13,8 +13,10 @@ using OtterGui.Custom;
using OtterGui.Log;
using Penumbra.GameData.Actors;
using Penumbra.GameData.Data;
+using Penumbra.GameData.DataContainers;
using Penumbra.GameData.DataContainers.Bases;
using Penumbra.GameData.Gui;
+using Penumbra.GameData.Interop;
using Penumbra.GameData.Structs;
using Penumbra.String;
@@ -23,22 +25,18 @@ namespace CustomizePlus.UI.Windows.Controls;
public class ActorAssignmentUi
{
private readonly ActorManager _actorManager;
- private readonly DictBNpcENpc _dictBnpcEnpc;
private WorldCombo _worldCombo = null!;
- private Penumbra.GameData.Gui.NpcCombo _mountCombo = null!;
- private Penumbra.GameData.Gui.NpcCombo _companionCombo = null!;
- //private BattleEventNpcCombo _npcCombo = null!;
- private Penumbra.GameData.Gui.NpcCombo _npcCombo = null!;
+ private NpcCombo _mountCombo = null!;
+ private NpcCombo _companionCombo = null!;
+ private NpcCombo _bnpcCombo = null!;
+ private NpcCombo _enpcCombo = null!;
private bool _ready;
private string _newCharacterName = string.Empty;
private ObjectKind _newKind = ObjectKind.BattleNpc;
- /* public string CharacterName { get => _newCharacterName; }
- public WorldId SelectedWorld { get => _worldCombo.CurrentSelection.Key; }
- */
public ActorIdentifier NpcIdentifier { get; private set; } = ActorIdentifier.Invalid;
public ActorIdentifier PlayerIdentifier { get; private set; } = ActorIdentifier.Invalid;
public ActorIdentifier RetainerIdentifier { get; private set; } = ActorIdentifier.Invalid;
@@ -56,12 +54,11 @@ public class ActorAssignmentUi
public bool CanSetNpc
=> NpcIdentifier.IsValid;
- public ActorAssignmentUi(ActorManager actorManager, DictBNpcENpc dictBnpcEnpc)
+ public ActorAssignmentUi(ActorManager actorManager, DictModelChara dictModelChara, DictBNpcNames bNpcNames, DictBNpc bNpc)
{
_actorManager = actorManager;
- _dictBnpcEnpc = dictBnpcEnpc;
- _actorManager.Awaiter.ContinueWith(_ => dictBnpcEnpc.Awaiter.ContinueWith(_ => SetupCombos(), TaskScheduler.Default), TaskScheduler.Default);
+ _actorManager.Awaiter.ContinueWith(_ => SetupCombos(), TaskScheduler.Default);
}
public void DrawWorldCombo(float width)
@@ -92,12 +89,6 @@ public class ActorAssignmentUi
if (!_ready)
return;
- /* if(_newKind == ObjectKind.BattleNpc || _newKind == ObjectKind.EventNpc)
- {
- if (_npcCombo.Draw(width))
- UpdateIdentifiersInternal();
- }*/
-
var combo = GetNpcCombo(_newKind);
if (combo.Draw(width))
UpdateIdentifiersInternal();
@@ -114,8 +105,8 @@ public class ActorAssignmentUi
private Penumbra.GameData.Gui.NpcCombo GetNpcCombo(ObjectKind kind)
=> kind switch
{
- ObjectKind.BattleNpc => _npcCombo,
- ObjectKind.EventNpc => _npcCombo,
+ ObjectKind.BattleNpc => _bnpcCombo,
+ ObjectKind.EventNpc => _enpcCombo,
ObjectKind.MountType => _mountCombo,
ObjectKind.Companion => _companionCombo,
_ => throw new NotImplementedException(),
@@ -127,9 +118,8 @@ public class ActorAssignmentUi
_worldCombo = new WorldCombo(_actorManager.Data.Worlds, Plugin.Logger);
_mountCombo = new Penumbra.GameData.Gui.NpcCombo("##mountCombo", _actorManager.Data.Mounts, Plugin.Logger);
_companionCombo = new Penumbra.GameData.Gui.NpcCombo("##companionCombo", _actorManager.Data.Companions, Plugin.Logger);
- //_bnpcCombo = new Penumbra.GameData.Gui.NpcCombo("##bnpcCombo", _actorManager.Data.BNpcs, Plugin.Logger);
- //_enpcCombo = new Penumbra.GameData.Gui.NpcCombo("##enpcCombo", _actorManager.Data.ENpcs, Plugin.Logger);
- _npcCombo = new Penumbra.GameData.Gui.NpcCombo("##npcCombo", _dictBnpcEnpc, Plugin.Logger);
+ _bnpcCombo = new Penumbra.GameData.Gui.NpcCombo("##bnpcCombo", _actorManager.Data.BNpcs, Plugin.Logger);
+ _enpcCombo = new Penumbra.GameData.Gui.NpcCombo("##enpcCombo", _actorManager.Data.ENpcs, Plugin.Logger);
_ready = true;
}
@@ -141,41 +131,21 @@ public class ActorAssignmentUi
RetainerIdentifier = _actorManager.CreateRetainer(byteName, ActorIdentifier.RetainerType.Bell);
MannequinIdentifier = _actorManager.CreateRetainer(byteName, ActorIdentifier.RetainerType.Mannequin);
}
+
+ var npcCombo = GetNpcCombo(_newKind);
+ switch(_newKind)
+ {
+ case ObjectKind.BattleNpc:
+ case ObjectKind.EventNpc:
+ NpcIdentifier = _actorManager.CreateNpc(_newKind, npcCombo.CurrentSelection.Ids[0]);
+ break;
+ case ObjectKind.MountType:
+ case ObjectKind.Companion:
+ var currentPlayer = _actorManager.GetCurrentPlayer();
+ NpcIdentifier = _actorManager.CreateOwned(currentPlayer.PlayerName, currentPlayer.HomeWorld, _newKind, npcCombo.CurrentSelection.Ids[0]);
+ break;
+ default:
+ throw new NotImplementedException();
+ }
}
-}
-
-//Todo: Temp
-/// A dictionary that matches BNpcNameId to names.
-public sealed class DictBNpcENpc(IDalamudPluginInterface pluginInterface, Logger log, IDataManager gameData)
- : NameDictionary(pluginInterface, log, gameData, "BNpcsENpcs", 7, () => CreateData(gameData))
-{
- /// Create the data.
- private static IReadOnlyDictionary CreateData(IDataManager gameData)
- {
-
- var sheet = gameData.GetExcelSheet(gameData.Language)!;
- var sheet2 = gameData.GetExcelSheet(gameData.Language)!;
-
- var dict = new Dictionary((int)sheet.RowCount + (int)sheet2.RowCount);
-
- foreach (var n in sheet.Where(n => n.Singular.RawData.Length > 0))
- dict.TryAdd(n.RowId, DataUtility.ToTitleCaseExtended(n.Singular, n.Article));
- foreach (var n in sheet2.Where(e => e.Singular.RawData.Length > 0))
- dict.TryAdd(n.RowId, DataUtility.ToTitleCaseExtended(n.Singular, n.Article));
-
- return dict.ToFrozenDictionary();
- }
-
- ///
- public bool ContainsKey(BNpcNameId key)
- => Value.ContainsKey(key.Id);
-
- ///
- public bool TryGetValue(BNpcNameId key, [NotNullWhen(true)] out string? value)
- => Value.TryGetValue(key.Id, out value);
-
- ///
- public string this[BNpcNameId key]
- => Value[key.Id];
-}
-
+}
\ No newline at end of file
diff --git a/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/StateMonitoringTab.cs b/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/StateMonitoringTab.cs
index 9f74fda..4163770 100644
--- a/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/StateMonitoringTab.cs
+++ b/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/StateMonitoringTab.cs
@@ -149,7 +149,6 @@ public class StateMonitoringTab
ImGui.Text($"ID: {profile.UniqueId}");
ImGui.Text($"Enabled: {(profile.Enabled ? "Enabled" : "Disabled")}");
ImGui.Text($"State : {(profile.IsTemporary ? "Temporary" : "Permanent")}");
- ImGui.Text($"Lookup: {(profile.LimitLookupToOwnedObjects ? "Limited lookup" : "Global lookup")}");
var showTemplates = ImGui.CollapsingHeader($"Templates###{prefix}-profile-{profile.UniqueId}-templates");
if (showTemplates)
diff --git a/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfileFileSystemSelector.cs b/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfileFileSystemSelector.cs
index 9f28bdd..87b1c46 100644
--- a/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfileFileSystemSelector.cs
+++ b/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfileFileSystemSelector.cs
@@ -16,6 +16,7 @@ using CustomizePlus.Configuration.Data;
using CustomizePlus.Profiles.Data;
using CustomizePlus.Game.Services;
using CustomizePlus.Profiles.Events;
+using CustomizePlus.GameData.Extensions;
namespace CustomizePlus.UI.Windows.MainWindow.Tabs.Profiles;
@@ -239,9 +240,9 @@ public class ProfileFileSystemSelector : FileSystemSelector