primera versio de menu

This commit is contained in:
2026-04-04 23:34:35 +02:00
parent 63424429ca
commit dbecd1ed4f
10 changed files with 328 additions and 0 deletions

View File

@@ -14,6 +14,12 @@ void JI_DisableKeyboard(Uint32 time) {
waitTime = time;
}
static bool input_blocked = false;
void JI_SetInputBlocked(bool blocked) {
input_blocked = blocked;
}
void JI_moveCheats(Uint8 new_key) {
cheat[0] = cheat[1];
cheat[1] = cheat[2];
@@ -37,6 +43,8 @@ void JI_Update() {
bool JI_KeyPressed(int key) {
if (waitTime > 0 || keystates == nullptr) return false;
// Input bloquejat (p.ex. menú flotant obert)
if (input_blocked) return false;
// ESC bloquejada pel Director (primera pulsació mostra notificació)
if (key == SDL_SCANCODE_ESCAPE && Director::get()->isEscBlocked()) return false;
return keystates[key] != 0;

View File

@@ -3,6 +3,9 @@
void JI_DisableKeyboard(Uint32 time);
// Bloqueja tot l'input cap al joc (JI_KeyPressed retorna false per a tot)
void JI_SetInputBlocked(bool blocked);
void JI_Update();
bool JI_KeyPressed(int key);