1

Improved Take All detection

This commit is contained in:
Eddoursul 2022-07-12 12:23:26 +02:00
parent 1797222063
commit 4a1218782f
2 changed files with 8 additions and 7 deletions

Binary file not shown.

View File

@ -138,15 +138,16 @@ RE::BSEventNotifyControl EventListener::ProcessEvent(
RE::InputEvent* const* a_event, RE::InputEvent* const* a_event,
RE::BSTEventSource<RE::InputEvent*>* a_eventSource) RE::BSTEventSource<RE::InputEvent*>* a_eventSource)
{ {
if (RE::UI::GetSingleton()->GameIsPaused()) {
auto inputEvent = a_event ? *a_event : nullptr; auto inputEvent = a_event ? *a_event : nullptr;
auto buttonEvent = inputEvent ? inputEvent->AsButtonEvent() : nullptr; auto buttonEvent = inputEvent ? inputEvent->AsButtonEvent() : nullptr;
if (!buttonEvent) { if (!buttonEvent || !buttonEvent->IsPressed()) {
return RE::BSEventNotifyControl::kContinue; return RE::BSEventNotifyControl::kContinue;
} }
if (RE::UI::GetSingleton()->IsMenuOpen("ContainerMenu") && buttonEvent->QUserEvent() == RE::UserEvents::GetSingleton()->xButton) { if (RE::UI::GetSingleton()->GameIsPaused() && RE::UI::GetSingleton()->IsItemMenuOpen() && RE::UI::GetSingleton()->IsMenuOpen("ContainerMenu")) {
const auto takeAllKey = RE::ControlMap::GetSingleton()->GetMappedKey(RE::UserEvents::GetSingleton()->readyWeapon, buttonEvent->GetDevice(), RE::UserEvents::INPUT_CONTEXT_ID::kGameplay);
if (takeAllKey == buttonEvent->GetIDCode()) {
ArtifactTracker::g_bTakeAll = true; ArtifactTracker::g_bTakeAll = true;
ArtifactTracker::g_bTakeAllCount = 0; ArtifactTracker::g_bTakeAllCount = 0;
} }