From 88156d8dda08194b89cbe3b5cbbb3062cf0e6340 Mon Sep 17 00:00:00 2001 From: DJ1TJOO Date: Sat, 4 Sep 2021 22:14:55 +0200 Subject: [PATCH] Changed internalAddHint to make use of enumGameModeIds --- src/js/game/game_loading_overlay.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/game/game_loading_overlay.js b/src/js/game/game_loading_overlay.js index 82f65cb4..5b4ffb7b 100644 --- a/src/js/game/game_loading_overlay.js +++ b/src/js/game/game_loading_overlay.js @@ -4,6 +4,7 @@ import { Application } from "../application"; import { randomChoice } from "../core/utils"; import { T } from "../translations"; +import { enumGameModeIds } from "./game_mode"; export class GameLoadingOverlay { /** @@ -65,12 +66,11 @@ export class GameLoadingOverlay { * @param {string} gameModeId */ internalAddHint(element, gameModeId) { - const hint = document.createElement("span"); - let tips; - if (!gameModeId) tips = T.tips; - else if (gameModeId.includes("Edit")) tips = T.createPuzzleTips; - else tips = T.playPuzzleTips; + let tips = T.tips; + if (gameModeId === enumGameModeIds.puzzleEdit) tips = T.createPuzzleTips; + else if (gameModeId === enumGameModeIds.puzzlePlay) tips = T.playPuzzleTips; + const hint = document.createElement("span"); hint.innerHTML = randomChoice(tips); hint.classList.add("prefab_GameHint"); element.appendChild(hint);