desactivat eixir del joc en la versió WASM (milestone 5)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -638,9 +638,16 @@ void Director::handleSectionTransition() {
|
|||||||
|
|
||||||
// Ejecuta un frame del juego
|
// Ejecuta un frame del juego
|
||||||
SDL_AppResult Director::iterate() {
|
SDL_AppResult Director::iterate() {
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
// En WASM no se puede salir: reinicia al logo
|
||||||
|
if (section->name == SECTION_PROG_QUIT) {
|
||||||
|
section->name = SECTION_PROG_LOGO;
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (section->name == SECTION_PROG_QUIT) {
|
if (section->name == SECTION_PROG_QUIT) {
|
||||||
return SDL_APP_SUCCESS;
|
return SDL_APP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Gestiona las transiciones entre secciones
|
// Gestiona las transiciones entre secciones
|
||||||
handleSectionTransition();
|
handleSectionTransition();
|
||||||
@@ -668,11 +675,13 @@ SDL_AppResult Director::iterate() {
|
|||||||
|
|
||||||
// Procesa un evento
|
// Procesa un evento
|
||||||
SDL_AppResult Director::handleEvent(SDL_Event *event) {
|
SDL_AppResult Director::handleEvent(SDL_Event *event) {
|
||||||
|
#ifndef __EMSCRIPTEN__
|
||||||
// Evento de salida de la aplicación
|
// Evento de salida de la aplicación
|
||||||
if (event->type == SDL_EVENT_QUIT) {
|
if (event->type == SDL_EVENT_QUIT) {
|
||||||
section->name = SECTION_PROG_QUIT;
|
section->name = SECTION_PROG_QUIT;
|
||||||
return SDL_APP_SUCCESS;
|
return SDL_APP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Reenvía el evento a la sección activa
|
// Reenvía el evento a la sección activa
|
||||||
switch (activeSection) {
|
switch (activeSection) {
|
||||||
|
|||||||
@@ -646,11 +646,12 @@ void Title::checkEvents() {
|
|||||||
|
|
||||||
// Comprueba las entradas
|
// Comprueba las entradas
|
||||||
void Title::checkInput() {
|
void Title::checkInput() {
|
||||||
|
#ifndef __EMSCRIPTEN__
|
||||||
if (input->checkInput(input_exit, REPEAT_FALSE)) {
|
if (input->checkInput(input_exit, REPEAT_FALSE)) {
|
||||||
section->name = SECTION_PROG_QUIT;
|
section->name = SECTION_PROG_QUIT;
|
||||||
}
|
} else
|
||||||
|
#endif
|
||||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE)) {
|
if (input->checkInput(input_window_fullscreen, REPEAT_FALSE)) {
|
||||||
screen->switchVideoMode();
|
screen->switchVideoMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -851,6 +852,10 @@ void Title::updateMenuLabels() {
|
|||||||
menu.title->setItemCaption(1, lang->getText(52)); // 2 PLAYERS
|
menu.title->setItemCaption(1, lang->getText(52)); // 2 PLAYERS
|
||||||
menu.title->setItemCaption(2, lang->getText(1)); // OPTIONS
|
menu.title->setItemCaption(2, lang->getText(1)); // OPTIONS
|
||||||
menu.title->setItemCaption(3, lang->getText(3)); // QUIT
|
menu.title->setItemCaption(3, lang->getText(3)); // QUIT
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
menu.title->setVisible(3, false);
|
||||||
|
menu.title->setSelectable(3, false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Recoloca el menu de titulo
|
// Recoloca el menu de titulo
|
||||||
menu.title->centerMenuOnX(GAMECANVAS_CENTER_X);
|
menu.title->centerMenuOnX(GAMECANVAS_CENTER_X);
|
||||||
|
|||||||
Reference in New Issue
Block a user