feat(service_menu): pagina CONTROLS amb assignacio de pad i rebind per jugador

Afegeix submenu CONTROLS al menu de servei amb 2 items CYCLE per
seleccionar el mando assignat a cada jugador (persistit per name + path)
i 4 items ACTION per arrancar DefineInputs (teclat/mando per a P1/P2).

Tambe afegeix:
- Director: init/update/draw/destroy del singleton DefineInputs.
- GlobalEvents: routing prioritari de tots els events a DefineInputs
  mentre l'overlay esta actiu.
- Locale ca/en: claus del submenu CONTROLS i de l'overlay de rebind.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-24 20:18:49 +02:00
parent fcf13591be
commit 34be79192c
6 changed files with 220 additions and 0 deletions
+9
View File
@@ -13,6 +13,7 @@
#include "core/audio/audio_adapter.hpp"
#include "core/defaults/window.hpp"
#include "core/graphics/shape_loader.hpp"
#include "core/input/define_inputs.hpp"
#include "core/input/input.hpp"
#include "core/input/mouse.hpp"
#include "core/locale/locale.hpp"
@@ -178,6 +179,7 @@ Director::Director(int argc, char* argv[])
System::Notifier::init(sdl_->getRenderer());
System::ServiceMenu::init(sdl_->getRenderer(), sdl_.get(), debug_overlay_.get());
System::DefineInputs::init(sdl_->getRenderer());
last_ticks_ms_ = SDL_GetTicks();
}
@@ -192,6 +194,7 @@ Director::~Director() {
// l'hem de cridar nosaltres.
current_scene_.reset();
debug_overlay_.reset();
System::DefineInputs::destroy();
System::ServiceMenu::destroy();
System::Notifier::destroy();
context_.reset();
@@ -376,6 +379,9 @@ auto Director::iterate() -> SDL_AppResult {
if (auto* menu = System::ServiceMenu::get(); menu != nullptr) {
menu->update(delta_time);
}
if (auto* di = System::DefineInputs::get(); di != nullptr) {
di->update(delta_time);
}
Audio::update();
// Si la swapchain no està disponible (finestra minimitzada, etc.),
@@ -392,6 +398,9 @@ auto Director::iterate() -> SDL_AppResult {
if (const auto* menu = System::ServiceMenu::get(); menu != nullptr) {
menu->draw(); // service menu: per damunt fins i tot dels toasts
}
if (const auto* di = System::DefineInputs::get(); di != nullptr) {
di->draw(); // overlay de rebind: per damunt de tot
}
sdl_->present();
return SDL_APP_CONTINUE;
}