hotkey: F11 mostra notificacio blava amb 'AppName vX.Y.Z (githash)'

This commit is contained in:
2026-05-19 20:04:12 +02:00
parent 66ad34b667
commit 984d1fca50
3 changed files with 21 additions and 5 deletions
+12
View File
@@ -7,6 +7,8 @@
#include "core/rendering/notifications.hpp" #include "core/rendering/notifications.hpp"
#include "core/rendering/screen.h" #include "core/rendering/screen.h"
#include "game/options.hpp" #include "game/options.hpp"
#include "utils/defines.hpp"
#include "version.h"
namespace GlobalInputs { namespace GlobalInputs {
@@ -54,6 +56,12 @@ namespace GlobalInputs {
Notifications::show(MSG, Notifications::Palette::SUCCESS, Notifications::STANDARD_MS); Notifications::show(MSG, Notifications::Palette::SUCCESS, Notifications::STANDARD_MS);
} }
void notifyVersion() {
// Format: "<APP_NAME> v<VERSION> (<GIT_HASH>)"
const std::string MSG = std::string(Version::APP_NAME) + " v" + Texts::VERSION + " (" + Version::GIT_HASH + ")";
Notifications::show(MSG, Notifications::Palette::TOGGLE, Notifications::LONG_MS);
}
void onExit() { void onExit() {
const Uint32 NOW = SDL_GetTicks(); const Uint32 NOW = SDL_GetTicks();
if (NOW < exit_window_until_ticks) { if (NOW < exit_window_until_ticks) {
@@ -94,6 +102,10 @@ namespace GlobalInputs {
notifyShaderEnabled(); notifyShaderEnabled();
return true; return true;
} }
if (Input::get()->checkInput(Input::Action::SHOW_VERSION, Input::Repeat::OFF)) {
notifyVersion();
return true;
}
// F5/F6 només actuen quan el post-procesado està actiu. // F5/F6 només actuen quan el post-procesado està actiu.
if (Screen::isShaderEnabled()) { if (Screen::isShaderEnabled()) {
if (Input::get()->checkInput(Input::Action::TOGGLE_SHADER_TYPE, Input::Repeat::OFF)) { if (Input::get()->checkInput(Input::Action::TOGGLE_SHADER_TYPE, Input::Repeat::OFF)) {
+3
View File
@@ -50,6 +50,9 @@ class Input {
TOGGLE_SHADER, TOGGLE_SHADER,
TOGGLE_SHADER_TYPE, TOGGLE_SHADER_TYPE,
// Diagnostic
SHOW_VERSION,
// Centinela final (usar para sizing) // Centinela final (usar para sizing)
NUMBER_OF_INPUTS NUMBER_OF_INPUTS
}; };
+1
View File
@@ -232,6 +232,7 @@ void Director::initInput() {
Input::get()->bindKey(Input::Action::TOGGLE_SHADER, SDL_SCANCODE_F4); Input::get()->bindKey(Input::Action::TOGGLE_SHADER, SDL_SCANCODE_F4);
Input::get()->bindKey(Input::Action::TOGGLE_SHADER_TYPE, SDL_SCANCODE_F5); Input::get()->bindKey(Input::Action::TOGGLE_SHADER_TYPE, SDL_SCANCODE_F5);
Input::get()->bindKey(Input::Action::NEXT_SHADER_PRESET, SDL_SCANCODE_F6); Input::get()->bindKey(Input::Action::NEXT_SHADER_PRESET, SDL_SCANCODE_F6);
Input::get()->bindKey(Input::Action::SHOW_VERSION, SDL_SCANCODE_F11);
// Mando - Movimiento del jugador // Mando - Movimiento del jugador
Input::get()->bindGameControllerButton(Input::Action::UP, SDL_GAMEPAD_BUTTON_DPAD_UP); Input::get()->bindGameControllerButton(Input::Action::UP, SDL_GAMEPAD_BUTTON_DPAD_UP);