From acb515b738fec99b1ebe3f4452964d2d29f8a27b Mon Sep 17 00:00:00 2001 From: fgenesis Date: Tue, 4 Apr 2017 19:27:53 +0200 Subject: [PATCH] Unstick highlight in input config --- Aquaria/AquariaMenuItem.cpp | 9 ++++++++- BBGE/Core.cpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Aquaria/AquariaMenuItem.cpp b/Aquaria/AquariaMenuItem.cpp index c6b0968..16a0a88 100644 --- a/Aquaria/AquariaMenuItem.cpp +++ b/Aquaria/AquariaMenuItem.cpp @@ -594,6 +594,8 @@ void AquariaKeyConfig::onUpdate(float dt) ActionInput *ai = 0; + bool used = false; + if (inputSetType != INPUTSET_OTHER) { ai = as.getActionInputByName(actionInputName); @@ -618,8 +620,10 @@ void AquariaKeyConfig::onUpdate(float dt) k = 0; break; } + used = k && *k; } + if (inputSetType == INPUTSET_OTHER) { if (actionInputName == "s1ax") @@ -630,10 +634,13 @@ void AquariaKeyConfig::onUpdate(float dt) k = &as.joycfg.s2ax; else if (actionInputName == "s2ay") k = &as.joycfg.s2ay; + used = k && int(*k) >= 0; } - if(k && *k) + if(used) bg2->alphaMod = 0.3f; + else + bg2->alphaMod = 0; if (waitingForInput == this) { diff --git a/BBGE/Core.cpp b/BBGE/Core.cpp index 394db78..865b16f 100644 --- a/BBGE/Core.cpp +++ b/BBGE/Core.cpp @@ -771,6 +771,7 @@ bool Core::getMouseButtonState(int m) bool Core::getKeyState(int k) { + assert(k < KEY_MAXARRAY); return k > 0 && k < KEY_MAXARRAY ? keys[k] : 0; }