|
|
|
@ -46,7 +46,15 @@ namespace ArtifactTracker |
|
|
|
|
|
|
|
|
|
SKSE::GetModCallbackEventSource()->RemoveEventSink(EventListener::GetSingleton()); |
|
|
|
|
|
|
|
|
|
g_cellContainer = dataHandler->LookupForm(0x804, "Artifact Tracker.esp")->As<RE::TESBoundObject>(); // ETR_CellStorageContainer
|
|
|
|
|
if (!dataHandler->GetLoadedLightModIndex("Artifact Tracker.esp")) { |
|
|
|
|
log::warn("Artifact Tracker.esp is not loaded"); |
|
|
|
|
RE::DebugMessageBox("Unable to find Artifact Tracker.esp, the mod is disabled."); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (const auto& form = dataHandler->LookupForm(0x804, "Artifact Tracker.esp")) { |
|
|
|
|
g_cellContainer = form->As<RE::TESBoundObject>(); // ETR_CellStorageContainer
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
g_listNew = dataHandler->LookupForm<RE::BGSListForm>(0x800, "Artifact Tracker.esp"); // ETR_ItemsNew
|
|
|
|
|
g_listStored = dataHandler->LookupForm<RE::BGSListForm>(0x801, "Artifact Tracker.esp"); // ETR_ItemsStored
|
|
|
|
@ -85,6 +93,9 @@ namespace ArtifactTracker |
|
|
|
|
g_artifactAllFormTypes.insert(RE::FormType::AlchemyItem); |
|
|
|
|
g_artifactAllFormTypes.insert(RE::FormType::Ingredient); |
|
|
|
|
g_artifactAllFormTypes.insert(RE::FormType::SoulGem); |
|
|
|
|
g_artifactAllFormTypes.insert(RE::FormType::Ammo); |
|
|
|
|
g_artifactAllFormTypes.insert(RE::FormType::Scroll); |
|
|
|
|
g_artifactAllFormTypes.insert(RE::FormType::KeyMaster); |
|
|
|
|
|
|
|
|
|
g_artifactFormTypes.insert(RE::FormType::Weapon); |
|
|
|
|
for (const auto& form : dataHandler->GetFormArray<RE::TESObjectWEAP>()) { |
|
|
|
@ -145,6 +156,27 @@ namespace ArtifactTracker |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (const auto& form : dataHandler->GetFormArray<RE::TESAmmo>()) { |
|
|
|
|
if (form->GetPlayable() && form->AsKeywordForm()->HasKeyword(extraArtifactKeyword) && !form->AsKeywordForm()->HasKeyword(notArtifactKeyword)) { |
|
|
|
|
g_artifactMap[form->formID] = form; |
|
|
|
|
g_artifactFormTypes.insert(RE::FormType::Ammo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (const auto& form : dataHandler->GetFormArray<RE::ScrollItem>()) { |
|
|
|
|
if (form->HasKeyword(extraArtifactKeyword) && !form->HasKeyword(notArtifactKeyword)) { |
|
|
|
|
g_artifactMap[form->formID] = form; |
|
|
|
|
g_artifactFormTypes.insert(RE::FormType::Scroll); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (const auto& form : dataHandler->GetFormArray<RE::TESKey>()) { |
|
|
|
|
if (form->HasKeyword(extraArtifactKeyword) && !form->HasKeyword(notArtifactKeyword)) { |
|
|
|
|
g_artifactMap[form->formID] = form; |
|
|
|
|
g_artifactFormTypes.insert(RE::FormType::KeyMaster); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
EventListener::Install(); |
|
|
|
|
OnGameLoad(); // covers new game and coc'ing from the main menu
|
|
|
|
|
|
|
|
|
|