Once per session, check if something overrides MQP01Home (usually Tamriel) and show a corner notification

This commit is contained in:
Eddoursul 2022-07-29 01:36:04 +02:00
parent 83cbf58818
commit 9ede1e012b
7 changed files with 24 additions and 5 deletions

BIN
SKSE/Plugins/fs.dll (Stored with Git LFS)

Binary file not shown.

BIN
SKSE/Plugins/fs_se.dll (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -51,7 +51,7 @@ struct SKSEPluginVersionData
void SKSEMessageHandler(SKSEMessagingInterface::Message* msg) void SKSEMessageHandler(SKSEMessagingInterface::Message* msg)
{ {
if (msg->type == SKSEMessagingInterface::kMessage_PostLoadGame || msg->type == SKSEMessagingInterface::kMessage_NewGame) { if ((msg->type == SKSEMessagingInterface::kMessage_PostLoadGame && msg->data) || msg->type == SKSEMessagingInterface::kMessage_NewGame) {
if (g_NewGameStarted < 2) { if (g_NewGameStarted < 2) {
g_NewGameStarted++; g_NewGameStarted++;
} }
@ -155,6 +155,18 @@ extern "C" {
return true; return true;
}); });
g_papyrus->Register([](VMClassRegistry* registry) {
registry->RegisterFunction(new NativeFunction0<StaticFunctionTag, bool>("HasIncompatibleMods", "EnderalLib", [](StaticFunctionTag* tag) {
TESWorldSpace* world = (TESWorldSpace*)LookupFormByID(0x3C);
if (world && std::string(world->editorId.Get()) != "MQP01Home") {
return true;
}
return false;
}, registry));
_MESSAGE("Register Succeeded: HasIncompatibleMods");
return true;
});
return true; return true;
} }
}; };

View File

@ -394,6 +394,11 @@ Function Maintenance()
If Game.GetModByName("Enderal_FS_More_Affinities.esp") != 255 If Game.GetModByName("Enderal_FS_More_Affinities.esp") != 255
FixMoreAffinitiesMod() FixMoreAffinitiesMod()
EndIf EndIf
if EnderalLib.NewGameCount() == 1 && EnderalLib.HasIncompatibleMods()
Utility.wait(2.0)
Debug.Notification("Some installed mods are incompatible with Enderal.")
endif
EndFunction EndFunction

View File

@ -6,6 +6,8 @@ Potion function CreatePotion(MagicEffect[] effects, float[] magnitudes, int[] ar
int function NewGameCount() native global int function NewGameCount() native global
bool function HasIncompatibleMods() native global
bool function IsDLLLoaded() global bool function IsDLLLoaded() global
return (SKSE.GetPluginVersion("fs_skse_functions") != -1) return (SKSE.GetPluginVersion("fs_skse_functions") != -1)
endfunction endfunction