|
|
|
@ -11,7 +11,8 @@ namespace { |
|
|
|
|
SKSE::stl::report_and_fail("Failed to find standard logging directory"sv); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
*path /= "EnderalSEEasyCrafting.log"sv; |
|
|
|
|
*path /= PluginDeclaration::GetSingleton()->GetName(); |
|
|
|
|
*path += ".log"sv; |
|
|
|
|
auto sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(path->string(), true); |
|
|
|
|
|
|
|
|
|
auto log = std::make_shared<spdlog::logger>("global log"s, std::move(sink)); |
|
|
|
@ -22,23 +23,14 @@ namespace { |
|
|
|
|
spdlog::set_default_logger(std::move(log)); |
|
|
|
|
spdlog::set_pattern("[%l] %v"s); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SKSEPluginLoad(const LoadInterface* skse) { |
|
|
|
|
|
|
|
|
|
void InitializeMessaging() |
|
|
|
|
{ |
|
|
|
|
GetMessagingInterface()->RegisterListener([](MessagingInterface::Message* message) { |
|
|
|
|
if (message->type == MessagingInterface::kPostPostLoad) { |
|
|
|
|
if (!std::filesystem::exists("Data\\Enderal - Forgotten Stories.esm") || !std::filesystem::exists("Data\\SKSE\\Plugins\\EnderalSE.ini")) { |
|
|
|
|
MessageBoxW(NULL, L"Easy Crafting requires Enderal SE 2.0.12 or newer.", L"Enderal SE Easy Crafting", MB_OK | MB_ICONERROR); |
|
|
|
|
exit(EXIT_FAILURE); |
|
|
|
|
} |
|
|
|
|
GetSettings(true); |
|
|
|
|
EventListener::Install(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SKSEPluginLoad(const LoadInterface* skse) { |
|
|
|
|
|
|
|
|
|
InitializeLogging(); |
|
|
|
|
|
|
|
|
@ -47,7 +39,9 @@ SKSEPluginLoad(const LoadInterface* skse) { |
|
|
|
|
logger::info("{} {} is loading...", plugin->GetName(), version); |
|
|
|
|
|
|
|
|
|
Init(skse); |
|
|
|
|
InitializeMessaging(); |
|
|
|
|
|
|
|
|
|
GetSettings(true); |
|
|
|
|
EventListener::Install(); |
|
|
|
|
|
|
|
|
|
logger::info("{} has finished loading.", plugin->GetName()); |
|
|
|
|
return true; |
|
|
|
|