arreglos en service menu per a emscripten
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
namespace GlobalInputs {
|
||||
// Termina
|
||||
void quit() {
|
||||
#ifdef __EMSCRIPTEN__
|
||||
// En la versión web no se permite salir: el navegador gestiona el cierre.
|
||||
return;
|
||||
#else
|
||||
const std::string CODE = "QUIT";
|
||||
if (Notifier::get()->checkCode(CODE)) {
|
||||
// Si la notificación de salir está activa, cambia de sección
|
||||
@@ -30,6 +34,7 @@ namespace GlobalInputs {
|
||||
// Si la notificación de salir no está activa, muestra la notificación
|
||||
Notifier::get()->show({Lang::getText("[NOTIFICATIONS] 01"), std::string()}, -1, CODE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Reinicia
|
||||
|
||||
@@ -120,11 +120,14 @@ void Director::init() {
|
||||
Options::loadCrtPiFromFile(); // Carga los presets CrtPi
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
// En la versión web el navegador gestiona la ventana: forzamos zoom=1,
|
||||
// fullscreen para ocupar el canvas, e integer scale para píxeles nítidos.
|
||||
Options::window.zoom = 1;
|
||||
Options::video.fullscreen = true;
|
||||
// En la versión web el navegador gestiona la ventana: ventana (no
|
||||
// fullscreen — el canvas ya marca el área), integer scale para píxeles nítidos.
|
||||
Options::window.zoom = 3;
|
||||
Options::video.fullscreen = false;
|
||||
Options::video.integer_scale = true;
|
||||
// Precarga silenciosa: pantalla negra mientras el .data termina de descargarse.
|
||||
Options::loading.show = false;
|
||||
Options::loading.wait_for_input = false;
|
||||
#endif
|
||||
loadParams(); // Carga los parámetros del programa
|
||||
loadScoreFile(); // Carga el archivo de puntuaciones
|
||||
|
||||
@@ -642,6 +642,21 @@ void ServiceMenu::setHiddenOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
// En la versión web no tiene sentido exponer: shaders (build sin shaders),
|
||||
// permitir apagar el sistema (no aplica al navegador) ni salir del juego
|
||||
// (lo gestiona el navegador).
|
||||
for (const auto& caption : {
|
||||
Lang::getText("[SERVICE_MENU] SHADER"),
|
||||
Lang::getText("[SERVICE_MENU] ENABLE_SHUTDOWN"),
|
||||
Lang::getText("[SERVICE_MENU] QUIT")}) {
|
||||
auto* option = getOptionByCaption(caption);
|
||||
if (option != nullptr) {
|
||||
option->setHidden(true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
updateMenu(); // El menú debe refrescarse si algo se oculta
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user