Added dependency checks and warnings
This commit is contained in:
parent
4220779b99
commit
c01fbe9265
Binary file not shown.
@ -6,7 +6,7 @@ message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
|
|||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
project(
|
project(
|
||||||
ArtifactTracker
|
ArtifactTracker
|
||||||
VERSION 1.0.5
|
VERSION 1.0.6
|
||||||
DESCRIPTION "Artifact Tracker"
|
DESCRIPTION "Artifact Tracker"
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
@ -14,6 +14,7 @@ namespace ArtifactTracker
|
|||||||
bool g_bBookShelf = false;
|
bool g_bBookShelf = false;
|
||||||
bool g_bTakeAll = false;
|
bool g_bTakeAll = false;
|
||||||
bool g_bNotifyNewArtifact = false;
|
bool g_bNotifyNewArtifact = false;
|
||||||
|
bool g_bWarnMissingMoreHUD = true;
|
||||||
std::uint32_t g_bTakeAllCount = 0;
|
std::uint32_t g_bTakeAllCount = 0;
|
||||||
std::int32_t g_iFollowerIndex = 0;
|
std::int32_t g_iFollowerIndex = 0;
|
||||||
RE::TESBoundObject* g_cellContainer;
|
RE::TESBoundObject* g_cellContainer;
|
||||||
@ -67,10 +68,13 @@ namespace ArtifactTracker
|
|||||||
std::map<std::string, bool> settings{
|
std::map<std::string, bool> settings{
|
||||||
{ "DumpItemList", false },
|
{ "DumpItemList", false },
|
||||||
{ "NewArtifactNotifications", false },
|
{ "NewArtifactNotifications", false },
|
||||||
|
{ "WarnMissingMoreHUD", true },
|
||||||
|
{ "WarnMissingKID", true },
|
||||||
};
|
};
|
||||||
LoadINI(&settings, "Data/SKSE/Plugins/ArtifactTracker.ini");
|
LoadINI(&settings, "Data/SKSE/Plugins/ArtifactTracker.ini");
|
||||||
|
|
||||||
g_bNotifyNewArtifact = settings.at("NewArtifactNotifications");
|
g_bNotifyNewArtifact = settings.at("NewArtifactNotifications");
|
||||||
|
g_bWarnMissingMoreHUD = settings.at("WarnMissingMoreHUD");
|
||||||
|
|
||||||
// Preloading item lists
|
// Preloading item lists
|
||||||
|
|
||||||
@ -145,6 +149,12 @@ namespace ArtifactTracker
|
|||||||
OnGameLoad(); // covers new game and coc'ing from the main menu
|
OnGameLoad(); // covers new game and coc'ing from the main menu
|
||||||
g_bLoaded = true;
|
g_bLoaded = true;
|
||||||
|
|
||||||
|
if (bKID) {
|
||||||
|
log::info("Keyword Item Distributor is detected.");
|
||||||
|
} else {
|
||||||
|
log::info("Keyword Item Distributor has NOT been detected, using the baseline configuration.");
|
||||||
|
}
|
||||||
|
|
||||||
RE::ConsoleLog::GetSingleton()->Print(std::format("Artifact Tracker registered {} items.", g_artifactMap.size()).c_str());
|
RE::ConsoleLog::GetSingleton()->Print(std::format("Artifact Tracker registered {} items.", g_artifactMap.size()).c_str());
|
||||||
|
|
||||||
log::info("Total artifacts: {}", g_artifactMap.size());
|
log::info("Total artifacts: {}", g_artifactMap.size());
|
||||||
@ -155,6 +165,14 @@ namespace ArtifactTracker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataHandler->LookupLoadedModByName("DBM_RelicNotifications.esp")) {
|
||||||
|
RE::DebugMessageBox("Artifact Tracker is incompatible with The Curator's Companion.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bKID && settings.at("WarnMissingKID")) {
|
||||||
|
RE::DebugMessageBox("Artifact Tracker requires Keyword Item Distributor. If its absence is intentional, set WarnMissingKID=false in ArtifactTracker.ini.");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +217,7 @@ namespace ArtifactTracker
|
|||||||
const auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
|
const auto vm = RE::BSScript::Internal::VirtualMachine::GetSingleton();
|
||||||
RE::BSTSmartPointer<RE::BSScript::IStackCallbackFunctor> stackCallback;
|
RE::BSTSmartPointer<RE::BSScript::IStackCallbackFunctor> stackCallback;
|
||||||
|
|
||||||
|
bool bMoreHUDInstalled = false;
|
||||||
if (const auto pluginInfo = g_loadInterface->GetPluginInfo("Ahzaab's moreHUD Plugin"); pluginInfo) {
|
if (const auto pluginInfo = g_loadInterface->GetPluginInfo("Ahzaab's moreHUD Plugin"); pluginInfo) {
|
||||||
if (!g_bLoaded) log::info("Detected {} v{}", pluginInfo->name, pluginInfo->version);
|
if (!g_bLoaded) log::info("Detected {} v{}", pluginInfo->name, pluginInfo->version);
|
||||||
if (pluginInfo->version == 0) {
|
if (pluginInfo->version == 0) {
|
||||||
@ -210,6 +229,7 @@ namespace ArtifactTracker
|
|||||||
vm->DispatchStaticCall("AhzMoreHud", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmNew", std::move(g_listNew)), stackCallback);
|
vm->DispatchStaticCall("AhzMoreHud", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmNew", std::move(g_listNew)), stackCallback);
|
||||||
vm->DispatchStaticCall("AhzMoreHud", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmFound", std::move(g_listFound)), stackCallback);
|
vm->DispatchStaticCall("AhzMoreHud", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmFound", std::move(g_listFound)), stackCallback);
|
||||||
vm->DispatchStaticCall("AhzMoreHud", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmDisp", std::move(g_listStored)), stackCallback);
|
vm->DispatchStaticCall("AhzMoreHud", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmDisp", std::move(g_listStored)), stackCallback);
|
||||||
|
bMoreHUDInstalled = true;
|
||||||
} else {
|
} else {
|
||||||
log::error("MoreHUD has not been installed correctly.");
|
log::error("MoreHUD has not been installed correctly.");
|
||||||
}
|
}
|
||||||
@ -217,6 +237,7 @@ namespace ArtifactTracker
|
|||||||
log::error("MoreHUD has not been detected.");
|
log::error("MoreHUD has not been detected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool bMoreHUDInvInstalled = false;
|
||||||
if (const auto pluginInfo = g_loadInterface->GetPluginInfo("Ahzaab's moreHUD Inventory Plugin"); pluginInfo) {
|
if (const auto pluginInfo = g_loadInterface->GetPluginInfo("Ahzaab's moreHUD Inventory Plugin"); pluginInfo) {
|
||||||
if (!g_bLoaded) log::info("Detected {} v{}", pluginInfo->name, pluginInfo->version);
|
if (!g_bLoaded) log::info("Detected {} v{}", pluginInfo->name, pluginInfo->version);
|
||||||
if (pluginInfo->version == 0) {
|
if (pluginInfo->version == 0) {
|
||||||
@ -228,6 +249,7 @@ namespace ArtifactTracker
|
|||||||
vm->DispatchStaticCall("AhzMoreHudIE", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmNew", std::move(g_listNew)), stackCallback);
|
vm->DispatchStaticCall("AhzMoreHudIE", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmNew", std::move(g_listNew)), stackCallback);
|
||||||
vm->DispatchStaticCall("AhzMoreHudIE", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmFound", std::move(g_listFound)), stackCallback);
|
vm->DispatchStaticCall("AhzMoreHudIE", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmFound", std::move(g_listFound)), stackCallback);
|
||||||
vm->DispatchStaticCall("AhzMoreHudIE", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmDisp", std::move(g_listStored)), stackCallback);
|
vm->DispatchStaticCall("AhzMoreHudIE", "RegisterIconFormList", RE::MakeFunctionArguments<RE::BSString, RE::BGSListForm*>("dbmDisp", std::move(g_listStored)), stackCallback);
|
||||||
|
bool bMoreHUDInvInstalled = true;
|
||||||
} else {
|
} else {
|
||||||
log::error("MoreHUD Inventory Edition has not been installed correctly.");
|
log::error("MoreHUD Inventory Edition has not been installed correctly.");
|
||||||
}
|
}
|
||||||
@ -235,6 +257,10 @@ namespace ArtifactTracker
|
|||||||
log::error("MoreHUD Inventory Edition has not been detected.");
|
log::error("MoreHUD Inventory Edition has not been detected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_bWarnMissingMoreHUD && !bMoreHUDInstalled && !bMoreHUDInvInstalled) {
|
||||||
|
RE::DebugMessageBox("Artifact Tracker requires up-to-date MoreHUD and/or MoreHUD Inventory Edition. If their absence is intentional, set WarnMissingMoreHUD=false in ArtifactTracker.ini.");
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Uncomment when/if QuickLoot EE brings back registering formlists
|
// TODO: Uncomment when/if QuickLoot EE brings back registering formlists
|
||||||
/*
|
/*
|
||||||
if (const auto pluginInfo = g_loadInterface->GetPluginInfo("QuickLootEE"); pluginInfo) {
|
if (const auto pluginInfo = g_loadInterface->GetPluginInfo("QuickLootEE"); pluginInfo) {
|
||||||
|
@ -178,7 +178,7 @@ inline void LoadINI(std::map<std::string, bool>* settings, const char* iniPath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
log::error(e.what());
|
log::error("{}", e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
|
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
|
||||||
"name": "artifact-tracker",
|
"name": "artifact-tracker",
|
||||||
"version-string": "1.0.5",
|
"version-string": "1.0.6",
|
||||||
"port-version": 0,
|
"port-version": 0,
|
||||||
"description": "Artifact Tracker",
|
"description": "Artifact Tracker",
|
||||||
"homepage": "https://eddoursul.win/mods/artifact-tracker/",
|
"homepage": "https://eddoursul.win/mods/artifact-tracker/",
|
||||||
|
Loading…
Reference in New Issue
Block a user