1
Fork 0

Cleanup for 1.0

ae-1.6.629
Eddoursul 2 years ago
parent 41940cc4f3
commit 85581cf147
  1. BIN
      SKSE/Plugins/ArtifactTracker.dll
  2. 8
      Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp
  3. 17
      Source/ArtifactTrackerDLL/src/Util.h

Binary file not shown.

@ -64,7 +64,7 @@ namespace ArtifactTracker
std::map<std::string, bool> settings{
{ "DumpItemList", false },
{ "NewArtifactNotifications", true },
{ "NewArtifactNotifications", false },
};
LoadINI(&settings, "Data/SKSE/Plugins/ArtifactTracker.ini");
@ -177,7 +177,6 @@ namespace ArtifactTracker
std::uint32_t savedCount = g_listStored->forms.size() + g_listFound->forms.size() + g_listNew->forms.size();
if (savedCount != g_artifactMap.size()) {
log::info("Reverting g_listNew");
ListRevert(g_listNew);
}
@ -224,6 +223,8 @@ namespace ArtifactTracker
log::error("MoreHUD Inventory Edition has not been detected.");
}
// TODO: Uncomment when/if QuickLoot EE brings back registering formlists
/*
if (const auto pluginInfo = g_loadInterface->GetPluginInfo("QuickLootEE"); pluginInfo) {
if (!g_bLoaded) log::info("Detected {} v{}", pluginInfo->name, pluginInfo->version);
if (pluginInfo->version == 0) {
@ -239,6 +240,7 @@ namespace ArtifactTracker
} else if (!g_bLoaded) {
log::error("QuickLoot EE has not been detected.");
}
*/
}
void SetContainerMode(const bool bOpening)
@ -285,7 +287,6 @@ namespace ArtifactTracker
if (cellStorage) {
g_bHomeContainer = false;
g_cellStorage = cellStorage;
//RE::UI::GetSingleton()->AddEventSink<RE::MenuOpenCloseEvent>(EventListener::GetSingleton());
RE::ScriptEventSourceHolder::GetSingleton()->AddEventSink<RE::TESActivateEvent>(EventListener::GetSingleton());
#ifdef _DEBUG
log::info("Home mode ON");
@ -294,7 +295,6 @@ namespace ArtifactTracker
} else if (g_cellStorage) {
g_bHomeContainer = false;
g_cellStorage = nullptr;
//RE::UI::GetSingleton()->RemoveEventSink<RE::MenuOpenCloseEvent>(EventListener::GetSingleton());
RE::ScriptEventSourceHolder::GetSingleton()->RemoveEventSink<RE::TESActivateEvent>(EventListener::GetSingleton());
#ifdef _DEBUG
log::info("Home mode OFF");

@ -2,6 +2,9 @@
#include <SimpleIni.h>
using namespace SKSE;
using namespace SKSE::log;
inline void ListRemoveItem(RE::BGSListForm* a_List, RE::TESForm* a_form)
{
using func_t = decltype(&ListRemoveItem);
@ -83,7 +86,7 @@ inline std::int32_t GetItemCount(RE::TESObjectREFR* a_container, RE::FormID a_fo
inline bool RefListHasItem(RE::TESForm* a_refOrList, RE::FormID a_formID)
{
if (!a_refOrList || !a_formID) {
SKSE::log::warn("Invalid arguments in RefHasItem");
log::warn("Invalid arguments in RefListHasItem");
return false;
}
@ -135,11 +138,11 @@ inline bool IsInSameCell(RE::TESObjectREFR* ref)
inline void LoadINI(std::map<std::string, bool>* settings, const char* iniPath)
{
for (auto it = settings->begin(); it != settings->end(); it++) {
SKSE::log::info("[DEFAULT] {} = {}", it->first, it->second);
log::info("[DEFAULT] {} = {}", it->first, it->second);
}
if (!std::filesystem::exists(iniPath)) {
SKSE::log::warn("{} does not exist, using default values.", iniPath);
log::warn("{} does not exist, using default values.", iniPath);
return;
}
@ -158,7 +161,7 @@ inline void LoadINI(std::map<std::string, bool>* settings, const char* iniPath)
for (const auto& k : keysList) {
if (it->first == k.pItem) {
settings->insert_or_assign(k.pItem, ini.GetBoolValue("", k.pItem, settings->at(k.pItem)));
SKSE::log::info("[INI] {} = {}", k.pItem, settings->at(k.pItem));
log::info("[INI] {} = {}", k.pItem, settings->at(k.pItem));
bExists = true;
break;
}
@ -170,12 +173,12 @@ inline void LoadINI(std::map<std::string, bool>* settings, const char* iniPath)
}
if (bUpdateINI) {
SKSE::log::info("New settings detected, adding to ArtifactTracker.ini");
log::info("New settings detected, adding to ArtifactTracker.ini");
ini.SaveFile(iniPath);
}
} catch (const std::exception& e) {
SKSE::log::error(e.what());
log::error(e.what());
}
}
@ -186,7 +189,7 @@ inline void RunBenchmark(std::function<void()> benchmark, std::string desc)
const auto end = std::chrono::high_resolution_clock::now();
const auto elapsed = std::chrono::duration<double>(end - start);
SKSE::log::info("{}: Elapsed time: {} seconds", desc, elapsed.count());
log::info("{}: Elapsed time: {} seconds", desc, elapsed.count());
}
inline std::vector<RE::Actor*> GetPlayerFollowers()

Loading…
Cancel
Save