diff --git a/frontend/src/console/views/Game.vue b/frontend/src/console/views/Game.vue index ad0f7420e..667a4edec 100644 --- a/frontend/src/console/views/Game.vue +++ b/frontend/src/console/views/Game.vue @@ -64,6 +64,9 @@ const descriptionOverlayRef = useTemplateRef( "description-overlay-ref", ); const detailsOverlayRef = useTemplateRef("details-overlay-ref"); +const isConsoleEmulationDisabled = computed( + () => heartbeatStore.value.EMULATION.DISABLE_EMULATOR_JS, +); const releaseDate = computed(() => { if (!rom.value?.metadatum.first_release_date) return null; @@ -351,7 +354,7 @@ function handleAction(action: InputAction): boolean { } async function play() { - if (!rom.value) return; + if (!rom.value || isConsoleEmulationDisabled.value) return; romApi .updateUserRomProps({ @@ -633,7 +636,10 @@ onUnmounted(() => { :class="{ 'scale-105 shadow-[0_8px_28px_rgba(0,0,0,0.35),_0_0_0_2px_var(--console-game-play-button-focus-border),_0_0_16px_var(--console-accent-secondary)]': selectedZone === 'play', + 'opacity-60 cursor-not-allowed': + isConsoleEmulationDisabled, }" + :disabled="isConsoleEmulationDisabled" @click="play()" > diff --git a/frontend/src/console/views/Play.vue b/frontend/src/console/views/Play.vue index 3c5e5be9e..840d9926a 100644 --- a/frontend/src/console/views/Play.vue +++ b/frontend/src/console/views/Play.vue @@ -26,6 +26,7 @@ import playSessionApi from "@/services/api/play-session"; import romApi from "@/services/api/rom"; import storeAuth from "@/stores/auth"; import storeConfig from "@/stores/config"; +import storeHeartbeat from "@/stores/heartbeat"; import storeLanguage from "@/stores/language"; import type { DetailedRom } from "@/stores/roms"; import { @@ -59,6 +60,7 @@ const router = useRouter(); const { getBezelImagePath } = useThemeAssets(); const authStore = storeAuth(); const configStore = storeConfig(); +const heartbeatStore = storeHeartbeat(); const languageStore = storeLanguage(); const { selectedLanguage } = storeToRefs(languageStore); const romId = Number(route.params.rom); @@ -727,6 +729,15 @@ onMounted(async () => { // Guard against duplicate mounts if (booted) return; + if (heartbeatStore.value.EMULATION.DISABLE_EMULATOR_JS) { + await router.replace({ + name: ROUTES.CONSOLE_ROM, + params: { rom: romId }, + query: route.query, + }); + return; + } + booted = true; await boot(); detachKey = attachKeyboardExit();