Added support for 1.6.629+

master
Eddoursul 2 years ago
parent edd4f9ff5d
commit a299275ba7
  1. BIN
      SKSE/Plugins/EnderalSEEasyCrafting.dll
  2. 2
      SKSE/Plugins/EnderalSEEasyCrafting.ini
  3. 2
      src/CMakeLists.txt
  4. 9
      src/src/EventListener.cpp
  5. 26
      src/src/Main.cpp
  6. 4
      src/src/Util.h
  7. 22
      src/vcpkg-configuration.json
  8. 10
      src/vcpkg.json

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

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

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

@ -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,24 +23,15 @@ namespace {
spdlog::set_default_logger(std::move(log));
spdlog::set_pattern("[%l] %v"s);
}
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) {
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);
}
InitializeLogging();
auto* plugin = PluginDeclaration::GetSingleton();
@ -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;

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

@ -1,15 +1,15 @@
{
"registries": [
{
"kind": "git",
"repository": "https://gitlab.com/colorglass/vcpkg-colorglass",
"baseline": "5a11d06fd1b2d7cd6339d6aea48d450309e89cc1",
"packages": [
"commonlibsse-ng",
"gluino",
"script-extender-common",
"skse"
]
}
{
"kind": "git",
"repository": "https://gitlab.com/colorglass/vcpkg-colorglass",
"baseline": "1b279b20c7e0db1c9d549ff3b64e024c01317b55",
"packages": [
"commonlibsse-ng",
"gluino",
"script-extender-common",
"skse"
]
}
]
}

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

Loading…
Cancel
Save