Pet Nicknames IPC implementation (#74)

* Pet Nicknames IPC implementation

* Moodles works again
This commit is contained in:
Amber
2024-09-10 09:13:34 +02:00
committed by GitHub
parent 9c954471fb
commit bf338ec697
7 changed files with 168 additions and 12 deletions

View File

@@ -41,6 +41,7 @@ public record PenumbraResourceLoadMessage(IntPtr GameObject, string GamePath, st
public record CustomizePlusMessage(string ProfileName) : MessageBase;
public record HonorificMessage(string NewHonorificTitle) : MessageBase;
public record MoodlesMessage(IntPtr Address) : MessageBase;
public record PetNamesMessage(string PetNicknamesData) : MessageBase;
public record HonorificReadyMessage : MessageBase;
public record PlayerChangedMessage(CharacterData Data) : MessageBase;
public record CharacterChangedMessage(GameObjectHandler GameObjectHandler) : MessageBase;

View File

@@ -31,7 +31,8 @@ public class PluginWarningNotificationService
ShownCustomizePlusWarning = _mareConfigService.Current.DisableOptionalPluginWarnings,
ShownHeelsWarning = _mareConfigService.Current.DisableOptionalPluginWarnings,
ShownHonorificWarning = _mareConfigService.Current.DisableOptionalPluginWarnings,
ShownMoodlesWarning = _mareConfigService.Current.DisableOptionalPluginWarnings
ShownMoodlesWarning = _mareConfigService.Current.DisableOptionalPluginWarnings,
ShowPetNicknamesWarning = _mareConfigService.Current.DisableOptionalPluginWarnings
};
}
@@ -53,13 +54,18 @@ public class PluginWarningNotificationService
warning.ShownHonorificWarning = true;
}
// todo: change the moodles apiavailable to petnames for testing
if (changes.Contains(PlayerChanges.Moodles) && !warning.ShownMoodlesWarning && !_ipcManager.Moodles.APIAvailable)
{
missingPluginsForData.Add("Moodles");
warning.ShownMoodlesWarning = true;
}
if (changes.Contains(PlayerChanges.Moodles) && !warning.ShowPetNicknamesWarning && !_ipcManager.PetNames.APIAvailable)
{
missingPluginsForData.Add("PetNicknames");
warning.ShowPetNicknamesWarning = true;
}
if (missingPluginsForData.Any())
{
_mediator.Publish(new NotificationMessage("Missing plugins for " + playerName,