Added support for 1.6.629+

This commit is contained in:
Eddoursul 2022-10-08 17:54:12 +02:00
parent edd4f9ff5d
commit a299275ba7
8 changed files with 37 additions and 38 deletions

View File

@ -1,4 +1,4 @@
LoadSuppliesEverywhere = false
StoreInventorySupplies = true
ShowFetchingNotification = true
ShowReturningNotification = false
ShowReturningNotification = true

View File

@ -6,7 +6,7 @@ message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
########################################################################################################################
project(
EnderalSEEasyCrafting
VERSION 1.0.0
VERSION 1.1.0
DESCRIPTION "Enderal SE Easy Crafting"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)

View File

@ -113,8 +113,11 @@ auto EventListener::ProcessEvent(
std::thread([furn]() {
std::this_thread::sleep_for(std::chrono::milliseconds(300));
const auto playerRef = RE::PlayerCharacter::GetSingleton();
if (playerRef->GetSitSleepState() != RE::SIT_SLEEP_STATE::kWantToSit && playerRef->GetSitSleepState() != RE::SIT_SLEEP_STATE::kWaitingForSitAnim) {
const auto sitState = playerRef->AsActorState()->GetSitSleepState();
if (sitState != RE::SIT_SLEEP_STATE::kWantToSit && sitState != RE::SIT_SLEEP_STATE::kWaitingForSitAnim) {
return;
}
SKSE::GetTaskInterface()->AddTask([furn]() {
@ -123,7 +126,9 @@ auto EventListener::ProcessEvent(
}
std::thread([]() {
const auto playerRef = RE::PlayerCharacter::GetSingleton();
while (playerRef->GetSitSleepState() == RE::SIT_SLEEP_STATE::kWantToSit || playerRef->GetSitSleepState() == RE::SIT_SLEEP_STATE::kWaitingForSitAnim) {
const auto sitState = playerRef->AsActorState()->GetSitSleepState();
while (sitState == RE::SIT_SLEEP_STATE::kWantToSit || sitState == RE::SIT_SLEEP_STATE::kWaitingForSitAnim) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
std::this_thread::sleep_for(std::chrono::milliseconds(500));

View File

@ -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;

View File

@ -285,9 +285,9 @@ inline bool FetchSupplies(RE::TESFurniture* a_furn)
RE::TES::GetSingleton()->ForEachReferenceInRange(playerRef, 4000, [&chestAct, &bAllowFetch](RE::TESObjectREFR& b_ref) {
if (chestAct == b_ref.GetBaseObject()) {
bAllowFetch = true;
return false;
return RE::BSContainer::ForEachResult::kStop;
}
return true;
return RE::BSContainer::ForEachResult::kContinue;
});
}

View File

@ -3,7 +3,7 @@
{
"kind": "git",
"repository": "https://gitlab.com/colorglass/vcpkg-colorglass",
"baseline": "5a11d06fd1b2d7cd6339d6aea48d450309e89cc1",
"baseline": "1b279b20c7e0db1c9d549ff3b64e024c01317b55",
"packages": [
"commonlibsse-ng",
"gluino",

View File

@ -1,14 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "enderal-se",
"version-string": "1.0.0",
"name": "enderal-se-easy-crafting",
"version-string": "1.1",
"port-version": 0,
"description": "Enderal SE Helper",
"homepage": "https://eddoursul.win/mods/enderal-se/",
"description": "Enderal SE Easy Crafting",
"homepage": "https://eddoursul.win/mods/enderal-se-easy-crafting/",
"license": "LGPL-3.0",
"features": {
"plugin": {
"description": "Enderal SE functions and potion replacer.",
"description": "Automatic use of crafting supplies for Enderal SE 2.0.12+.",
"dependencies": [
"commonlibsse-ng",
"simpleini"