Fixes, IPC

* Armature manager now assigns permanent ActorIdentifier to armatures
* Slight changes to make sure penumbra redraw doesn't break temporary profiles
* Profile selection UI now gets updated on login/logout in order to display correct colors
* Changed logic of setting Armature.IsVisible
* Implemented OnProfileUpdate IPC
This commit is contained in:
RisaDev
2024-01-23 01:40:01 +03:00
parent 6dbd6a62ff
commit 7011914a4e
8 changed files with 124 additions and 44 deletions

View File

@@ -202,7 +202,7 @@ public class StateMonitoringTab
ImGui.Text($"Profile: {armature.Profile.Name.Text.Incognify()} ({armature.Profile.UniqueId})");
ImGui.Text($"Actor: {armature.ActorIdentifier.IncognitoDebug()}");
ImGui.Text($"Protection: {(armature.ProtectedUntil >= DateTime.UtcNow ? "Active" : "NOT active")} [{armature.ProtectedUntil} (UTC)]");
ImGui.Text($"Last seen: {armature.LastSeen} (UTC)");
//ImGui.Text("Profile:");
//DrawSingleProfile($"armature-{armature.GetHashCode()}", armature.Profile);

View File

@@ -25,6 +25,7 @@ public class ProfileFileSystemSelector : FileSystemSelector<Profile, ProfileStat
private readonly ProfileManager _profileManager;
private readonly ProfileChanged _event;
private readonly GameObjectService _gameObjectService;
private readonly IClientState _clientState;
private Profile? _cloneProfile;
private string _newName = string.Empty;
@@ -51,16 +52,21 @@ public class ProfileFileSystemSelector : FileSystemSelector<Profile, ProfileStat
PluginConfiguration configuration,
ProfileManager profileManager,
ProfileChanged @event,
GameObjectService gameObjectService)
GameObjectService gameObjectService,
IClientState clientState)
: base(fileSystem, keyState, logger, allowMultipleSelection: true)
{
_configuration = configuration;
_profileManager = profileManager;
_event = @event;
_gameObjectService = gameObjectService;
_clientState = clientState;
_event.Subscribe(OnProfileChange, ProfileChanged.Priority.ProfileFileSystemSelector);
_clientState.Login += OnLoginLogout;
_clientState.Logout += OnLoginLogout;
AddButton(NewButton, 0);
AddButton(CloneButton, 20);
AddButton(DeleteButton, 1000);
@@ -71,6 +77,8 @@ public class ProfileFileSystemSelector : FileSystemSelector<Profile, ProfileStat
{
base.Dispose();
_event.Unsubscribe(OnProfileChange);
_clientState.Login -= OnLoginLogout;
_clientState.Logout -= OnLoginLogout;
}
protected override uint ExpandedFolderColor
@@ -131,6 +139,11 @@ public class ProfileFileSystemSelector : FileSystemSelector<Profile, ProfileStat
}
}
private void OnLoginLogout()
{
SetFilterDirty();
}
private void NewButton(Vector2 size)
{
if (!ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Plus.ToIconString(), size, "Create a new profile with default configuration.", false,