mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-09 16:21:51 +00:00
Remove highly redundant utils functions
Remove isSupportedBrowser entirely and inline usages of getLogoSprite.
This commit is contained in:
parent
2f23c0174d
commit
a6a517a96b
@ -9,12 +9,12 @@ import { AtlasDefinition, atlasFiles } from "./atlas_definitions";
|
||||
import { Loader } from "./loader";
|
||||
import { createLogger } from "./logging";
|
||||
import { Signal } from "./signal";
|
||||
import { clamp, getLogoSprite, timeoutPromise } from "./utils";
|
||||
import { clamp, timeoutPromise } from "./utils";
|
||||
|
||||
const logger = createLogger("background_loader");
|
||||
|
||||
const MAIN_MENU_ASSETS = {
|
||||
sprites: [getLogoSprite()],
|
||||
sprites: ["logo.png"],
|
||||
sounds: [SOUNDS.uiClick, SOUNDS.uiError, SOUNDS.dialogError, SOUNDS.dialogOk],
|
||||
atlas: [],
|
||||
css: [],
|
||||
|
||||
@ -399,13 +399,6 @@ export function removeAllChildren(elem) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the game supports this browser
|
||||
*/
|
||||
export function isSupportedBrowser() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats an amount of seconds into something like "5s ago"
|
||||
* @param {number} secs Seconds
|
||||
@ -659,13 +652,6 @@ export function getRomanNumber(number) {
|
||||
return formatted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the appropriate logo sprite path
|
||||
*/
|
||||
export function getLogoSprite() {
|
||||
return "logo.png";
|
||||
}
|
||||
|
||||
/**
|
||||
* Rejects a promise after X ms
|
||||
* @param {Promise} promise
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { THIRDPARTY_URLS } from "../core/config";
|
||||
import { TextualGameState } from "../core/textual_game_state";
|
||||
import { T } from "../translations";
|
||||
import { THIRDPARTY_URLS } from "../core/config";
|
||||
import { getLogoSprite } from "../core/utils";
|
||||
|
||||
export class AboutState extends TextualGameState {
|
||||
constructor() {
|
||||
@ -15,7 +14,7 @@ export class AboutState extends TextualGameState {
|
||||
getMainContentHTML() {
|
||||
return `
|
||||
<div class="head">
|
||||
<img src="res/${getLogoSprite()}" alt="shapez.io Logo">
|
||||
<img src="res/logo.png" alt="shapez.io Logo">
|
||||
</div>
|
||||
<div class="text">
|
||||
${T.about.body
|
||||
|
||||
@ -4,7 +4,6 @@ import { DialogWithForm } from "../core/modal_dialog_elements";
|
||||
import { FormElementInput } from "../core/modal_dialog_forms";
|
||||
import {
|
||||
formatSecondsToTimeAgo,
|
||||
getLogoSprite,
|
||||
makeButton,
|
||||
makeDiv,
|
||||
makeDivElement,
|
||||
@ -42,7 +41,7 @@ export class MainMenuState extends GameState {
|
||||
</video>
|
||||
|
||||
<div class="logo">
|
||||
<img src="res/${getLogoSprite()}" alt="shapez.io Logo"
|
||||
<img src="res/logo.png" alt="shapez.io Logo"
|
||||
width="${Math.round((710 / 3) * this.app.getEffectiveUiScale())}"
|
||||
height="${Math.round((180 / 3) * this.app.getEffectiveUiScale())}"
|
||||
>
|
||||
|
||||
@ -2,7 +2,6 @@ import { CHANGELOG } from "../changelog";
|
||||
import { globalConfig } from "../core/config";
|
||||
import { GameState } from "../core/game_state";
|
||||
import { createLogger } from "../core/logging";
|
||||
import { getLogoSprite } from "../core/utils";
|
||||
import { getRandomHint } from "../game/hints";
|
||||
import { HUDModalDialogs } from "../game/hud/parts/modal_dialogs";
|
||||
import { T, autoDetectLanguageId, updateApplicationLanguage } from "../translations";
|
||||
@ -235,7 +234,7 @@ export class PreloadState extends GameState {
|
||||
|
||||
subElement.innerHTML = `
|
||||
<div class="logo">
|
||||
<img src="res/${getLogoSprite()}" alt="Shapez.io Logo">
|
||||
<img src="res/logo.png" alt="Shapez.io Logo">
|
||||
</div>
|
||||
<div class="failureInner">
|
||||
<div class="errorHeader">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user