1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Add TSLint to github actions, fix existing type errors

This commit is contained in:
Bjorn Stromberg
2020-07-22 11:15:16 +09:00
parent 79e7fb31b9
commit cb1ff53338
13 changed files with 38 additions and 72 deletions

View File

@@ -46,7 +46,7 @@ export class MainMenuState extends GameState {
: ""
}
</div>
<video autoplay muted loop class="fullscreenBackgroundVideo">
<source src="${cachebust("res/bg_render.webm")}" type="video/webm">
</video>
@@ -92,10 +92,10 @@ export class MainMenuState extends GameState {
<a class="redditLink">${T.mainMenu.subreddit}</a>
<a class="changelog">${T.changelog.title}</a>
<a class="helpTranslate">${T.mainMenu.helpTranslate}</a>
</div>
<div class="author">${T.mainMenu.madeBy.replace(
"<author-link>",
'<a class="producerLink" target="_blank">Tobias Springer</a>'
@@ -218,11 +218,6 @@ export class MainMenuState extends GameState {
this.trackClicks(qs(".languageChoose"), this.onLanguageChooseClicked);
this.trackClicks(qs(".helpTranslate"), this.onTranslationHelpLinkClicked);
const contestButton = qs(".participateContest");
if (contestButton) {
this.trackClicks(contestButton, this.onContestClicked);
}
if (G_IS_STANDALONE) {
this.trackClicks(qs(".exitAppButton"), this.onExitAppButtonClicked);
}
@@ -312,15 +307,6 @@ export class MainMenuState extends GameState {
this.app.platformWrapper.openExternalLink(THIRDPARTY_URLS.reddit);
}
onContestClicked() {
this.app.analytics.trackUiClick("contest_click");
this.dialogs.showInfo(
T.mainMenu.contests.contest_01_03062020.title,
T.mainMenu.contests.contest_01_03062020.longDesc
);
}
onLanguageChooseClicked() {
this.app.analytics.trackUiClick("choose_language");
const setting = /** @type {EnumSetting} */ (getApplicationSettingById("language"));

View File

@@ -37,7 +37,7 @@ export class PreloadState extends GameState {
return false;
}
onEnter(payload) {
onEnter() {
this.htmlElement.classList.add("prefab_LoadingState");
const elementsToRemove = ["#loadingPreload", "#fontPreload"];
@@ -52,9 +52,13 @@ export class PreloadState extends GameState {
const dialogsElement = document.body.querySelector(".modalDialogParent");
this.dialogs.initializeToElement(dialogsElement);
/** @type {HTMLElement} */
this.statusText = this.htmlElement.querySelector(".loadingStatus > .desc");
/** @type {HTMLElement} */
this.statusBar = this.htmlElement.querySelector(".loadingStatus > .bar > .inner");
/** @type {HTMLElement} */
this.statusBarText = this.htmlElement.querySelector(".loadingStatus > .bar > .status");
this.currentStatus = "booting";
this.currentIndex = 0;
@@ -251,12 +255,12 @@ export class PreloadState extends GameState {
${this.currentStatus} failed:<br/>
${text}
</div>
<div class="supportHelp">
Please send me an email with steps to reproduce and what you did before this happened:
<br /><a class="email" href="mailto:${email}?subject=App%20does%20not%20launch">${email}</a>
</div>
<div class="lower">
<button class="resetApp styledButton">Reset App</button>
<i>Build ${G_BUILD_VERSION} @ ${G_BUILD_COMMIT_HASH}</i>

View File

@@ -94,6 +94,7 @@ export class SettingsState extends TextualGameState {
initSettings() {
allApplicationSettings.forEach(setting => {
/** @type {HTMLElement} */
const element = this.htmlElement.querySelector("[data-setting='" + setting.id + "']");
setting.bind(this.app, element, this.dialogs);
setting.syncValueToElement();