Build 29092809

This commit is contained in:
Renan LE CARO 2025-04-25 10:10:09 +02:00
parent e2d8a0ab5c
commit 30e684e838
12 changed files with 124 additions and 96 deletions

View file

@ -1,5 +1,5 @@
// The version of the cache.
const VERSION = "29091656";
const VERSION = "29092809";
// The name of the cache
const CACHE_NAME = `breakout-71-${VERSION}`;

View file

@ -1,5 +1,6 @@
import { t } from "./i18n/i18n";
import { isOptionOn } from "./options";
import { hideAnyTooltip } from "./tooltip";
export let alertsOpen = 0,
closeModal: null | (() => void) = null;
@ -45,6 +46,7 @@ export async function asyncAlert<t>({
allowClose?: boolean;
className?: string;
}): Promise<t | void> {
hideAnyTooltip();
updateAlertsOpen(+1);
return new Promise((resolve) => {
popupWrap.className = className;

View file

@ -1 +1 @@
"29091656"
"29092809"

View file

@ -89,7 +89,7 @@ import {
} from "./pure_functions";
import { helpMenuEntry } from "./help";
import { creativeMode } from "./creative";
import { setupTooltips } from "./tooltip";
import { hideAnyTooltip, setupTooltips } from "./tooltip";
import { startingPerkMenuButton } from "./startingPerks";
import "./migrations";
import { getHistory } from "./gameOver";
@ -109,6 +109,7 @@ export async function play() {
startRecordingGame(gameState);
getAudioContext()?.resume();
resumeRecording();
hideAnyTooltip();
// document.body.classList[gameState.running ? 'add' : 'remove']('running')
}
@ -121,7 +122,6 @@ export function pause(playerAskedForPause: boolean) {
}
return;
}
const stop = () => {
gameState.running = false;
@ -150,6 +150,7 @@ export function pause(playerAskedForPause: boolean) {
if (document.exitPointerLock) {
document.exitPointerLock();
}
hideAnyTooltip();
}
export const fitSize = (gameState: GameState) => {

View file

@ -147,12 +147,16 @@ export function pickedUpgradesHTMl(gameState: GameState) {
return ` <p>${t("score_panel.upgrades_picked")}</p>` + upgradesList.join("");
}
export function levelsListHTMl(gameState: GameState, level: number) {
export function levelsListHTMl(
gameState: GameState,
currentLevelIndex: number,
) {
if (!gameState.perks.clairvoyant) return "";
if (gameState.creative) return "";
let list = "";
for (let i = 0; i < max_levels(gameState); i++) {
list += `<span style="opacity: ${i >= level ? 1 : 0.2}" title="${gameState.runLevels[i].name}">${icons[gameState.runLevels[i].name]}</span>`;
let level = gameState.runLevels[i % gameState.runLevels.length];
list += `<span style="opacity: ${i >= currentLevelIndex ? 1 : 0.2}" title="${level.name}">${icons[level.name]}</span>`;
}
return `<p>${t("score_panel.upcoming_levels")}</p><p>${list}</p>`;
}

View file

@ -345,7 +345,7 @@
"upgrades.multiball.tooltip": "Start every levels with {{count}} balls.",
"upgrades.multiball.verbose_description": "As soon as you drop the ball in Breakout 71, you lose. \n\nWith this perk, you get two balls, and so you can afford to lose one. \n\nThe lost balls come back on the next level. \n\nHaving more than one balls makes some further perks available, and of course clears the level faster.",
"upgrades.nbricks.name": "Strict sample size",
"upgrades.nbricks.tooltip": "More coins if you break bricks one by one.",
"upgrades.nbricks.tooltip": "More coins if you hit bricks one by one.",
"upgrades.nbricks.verbose_description": "Hit exactly {{lvl}} bricks per paddle bounce for +{{lvl}} combo, otherwise it resets. You don't necessarily need to destroy those bricks, but you need to hit them. Bricks destroyed by explosions don't count",
"upgrades.one_more_choice.name": "Extra choice",
"upgrades.one_more_choice.tooltip": "More upgrade choices",

View file

@ -2,7 +2,7 @@ import { RunHistoryItem } from "./types";
import _appVersion from "./data/version.json";
import { generateSaveFileContent } from "./generateSaveFileContent";
import { getLevelUnlockCondition, reasonLevelIsLocked } from "./game_utils";
import { reasonLevelIsLocked } from "./game_utils";
import { allLevels } from "./loadGameData";
import { toast } from "./toast";

View file

@ -7,6 +7,9 @@ export function setupTooltips() {
setupDesktopTooltips(tooltip);
}
}
export function hideAnyTooltip() {
tooltip.style.display = "none";
}
const tooltip = document.getElementById("tooltip") as HTMLDivElement;
@ -35,7 +38,7 @@ function setupMobileTooltips(tooltip: HTMLDivElement) {
e.stopPropagation();
e.preventDefault();
tooltip.style.display = "none";
hideAnyTooltip();
}
document.body.addEventListener("touchend", closeTooltip, true);
@ -51,6 +54,7 @@ function setupMobileTooltips(tooltip: HTMLDivElement) {
e.preventDefault();
}
document.body.addEventListener("click", ignoreClick, true);
document.body.addEventListener("contextmenu", ignoreClick, true);
}
function setupDesktopTooltips(tooltip: HTMLDivElement) {
@ -59,7 +63,7 @@ function setupDesktopTooltips(tooltip: HTMLDivElement) {
}
function closeToolTip() {
tooltip.style.display = "none";
hideAnyTooltip();
hovering = null;
}