|
|
|
@ -93,6 +93,31 @@ inline void FetchSuppliesByType(RE::FormType formType) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void FetchSuppliesByForm(RE::TESForm* a_form) |
|
|
|
|
{ |
|
|
|
|
if (!a_form) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const auto chest = RE::TESForm::LookupByID(0x5C132)->As<RE::TESObjectREFR>(); |
|
|
|
|
const auto targetRef = RE::PlayerCharacter::GetSingleton(); |
|
|
|
|
|
|
|
|
|
const auto inv = chest->GetInventory([&](RE::TESBoundObject& a_xform) { |
|
|
|
|
return a_form == &a_xform; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
RE::ITEM_REMOVE_REASON iReason = RE::ITEM_REMOVE_REASON::kStoreInContainer; |
|
|
|
|
|
|
|
|
|
for (const auto& [item, data] : inv) { |
|
|
|
|
const auto& [count, entry] = data; |
|
|
|
|
if (count > 0) { |
|
|
|
|
supplyCount.insert({ item, count }); |
|
|
|
|
chest->RemoveItem(item, count, iReason, nullptr, targetRef, 0, 0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inline void ReturnSupplies() |
|
|
|
|
{ |
|
|
|
|
if (!bSuppliesFetched) { |
|
|
|
@ -248,4 +273,18 @@ inline void FetchSupplies(RE::TESFurniture* a_furn) |
|
|
|
|
inline bool GetSuppliesFetched() |
|
|
|
|
{ |
|
|
|
|
return bSuppliesFetched; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inline void FetchSpectralizingSupplies() |
|
|
|
|
{ |
|
|
|
|
if (GetSettings().at("ShowFetchingNotification")) { |
|
|
|
|
RE::DebugNotification("Fetching spectralizing supplies..."); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bSuppliesFetched = true; |
|
|
|
|
|
|
|
|
|
supplyCount.clear(); |
|
|
|
|
FetchSuppliesByType(RE::FormType::SoulGem); |
|
|
|
|
FetchSuppliesByForm(RE::TESForm::LookupByID(0x34CDD)); // Bone Meal
|
|
|
|
|
FetchSuppliesByForm(RE::TESForm::LookupByID(0x3AD63)); // Ectoplasm
|
|
|
|
|
} |
|
|
|
|