From ccde5d4d6559207be6a4d0da0ed5031cdb878841 Mon Sep 17 00:00:00 2001 From: SeaSparrow Date: Fri, 24 Apr 2026 19:54:05 +0300 Subject: [PATCH 1/2] Update compiler settings --- .gitignore | 1 + CMakeLists.txt | 2 +- CMakePresets.json | 19 +++++++++---------- External/CommonLibSSE | 2 +- src/Export/SKSEPlugin.cpp | 4 ++-- src/Hooks/Training/TrainingHooks.cpp | 2 +- vcpkg.json | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 560e9aa..1d23c62 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /build-ng /build-test /build-outdated +/out/build/x64-debug diff --git a/CMakeLists.txt b/CMakeLists.txt index 006a3b7..b5c4123 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ option(OUTDATED "Applies 1.5.97 offsets/IDs." OFF) # -------- Project ---------- project( CurrencySwapper - VERSION 2.0.1 + VERSION 2.0.2 LANGUAGES CXX ) diff --git a/CMakePresets.json b/CMakePresets.json index ab0a33d..3ee9785 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -31,10 +31,9 @@ } }, { - "name": "vs2022", + "name": "vs", "hidden": true, - "generator": "Visual Studio 17 2022", - "toolset": "v143" + "generator": "Visual Studio 18 2026" }, { "name": "release", @@ -59,12 +58,12 @@ } }, { - "name": "vs2022-windows-vcpkg-release", + "name": "vs-windows-vcpkg-release", "inherits": [ "cmake-dev", "vcpkg", "windows", - "vs2022", + "vs", "release" ], "cacheVariables": { @@ -77,7 +76,7 @@ "cmake-dev", "vcpkg", "windows", - "vs2022", + "vs", "outdated" ], "cacheVariables": { @@ -85,12 +84,12 @@ } }, { - "name": "vs2022-windows-vcpkg-test", + "name": "vs-windows-vcpkg-test", "inherits": [ "cmake-dev", "vcpkg", "windows", - "vs2022", + "vs", "test" ], "cacheVariables": { @@ -101,12 +100,12 @@ "buildPresets": [ { "name": "Release", - "configurePreset": "vs2022-windows-vcpkg-release", + "configurePreset": "vs-windows-vcpkg-release", "configuration": "Release" }, { "name": "Test", - "configurePreset": "vs2022-windows-vcpkg-test", + "configurePreset": "vs-windows-vcpkg-test", "configuration": "Debug" } ] diff --git a/External/CommonLibSSE b/External/CommonLibSSE index a89d437..1baab74 160000 --- a/External/CommonLibSSE +++ b/External/CommonLibSSE @@ -1 +1 @@ -Subproject commit a89d437ddfe127fa22f642e5ad65c18c1f56ea92 +Subproject commit 1baab74e478b7d965c5881f7f8c31cc19227adf0 diff --git a/src/Export/SKSEPlugin.cpp b/src/Export/SKSEPlugin.cpp index 77ebc31..8412b85 100644 --- a/src/Export/SKSEPlugin.cpp +++ b/src/Export/SKSEPlugin.cpp @@ -51,7 +51,7 @@ extern "C" DLLEXPORT bool SKSEAPI SKSEPlugin_Query(const SKSE::QueryInterface* a const auto ver = a_skse->RuntimeVersion(); #ifdef SKYRIM_AE - if (ver < SKSE::RUNTIME_1_6_1130) { + if (ver < SKSE::RUNTIME_SSE_1_6_1130) { #else if (ver < SKSE::RUNTIME_1_5_39) { #endif @@ -77,7 +77,7 @@ extern "C" DLLEXPORT bool SKSEAPI SKSEPlugin_Load(const SKSE::LoadInterface * a_ #ifdef SKYRIM_AE const auto ver = a_skse->RuntimeVersion(); - if (ver < SKSE::RUNTIME_1_6_1130) { + if (ver < SKSE::RUNTIME_SSE_1_6_1130) { return false; } #endif diff --git a/src/Hooks/Training/TrainingHooks.cpp b/src/Hooks/Training/TrainingHooks.cpp index d0b931e..7e69ec0 100644 --- a/src/Hooks/Training/TrainingHooks.cpp +++ b/src/Hooks/Training/TrainingHooks.cpp @@ -52,7 +52,7 @@ namespace Hooks::Training { auto* currency = CurrencyManager::GetCurrency(); if (currency) { - RE::DebugNotification( + RE::SendHUDMessage::ShowHUDMessage( fmt::format("You don't have enough {}", currency->GetName()).c_str(), a_sound, a_cancelIfQueued); diff --git a/vcpkg.json b/vcpkg.json index 7af22fb..742aa83 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "currency-swapper", - "version-string": "2.0.0", + "version-string": "2.0.2", "description": "Allows for the manipulation of the game's default currency through scripts.", "homepage": "https://github.com/SeaSparrowOG/CurrencySwapper", "license": "MIT", From 12d5d991fbe119a43ffd50970c9d75fa5e247441 Mon Sep 17 00:00:00 2001 From: SeaSparrow Date: Fri, 24 Apr 2026 19:54:24 +0300 Subject: [PATCH 2/2] Fix compatibility --- src/CurrencyManager/CurrencyManager.cpp | 57 ++++++++++++++----------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/src/CurrencyManager/CurrencyManager.cpp b/src/CurrencyManager/CurrencyManager.cpp index c9470d7..1b778a1 100644 --- a/src/CurrencyManager/CurrencyManager.cpp +++ b/src/CurrencyManager/CurrencyManager.cpp @@ -507,7 +507,7 @@ namespace CurrencyManager bool CurrencyManager::SendNotEnoughGoldWarning() { if (customCurrency) { customPurchaseFail.QueueEvent(customCurrency); - RE::DebugNotification(fmt::format("You don't have enough {}", customCurrency->GetName()).c_str()); + RE::SendHUDMessage::ShowHUDMessage(fmt::format("You don't have enough {}", customCurrency->GetName()).c_str()); LOG_DEBUG(" >deal was rejected, returning: {}"sv, fmt::format("You don't have enough {}", customCurrency->GetName())); return true; } @@ -532,7 +532,7 @@ namespace CurrencyManager if (!menu) return; RE::GFxValue var; - bool useSkyUIPaths = dh->LookupLoadedModByName("SkyUI_SE.esp"sv); + static bool useSkyUIPaths = dh->LookupModByName("SkyUI_SE.esp"sv) != nullptr; if (useSkyUIPaths) { menu->GetVariable(&var, pathToVendorLabel_SkyUI); } @@ -606,54 +606,61 @@ namespace CurrencyManager } std::string currencyName = customCurrency->GetName(); - bool useSkyUIPaths = dh->LookupLoadedModByName("SkyUI_SE.esp"sv); - RE::GFxValue var; + static bool useSkyUIPaths = dh->LookupModByName("SkyUI_SE.esp"sv) != nullptr; + RE::GFxValue vendorGoldValue; + RE::GFxValue playerGoldValue; if (!playerLabelOverride.empty() && !vendorLabelOverride.empty()) { - menu->GetVariable(&var, playerLabelOverride.c_str()); - if (var.IsUndefined()) { + menu->GetVariable(&vendorGoldValue, vendorLabelOverride.c_str()); + if (vendorGoldValue.IsUndefined()) { return Control::kContinue; } - var.SetText(currencyName.c_str()); - - menu->GetVariable(&var, vendorLabelOverride.c_str()); - if (var.IsUndefined()) { + menu->GetVariable(&playerGoldValue, playerLabelOverride.c_str()); + if (playerGoldValue.IsUndefined()) { return Control::kContinue; } } else if (useSkyUIPaths) { - menu->GetVariable(&var, pathToPlayerLabel_SkyUI); - if (var.IsUndefined()) { + menu->GetVariable(&vendorGoldValue, pathToVendorLabel_SkyUI); + if (vendorGoldValue.IsUndefined()) { return Control::kContinue; } - var.SetText(currencyName.c_str()); - - menu->GetVariable(&var, pathToVendorLabel_SkyUI); - if (var.IsUndefined()) { + menu->GetVariable(&playerGoldValue, pathToPlayerLabel_SkyUI); + if (playerGoldValue.IsUndefined()) { return Control::kContinue; } } else { - menu->GetVariable(&var, pathToPlayerLabel); - if (var.IsUndefined()) { + menu->GetVariable(&vendorGoldValue, pathToVendorLabel); + if (vendorGoldValue.IsUndefined()) { return Control::kContinue; } - var.SetText(currencyName.c_str()); - - menu->GetVariable(&var, pathToVendorLabel); - if (var.IsUndefined()) { + menu->GetVariable(&playerGoldValue, pathToPlayerLabel); + if (playerGoldValue.IsUndefined()) { return Control::kContinue; } } + if (!playerGoldValue.SetText(currencyName.c_str())) { + LOG_DEBUG(" >Failed to update player label text."sv); + } + else { + LOG_DEBUG(" >Updated player label text to: {}"sv, currencyName); + } auto* dialogueTargetRef = RE::TESForm::LookupByID(barterActorID); + bool updatedVendor = false; if (dialogueTargetRef && dialogueTargetRef->Is3DLoaded()) { - currencyName = fmt::format("{} {}", dialogueTargetRef->GetName(), currencyName); + updatedVendor = vendorGoldValue.SetText(fmt::format("{} {}", dialogueTargetRef->GetName(), currencyName).c_str()); + } + else { + updatedVendor = vendorGoldValue.SetText(fmt::format("Vendor {}", currencyName).c_str()); + } + if (!updatedVendor) { + LOG_DEBUG(" >Failed to update vendor label text."sv); } else { - currencyName = fmt::format("Vendor {}", currencyName); + LOG_DEBUG(" >Updated vendor label text to: {}"sv, dialogueTargetRef && dialogueTargetRef->Is3DLoaded() ? fmt::format("{} {}", dialogueTargetRef->GetName(), currencyName) : fmt::format("Vendor {}", currencyName)); } - var.SetText(currencyName.c_str()); auto trainingMenu = ui->GetMenu(); if (!trainingMenu) {