From 44b9a3992773eae59d22891197e97527dd60fca8 Mon Sep 17 00:00:00 2001 From: Renan LE CARO Date: Sun, 20 Apr 2025 17:32:05 +0200 Subject: [PATCH] wip --- dist/index.html | 4 +++- src/gameStateMutators.ts | 4 ++++ src/levelEditor.ts | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/index.html b/dist/index.html index 25a406c..84d52b7 100644 --- a/dist/index.html +++ b/dist/index.html @@ -3716,7 +3716,9 @@ function addToScore(gameState, coin) { (0, _addToTotalScore.addToTotalScore)(gameState, coin.points); if (gameState.score > gameState.highScore && !gameState.creative) { gameState.highScore = gameState.score; - localStorage.setItem("breakout-3-hs-short", gameState.score.toString()); + try { + localStorage.setItem("breakout-3-hs-short", gameState.score.toString()); + } catch (e) {} } if (!(0, _options.isOptionOn)("basic")) makeParticle(gameState, coin.previousX, coin.previousY, (gameState.canvasWidth - coin.x) / 100, -coin.y / 100, (0, _gameUtils.getCoinRenderColor)(gameState, coin), true, gameState.coinSize / 2, 100 + Math.random() * 50); schedulGameSound(gameState, "coinCatch", coin.x, 1); diff --git a/src/gameStateMutators.ts b/src/gameStateMutators.ts index bd8bffb..638e933 100644 --- a/src/gameStateMutators.ts +++ b/src/gameStateMutators.ts @@ -649,7 +649,11 @@ export function addToScore(gameState: GameState, coin: Coin) { addToTotalScore(gameState, coin.points); if (gameState.score > gameState.highScore && !gameState.creative) { gameState.highScore = gameState.score; + try{ localStorage.setItem("breakout-3-hs-short", gameState.score.toString()); + }catch (e){ + + } } if (!isOptionOn("basic")) { makeParticle( diff --git a/src/levelEditor.ts b/src/levelEditor.ts index 4e70963..86b6074 100644 --- a/src/levelEditor.ts +++ b/src/levelEditor.ts @@ -1,7 +1,6 @@ import { icons, transformRawLevel } from "./loadGameData"; import { t } from "./i18n/i18n"; import { - commitSettingsChangesToLocalStorage, getSettingValue, getTotalScore, setSettingValue,