|
|
|
@ -29,11 +29,13 @@ namespace { |
|
|
|
|
{ |
|
|
|
|
GetMessagingInterface()->RegisterListener([](MessagingInterface::Message* message) { |
|
|
|
|
if (message->type == MessagingInterface::kPostLoad) { |
|
|
|
|
SKSE::GetModCallbackEventSource()->AddEventSink(EventListener::GetSingleton()); |
|
|
|
|
} else if (message->type == MessagingInterface::kNewGame || message->type == MessagingInterface::kPreLoadGame) { |
|
|
|
|
ArtifactTracker::Init(); // if KID is not installed
|
|
|
|
|
SKSE::GetModCallbackEventSource()->AddEventSink(EventListener::GetSingleton()); // runs, if KID is installed
|
|
|
|
|
} else if (message->type == MessagingInterface::kDataLoaded) { |
|
|
|
|
if (const auto pluginInfo = ArtifactTracker::g_loadInterface->GetPluginInfo("po3_KeywordItemDistributor"); !pluginInfo) { |
|
|
|
|
ArtifactTracker::Init(); // if KID is not installed
|
|
|
|
|
} |
|
|
|
|
} else if (message->type == MessagingInterface::kPostLoadGame) { |
|
|
|
|
ArtifactTracker::OnGameLoad(); // refresh g_persistentMap from savegame
|
|
|
|
|
ArtifactTracker::OnGameLoad(); // save-specific updates
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|