@ -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 ) {