parent
77ef7c15da
commit
e836f4134d
14 changed files with 143 additions and 1320 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,19 +0,0 @@ |
|||||||
#include "Papyrus.h" |
|
||||||
#include "PapyrusFunctions.h" |
|
||||||
|
|
||||||
namespace Papyrus |
|
||||||
{ |
|
||||||
bool Bind(VM* a_vm) |
|
||||||
{ |
|
||||||
if (!a_vm) { |
|
||||||
logger::critical("couldn't get VM State"sv); |
|
||||||
return false; |
|
||||||
} |
|
||||||
|
|
||||||
logger::info("{:*^30}", "FUNCTIONS"sv); |
|
||||||
|
|
||||||
PapyrusFunctions::Bind(*a_vm); |
|
||||||
|
|
||||||
return true; |
|
||||||
} |
|
||||||
} |
|
@ -1,15 +0,0 @@ |
|||||||
#pragma once |
|
||||||
|
|
||||||
#define BIND(a_method, ...) a_vm.RegisterFunction(#a_method##sv, script, a_method __VA_OPT__(, ) __VA_ARGS__) |
|
||||||
|
|
||||||
#include <RE/Skyrim.h> |
|
||||||
|
|
||||||
namespace Papyrus { |
|
||||||
using VM = RE::BSScript::Internal::VirtualMachine; |
|
||||||
using StackID = RE::VMStackID; |
|
||||||
using Severity = RE::BSScript::ErrorLogger::Severity; |
|
||||||
|
|
||||||
inline constexpr auto script = "ArtifactTrackerPlayer"sv; |
|
||||||
|
|
||||||
bool Bind(VM* a_vm); |
|
||||||
} |
|
@ -1,108 +0,0 @@ |
|||||||
#pragma once |
|
||||||
|
|
||||||
#include "ArtifactTracker.h" |
|
||||||
#include "Util.h" |
|
||||||
|
|
||||||
namespace Papyrus::PapyrusFunctions |
|
||||||
{ |
|
||||||
inline bool Load(RE::StaticFunctionTag*) |
|
||||||
{ |
|
||||||
return ArtifactTracker::Init(); |
|
||||||
} |
|
||||||
|
|
||||||
inline RE::TESObjectREFR* GetCellStorage(RE::StaticFunctionTag*) |
|
||||||
{ |
|
||||||
return ArtifactTracker::g_cellStorage; |
|
||||||
} |
|
||||||
|
|
||||||
inline void SyncCellStorage(RE::StaticFunctionTag*) |
|
||||||
{ |
|
||||||
ArtifactTracker::SyncCellStorage(); |
|
||||||
} |
|
||||||
|
|
||||||
inline std::uint32_t GetArtifactCount(RE::StaticFunctionTag*) |
|
||||||
{ |
|
||||||
return (ArtifactTracker::g_artifactMap).size(); |
|
||||||
} |
|
||||||
|
|
||||||
// From po3's Papyrus Extender
|
|
||||||
inline std::vector<RE::Actor*> GetPlayerFollowers(RE::StaticFunctionTag*) |
|
||||||
{ |
|
||||||
std::vector<RE::Actor*> result; |
|
||||||
|
|
||||||
if (const auto processLists = RE::ProcessLists::GetSingleton(); processLists) { |
|
||||||
for (auto& actorHandle : processLists->highActorHandles) { |
|
||||||
if (auto actor = actorHandle.get(); actor && actor->IsPlayerTeammate()) { |
|
||||||
result.push_back(actor.get()); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
return result; |
|
||||||
} |
|
||||||
|
|
||||||
inline RE::TESObjectREFR* GetCurrentContainer(RE::StaticFunctionTag*) |
|
||||||
{ |
|
||||||
const auto handle = RE::ContainerMenu::GetTargetRefHandle(); |
|
||||||
const auto refr = RE::TESObjectREFR::LookupByHandle(handle); |
|
||||||
return refr ? refr.get() : nullptr; |
|
||||||
} |
|
||||||
|
|
||||||
inline void RescanStoredArtifacts(RE::StaticFunctionTag*) |
|
||||||
{ |
|
||||||
ListRevert(ArtifactTracker::g_listStored); |
|
||||||
ArtifactTracker::AddRefArtifactsToList(ArtifactTracker::g_persistentStorage, ArtifactTracker::g_listStored); |
|
||||||
} |
|
||||||
|
|
||||||
inline void RescanFoundArtifacts(RE::StaticFunctionTag*) |
|
||||||
{ |
|
||||||
ListRevert(ArtifactTracker::g_listFound); |
|
||||||
ArtifactTracker::AddRefArtifactsToList(RE::PlayerCharacter::GetSingleton(), ArtifactTracker::g_listFound, ArtifactTracker::g_listStored); |
|
||||||
|
|
||||||
for (const auto& ref : GetPlayerFollowers(nullptr)) { |
|
||||||
ArtifactTracker::AddRefArtifactsToList(ref, ArtifactTracker::g_listFound, ArtifactTracker::g_listStored); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
inline void RescanNewArtifacts(RE::StaticFunctionTag*) |
|
||||||
{ |
|
||||||
for (auto const& item : ArtifactTracker::g_artifactMap) { |
|
||||||
if (!ArtifactTracker::g_listNew->HasForm(item.second) && !ArtifactTracker::g_listStored->HasForm(item.second) && !ArtifactTracker::g_listFound->HasForm(item.second)) { |
|
||||||
ArtifactTracker::g_listNew->AddForm(item.second); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
inline void RegisterPersistentStorage(RE::StaticFunctionTag*, |
|
||||||
RE::TESObjectREFR* ref) |
|
||||||
{ |
|
||||||
if (ref) { |
|
||||||
ArtifactTracker::g_persistentStorage->AddForm(ref); |
|
||||||
ArtifactTracker::g_persistentMap[ref->formID] = ref; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
inline void Bind(VM& a_vm) |
|
||||||
{ |
|
||||||
BIND(Load); |
|
||||||
logger::info("Registered Load"sv); |
|
||||||
BIND(GetArtifactCount); |
|
||||||
logger::info("Registered GetArtifactCount"sv); |
|
||||||
BIND(RescanStoredArtifacts); |
|
||||||
logger::info("Registered RescanStoredArtifacts"sv); |
|
||||||
BIND(RescanFoundArtifacts); |
|
||||||
logger::info("Registered RescanFoundArtifacts"sv); |
|
||||||
BIND(RescanNewArtifacts); |
|
||||||
logger::info("Registered RescanNewArtifacts"sv); |
|
||||||
BIND(GetCellStorage); |
|
||||||
logger::info("Registered GetCellStorage"sv); |
|
||||||
BIND(SyncCellStorage); |
|
||||||
logger::info("Registered SyncCellStorage"sv); |
|
||||||
BIND(GetPlayerFollowers); |
|
||||||
logger::info("Registered GetPlayerFollowers"sv); |
|
||||||
BIND(GetCurrentContainer); |
|
||||||
logger::info("Registered GetCurrentContainer"sv); |
|
||||||
BIND(RegisterPersistentStorage); |
|
||||||
logger::info("Registered RegisterPersistentStorage"sv); |
|
||||||
} |
|
||||||
} |
|
@ -1,80 +0,0 @@ |
|||||||
Scriptname ArtifactTrackerPlayer extends ReferenceAlias |
|
||||||
|
|
||||||
FormList Property ETR_ItemsNew Auto |
|
||||||
FormList Property ETR_ItemsFound Auto |
|
||||||
FormList Property ETR_ItemsStored Auto |
|
||||||
|
|
||||||
int iArtifactCount = 0 |
|
||||||
|
|
||||||
|
|
||||||
event OnInit() |
|
||||||
Utility.wait(3.0) ; wait for quickstart scripts to finish |
|
||||||
OnPlayerLoadGame() |
|
||||||
endevent |
|
||||||
|
|
||||||
|
|
||||||
Event OnPlayerLoadGame() |
|
||||||
|
|
||||||
if ! Load() |
|
||||||
ETR_ItemsNew.Revert() |
|
||||||
ETR_ItemsFound.Revert() |
|
||||||
ETR_ItemsStored.Revert() |
|
||||||
UnregisterForUpdate() |
|
||||||
Debug.Notification("Failed to initialize ArtifactTracker.dll") |
|
||||||
return |
|
||||||
endif |
|
||||||
|
|
||||||
if skse.GetPluginVersion("Ahzaab's moreHUD Plugin") >= 30800 |
|
||||||
ahzmorehud.RegisterIconFormList("dbmNew", ETR_ItemsNew) |
|
||||||
ahzmorehud.RegisterIconFormList("dbmFound", ETR_ItemsFound) |
|
||||||
ahzmorehud.RegisterIconFormList("dbmDisp", ETR_ItemsStored) |
|
||||||
endif |
|
||||||
|
|
||||||
if skse.GetPluginVersion("Ahzaab's moreHUD Inventory Plugin") >= 10017 |
|
||||||
ahzmorehudie.RegisterIconFormList("dbmNew", ETR_ItemsNew) |
|
||||||
ahzmorehudie.RegisterIconFormList("dbmFound", ETR_ItemsFound) |
|
||||||
ahzmorehudie.RegisterIconFormList("dbmDisp", ETR_ItemsStored) |
|
||||||
endif |
|
||||||
|
|
||||||
if SKSE.GetPluginVersion("QuickLootEE") >= 0 |
|
||||||
QuickLootEE.RegisterNewItemsList(ETR_ItemsNew) |
|
||||||
QuickLootEE.RegisterDisplayedItemsList(ETR_ItemsStored) |
|
||||||
QuickLootEE.RegisterFoundItemsList(ETR_ItemsFound) |
|
||||||
endif |
|
||||||
|
|
||||||
int iNewArtifactCount = GetArtifactCount() |
|
||||||
if iNewArtifactCount != iArtifactCount |
|
||||||
iArtifactCount = iNewArtifactCount |
|
||||||
Debug.Notification("Artifact list changed, rebuilding the list") |
|
||||||
ETR_ItemsNew.Revert() ; rebuild the list |
|
||||||
endif |
|
||||||
|
|
||||||
; Rebuild all lists to avoid discrepancies, stale data, and broken records |
|
||||||
RescanStoredArtifacts() |
|
||||||
RescanFoundArtifacts() |
|
||||||
RescanNewArtifacts() |
|
||||||
|
|
||||||
EndEvent |
|
||||||
|
|
||||||
|
|
||||||
; NATIVE FUNCTIONS |
|
||||||
|
|
||||||
bool function Load() native global |
|
||||||
|
|
||||||
int function GetArtifactCount() native global |
|
||||||
|
|
||||||
function RescanStoredArtifacts() native global |
|
||||||
|
|
||||||
function RescanFoundArtifacts() native global |
|
||||||
|
|
||||||
function RescanNewArtifacts() native global |
|
||||||
|
|
||||||
ObjectReference function GetCellStorage() native global |
|
||||||
|
|
||||||
ObjectReference function GetCurrentContainer() native global |
|
||||||
|
|
||||||
function SyncCellStorage() native global |
|
||||||
|
|
||||||
Actor[] function GetPlayerFollowers() native global |
|
||||||
|
|
||||||
function RegisterPersistentStorage(ObjectReference ref) native global |
|
File diff suppressed because it is too large
Load Diff
@ -1,33 +0,0 @@ |
|||||||
Scriptname QuickLootEE Hidden |
|
||||||
{Script used for adding custom icons to QuickLootEE} |
|
||||||
|
|
||||||
int Function GetVersion() global native |
|
||||||
{Gets the version e.g 292 for 2.9.2} |
|
||||||
|
|
||||||
;iEquip Functions --------------------------------------- |
|
||||||
|
|
||||||
Function RegisterNewItemsList(FormList alist) global native |
|
||||||
{Registers a form list to be used to check wheather an item is not |
|
||||||
displayed in LOTD and is not in our inventory or LOTD containers.} |
|
||||||
|
|
||||||
Function RegisterFoundItemsList(FormList alist) global native |
|
||||||
{Registers a form list to be used to check wheather an item is not |
|
||||||
displayed in LOTD and is in our inventory or LOTD containers.} |
|
||||||
|
|
||||||
Function RegisterDisplayedItemsList(FormList alist) global native |
|
||||||
{Registers a form list to be used to check wheather an item is displayed in LOTD.} |
|
||||||
|
|
||||||
; Gets the version as a string for viewing |
|
||||||
string Function GetVersionString() global |
|
||||||
int iVersion = QuickLootEE.GetVersion() |
|
||||||
|
|
||||||
if (iVersion == 0) |
|
||||||
return "" |
|
||||||
endif |
|
||||||
|
|
||||||
int iMajor = iVersion / 100 |
|
||||||
int iMinor = (iVersion / 10) % 10 |
|
||||||
int iBug = iVersion % 10 |
|
||||||
string aVersion = iMajor + "." + iMinor + "." + iBug |
|
||||||
return aVersion |
|
||||||
EndFunction |
|
Loading…
Reference in new issue