From 9c180ca5b79a9b1e87c9003d89bcbac8938d0850 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Tue, 12 Jan 2021 17:30:23 +0100 Subject: [PATCH] Make key config a bit more user friendly --- Aquaria/InGameMenu.cpp | 10 ++++++++++ Aquaria/InGameMenu.h | 1 + Aquaria/StringBank_gen.h | 2 +- files/data/stringbank.txt | 3 ++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Aquaria/InGameMenu.cpp b/Aquaria/InGameMenu.cpp index 63fc65a..40e234d 100644 --- a/Aquaria/InGameMenu.cpp +++ b/Aquaria/InGameMenu.cpp @@ -2002,6 +2002,14 @@ void InGameMenu::create() const float offx = 140 - keyConfigBg->position.x; const float yi = 20; + keyConfigInstructions = new TTFText(&dsq->fontArialSmallest); + keyConfigInstructions->position = Vector(0, offy + 415); + keyConfigInstructions->setText(SB(2159)); + keyConfigInstructions->color = Vector(0.6f, 0.7f, 0.8f); + keyConfigInstructions->alphaMod = 0; + keyConfigInstructions->setAlign(ALIGN_CENTER); + keyConfigBg->addChild(keyConfigInstructions, PM_POINTER); + TTFText *joystickLabel = new TTFText(&dsq->fontArialSmall); joystickLabel->position = Vector(offx, offy + 390); joystickLabel->setText(SB(2140)); @@ -4000,6 +4008,8 @@ void InGameMenu::updateKeyConfigMenu(float dt) = actionSetCheck->getValue(); } + keyConfigInstructions->alphaMod = AquariaKeyConfig::waitingForInput ? 1.0f : 0.0f; + updateJoystickText(); } diff --git a/Aquaria/InGameMenu.h b/Aquaria/InGameMenu.h index 3bed495..e656017 100644 --- a/Aquaria/InGameMenu.h +++ b/Aquaria/InGameMenu.h @@ -222,6 +222,7 @@ private: AquariaCheckBox *actionSetCheck; int selectedActionSetIdx; TTFText *joystickNameText, *joystickGUIDText, *joystickButtonsText; + TTFText *keyConfigInstructions; void updateActionSetComboBox(); void switchToActionSet(int idx); void nextJoystick(); diff --git a/Aquaria/StringBank_gen.h b/Aquaria/StringBank_gen.h index 6e93e49..efff132 100644 --- a/Aquaria/StringBank_gen.h +++ b/Aquaria/StringBank_gen.h @@ -262,4 +262,4 @@ BANKSTRING(2155, "Invalid joy button value: ") BANKSTRING(2156, "Invalid mouse button id: ") BANKSTRING(2157, "Invalid joy axis(+): ") BANKSTRING(2158, "Invalid joy axis(-): ") - +BANKSTRING(2159, "Press key to assign, Esc to abort, same key or Backspace/Del to clear") diff --git a/files/data/stringbank.txt b/files/data/stringbank.txt index 504c56b..46a2084 100644 --- a/files/data/stringbank.txt +++ b/files/data/stringbank.txt @@ -260,4 +260,5 @@ 2155 Invalid joy button value: 2156 Invalid mouse button id: 2157 Invalid joy axis(+): -2158 Invalid joy axis(-): \ No newline at end of file +2158 Invalid joy axis(-): +2159 Press key to assign, Esc to abort, same key or Backspace/Del to clear \ No newline at end of file