Profile.GetCurrentlyActiveProfileOnCharacter -> Profile.GetActiveProfileIdOnCharacter (now returns profile id instead of profile contents), Profile.GetProfileById -> Profile.GetProfileByUniqueId
This commit is contained in:
@@ -47,8 +47,8 @@ public class IPCTestTab //: IDisposable
|
||||
[EzIPC("Profile.DisableByUniqueId")]
|
||||
private readonly Action<Guid> _disableProfileByUniqueIdIpcFunc;
|
||||
|
||||
[EzIPC("Profile.GetCurrentlyActiveProfileOnCharacter")]
|
||||
private readonly Func<Character, (int, string?)> _getCurrentlyActiveProfileOnCharacterIpcFunc;
|
||||
[EzIPC("Profile.GetActiveProfileIdOnCharacter")]
|
||||
private readonly Func<Character, (int, Guid?)> _getActiveProfileIdOnCharacterIpcFunc;
|
||||
|
||||
[EzIPC("Profile.SetTemporaryProfileOnCharacter")]
|
||||
private readonly Func<Character, string, (int, Guid?)> _setTemporaryProfileOnCharacterIpcFunc;
|
||||
@@ -59,7 +59,7 @@ public class IPCTestTab //: IDisposable
|
||||
[EzIPC("Profile.DeleteTemporaryProfileByUniqueId")]
|
||||
private readonly Func<Guid, int> _deleteTemporaryProfileByUniqueIdIpcFunc;
|
||||
|
||||
[EzIPC("Profile.GetProfileById")]
|
||||
[EzIPC("Profile.GetProfileByUniqueId")]
|
||||
private readonly Func<Guid, (int, string?)> _getProfileByIdIpcFunc;
|
||||
|
||||
//private readonly ICallGateSubscriber<string, Character?, object>? _setCharacterProfile;
|
||||
@@ -161,16 +161,19 @@ public class IPCTestTab //: IDisposable
|
||||
_popupSystem.ShowPopup(PopupSystem.Messages.IPCV4ProfileRemembered);
|
||||
}
|
||||
|
||||
if (ImGui.Button("GetCurrentlyActiveProfileOnCharacter into memory"))
|
||||
if (ImGui.Button("GetActiveProfileIdOnCharacter into clipboard"))
|
||||
{
|
||||
var actors = _gameObjectService.FindActorsByName(_targetCharacterName).ToList();
|
||||
if (actors.Count == 0)
|
||||
return;
|
||||
|
||||
(int result, _rememberedProfileJson) = _getCurrentlyActiveProfileOnCharacterIpcFunc(FindCharacterByAddress(actors[0].Item2.Address));
|
||||
(int result, Guid? uniqueId) = _getActiveProfileIdOnCharacterIpcFunc(FindCharacterByAddress(actors[0].Item2.Address));
|
||||
|
||||
if(result == 0)
|
||||
_popupSystem.ShowPopup(PopupSystem.Messages.IPCGetProfileFromChrRemembered);
|
||||
{
|
||||
ImGui.SetClipboardText(uniqueId.ToString());
|
||||
_popupSystem.ShowPopup(PopupSystem.Messages.IPCCopiedToClipboard);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Error($"Error code {result} while calling GetCurrentlyActiveProfileOnCharacter");
|
||||
@@ -186,7 +189,7 @@ public class IPCTestTab //: IDisposable
|
||||
if (actors.Count == 0)
|
||||
return;
|
||||
|
||||
(int result, Guid? profileGuid) = _setTemporaryProfileOnCharacterIpcFunc(FindCharacterByAddress(actors[0].Item2.Address),_rememberedProfileJson);
|
||||
(int result, Guid? profileGuid) = _setTemporaryProfileOnCharacterIpcFunc(FindCharacterByAddress(actors[0].Item2.Address), _rememberedProfileJson);
|
||||
if (result == 0)
|
||||
{
|
||||
_popupSystem.ShowPopup(PopupSystem.Messages.IPCSetProfileToChrDone);
|
||||
@@ -228,7 +231,7 @@ public class IPCTestTab //: IDisposable
|
||||
ImGui.SameLine();
|
||||
ImGui.InputText("##profileguid", ref _targetProfileId, 128);
|
||||
|
||||
if (ImGui.Button("Get profile by Unique ID"))
|
||||
if (ImGui.Button("Get profile by Unique ID into clipboard"))
|
||||
{
|
||||
(int result, string? profileJson) = _getProfileByIdIpcFunc(Guid.Parse(_targetProfileId));
|
||||
if (result == 0)
|
||||
@@ -243,6 +246,21 @@ public class IPCTestTab //: IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui.Button("Get profile by Unique ID into memory"))
|
||||
{
|
||||
(int result, string? profileJson) = _getProfileByIdIpcFunc(Guid.Parse(_targetProfileId));
|
||||
if (result == 0)
|
||||
{
|
||||
_rememberedProfileJson = profileJson;
|
||||
_popupSystem.ShowPopup(PopupSystem.Messages.IPCV4ProfileRemembered);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Error($"Error code {result} while calling GetProfileById");
|
||||
_popupSystem.ShowPopup(PopupSystem.Messages.ActionError);
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui.Button("Enable profile by Unique ID"))
|
||||
{
|
||||
_enableProfileByUniqueIdIpcFunc(Guid.Parse(_targetProfileId));
|
||||
|
||||
@@ -11,7 +11,7 @@ public partial class PopupSystem
|
||||
public const string FantasiaPlusDetected = "fantasia_detected_warn";
|
||||
|
||||
public const string IPCV4ProfileRemembered = "ipc_v4_profile_remembered";
|
||||
public const string IPCGetProfileFromChrRemembered = "ipc_get_profile_from_character_remembered";
|
||||
public const string IPCGetProfileByIdRemembered = "ipc_get_profile_by_id_remembered";
|
||||
public const string IPCSetProfileToChrDone = "ipc_set_profile_to_character_done";
|
||||
public const string IPCRevertDone = "ipc_revert_done";
|
||||
public const string IPCCopiedToClipboard = "ipc_copied_to clipboard";
|
||||
@@ -31,9 +31,9 @@ public partial class PopupSystem
|
||||
RegisterPopup(Messages.FantasiaPlusDetected, "Customize+ detected that you have Fantasia+ installed.\nPlease delete or turn it off and restart your game to use Customize+.");
|
||||
|
||||
RegisterPopup(Messages.IPCV4ProfileRemembered, "Current profile has been copied into memory");
|
||||
RegisterPopup(Messages.IPCGetProfileFromChrRemembered, "GetProfileFromCharacter result has been copied into memory");
|
||||
RegisterPopup(Messages.IPCGetProfileByIdRemembered, "GetProfileByUniqueId result has been copied into memory");
|
||||
RegisterPopup(Messages.IPCSetProfileToChrDone, "SetProfileToCharacter has been called with data from memory, profile id printed to log");
|
||||
RegisterPopup(Messages.IPCRevertDone, "Revert has been called");
|
||||
RegisterPopup(Messages.IPCRevertDone, "DeleteTemporaryProfileByUniqueId has been called");
|
||||
RegisterPopup(Messages.IPCCopiedToClipboard, "Copied into clipboard");
|
||||
RegisterPopup(Messages.IPCEnableProfileByIdDone, "Enable profile by id has been called");
|
||||
RegisterPopup(Messages.IPCDisableProfileByIdDone, "Disable profile by id has been called");
|
||||
|
||||
Reference in New Issue
Block a user