diff --git a/Glamourer/Api/GlamourerIpc.cs b/Glamourer/Api/GlamourerIpc.cs index c24e31b..79a0831 100644 --- a/Glamourer/Api/GlamourerIpc.cs +++ b/Glamourer/Api/GlamourerIpc.cs @@ -20,7 +20,7 @@ public class GlamourerIpc : IDisposable private readonly ObjectTable _objectTable; private readonly DalamudPluginInterface _pluginInterface; - internal ICallGateProvider? ProviderGetCharacterCustomization; + internal ICallGateProvider? ProviderGetCharacterCustomization; internal ICallGateProvider? ProviderApplyCharacterCustomization; internal ICallGateProvider? ProviderRevertCharacterCustomization; internal ICallGateProvider? ProviderGetApiVersion; @@ -59,7 +59,7 @@ public class GlamourerIpc : IDisposable try { - ProviderGetCharacterCustomization = _pluginInterface.GetIpcProvider(LabelProviderGetCharacterCustomization); + ProviderGetCharacterCustomization = _pluginInterface.GetIpcProvider(LabelProviderGetCharacterCustomization); ProviderGetCharacterCustomization.RegisterFunc(GetCharacterCustomization); } catch (Exception ex) @@ -124,10 +124,19 @@ public class GlamourerIpc : IDisposable } } - private string GetCharacterCustomization() + private string GetCharacterCustomization(string characterName) { var save = new CharacterSave(); - save.LoadCharacter(_clientState.LocalPlayer!); + foreach (var gameObject in _objectTable) + { + if (gameObject.Name.ToString() != characterName) + continue; + + var player = (Character)gameObject; + save.LoadCharacter(player); + break; + } + return save.ToBase64(); } }