1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-17 04:01:51 +00:00

Changed internalAddHint to make use of enumGameModeIds

This commit is contained in:
DJ1TJOO 2021-09-04 22:14:55 +02:00
parent d3be38fa4b
commit 88156d8dda

View File

@ -4,6 +4,7 @@ import { Application } from "../application";
import { randomChoice } from "../core/utils"; import { randomChoice } from "../core/utils";
import { T } from "../translations"; import { T } from "../translations";
import { enumGameModeIds } from "./game_mode";
export class GameLoadingOverlay { export class GameLoadingOverlay {
/** /**
@ -65,12 +66,11 @@ export class GameLoadingOverlay {
* @param {string} gameModeId * @param {string} gameModeId
*/ */
internalAddHint(element, gameModeId) { internalAddHint(element, gameModeId) {
const hint = document.createElement("span"); let tips = T.tips;
let tips; if (gameModeId === enumGameModeIds.puzzleEdit) tips = T.createPuzzleTips;
if (!gameModeId) tips = T.tips; else if (gameModeId === enumGameModeIds.puzzlePlay) tips = T.playPuzzleTips;
else if (gameModeId.includes("Edit")) tips = T.createPuzzleTips;
else tips = T.playPuzzleTips;
const hint = document.createElement("span");
hint.innerHTML = randomChoice(tips); hint.innerHTML = randomChoice(tips);
hint.classList.add("prefab_GameHint"); hint.classList.add("prefab_GameHint");
element.appendChild(hint); element.appendChild(hint);