Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/build-ng
/build-test
/build-outdated
/out/build/x64-debug
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
19 changes: 9 additions & 10 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
}
},
{
"name": "vs2022",
"name": "vs",
"hidden": true,
"generator": "Visual Studio 17 2022",
"toolset": "v143"
"generator": "Visual Studio 18 2026"
},
{
"name": "release",
Expand All @@ -59,12 +58,12 @@
}
},
{
"name": "vs2022-windows-vcpkg-release",
"name": "vs-windows-vcpkg-release",
"inherits": [
"cmake-dev",
"vcpkg",
"windows",
"vs2022",
"vs",
"release"
],
"cacheVariables": {
Expand All @@ -77,20 +76,20 @@
"cmake-dev",
"vcpkg",
"windows",
"vs2022",
"vs",
"outdated"
],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "vs2022-windows-vcpkg-test",
"name": "vs-windows-vcpkg-test",
"inherits": [
"cmake-dev",
"vcpkg",
"windows",
"vs2022",
"vs",
"test"
],
"cacheVariables": {
Expand All @@ -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"
}
]
Expand Down
2 changes: 1 addition & 1 deletion External/CommonLibSSE
Submodule CommonLibSSE updated 556 files
57 changes: 32 additions & 25 deletions src/CurrencyManager/CurrencyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
}
Expand Down Expand Up @@ -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<RE::Actor>(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<RE::BarterMenu>();
if (!trainingMenu) {
Expand Down
4 changes: 2 additions & 2 deletions src/Export/SKSEPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Hooks/Training/TrainingHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Loading