1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-02-12 10:59:23 +00:00

lint autofix

This commit is contained in:
Dimava 2020-05-29 10:57:54 +03:00
parent 84ca2d97e9
commit 07ed85f9a3
3 changed files with 18 additions and 5 deletions

View File

@ -206,7 +206,15 @@ export const allApplicationSettings = [
export const allDebugSettings = []; export const allDebugSettings = [];
for (const k in globalConfig.debug) { for (const k in globalConfig.debug) {
if (!IS_DEBUG) break; if (!IS_DEBUG) break;
allDebugSettings.push(new BoolSetting("debug_" + k.replace(/([a-z])([A-Z])/g, (s, a, b) => `${a}_${b}`), categoryDebug, (app, value) => {if (globalConfig.debug.enableDebugSettings) globalConfig.debug[k] = value;})); allDebugSettings.push(
new BoolSetting(
"debug_" + k.replace(/([a-z])([A-Z])/g, (s, a, b) => `${a}_${b}`),
categoryDebug,
(app, value) => {
if (globalConfig.debug.enableDebugSettings) globalConfig.debug[k] = value;
}
)
);
} }
allApplicationSettings.push(...allDebugSettings); allApplicationSettings.push(...allDebugSettings);
@ -274,7 +282,10 @@ export class ApplicationSettings extends ReadWriteProxy {
* @param {string} key * @param {string} key
*/ */
getSetting(key) { getSetting(key) {
assert(key.startsWith("debug_") || this.getAllSettings().hasOwnProperty(key), "Setting not known: " + key); assert(
key.startsWith("debug_") || this.getAllSettings().hasOwnProperty(key),
"Setting not known: " + key
);
return this.getAllSettings()[key]; return this.getAllSettings()[key];
} }

View File

@ -187,7 +187,7 @@ export class BoolSetting extends BaseSetting {
} }
getHtml() { getHtml() {
const label = T.settings.labels[this.id] || {title : this.id}; const label = T.settings.labels[this.id] || { title: this.id };
return ` return `
<div class="setting cardbox ${this.enabled ? "enabled" : "disabled"}"> <div class="setting cardbox ${this.enabled ? "enabled" : "disabled"}">
${this.enabled ? "" : standaloneOnlySettingHtml} ${this.enabled ? "" : standaloneOnlySettingHtml}

View File

@ -51,7 +51,9 @@ export class SettingsState extends TextualGameState {
if (i !== 0) { if (i !== 0) {
html += "</div>"; html += "</div>";
} }
html += `<strong class="categoryLabel"${lastCategory == categoryDebug ? hideDebug : ""}>${T.settings.categories[lastCategory]}</strong>`; html += `<strong class="categoryLabel"${lastCategory == categoryDebug ? hideDebug : ""}>${
T.settings.categories[lastCategory]
}</strong>`;
html += `<div class="settingsContainer"${lastCategory == categoryDebug ? hideDebug : ""}>`; html += `<div class="settingsContainer"${lastCategory == categoryDebug ? hideDebug : ""}>`;
} }