primera versio de menu
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user