mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-02-12 02:49:20 +00:00
lint autofix
This commit is contained in:
parent
84ca2d97e9
commit
07ed85f9a3
@ -206,7 +206,15 @@ export const allApplicationSettings = [
|
||||
export const allDebugSettings = [];
|
||||
for (const k in globalConfig.debug) {
|
||||
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);
|
||||
|
||||
@ -274,7 +282,10 @@ export class ApplicationSettings extends ReadWriteProxy {
|
||||
* @param {string} 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];
|
||||
}
|
||||
|
||||
|
||||
@ -187,7 +187,7 @@ export class BoolSetting extends BaseSetting {
|
||||
}
|
||||
|
||||
getHtml() {
|
||||
const label = T.settings.labels[this.id] || {title : this.id};
|
||||
const label = T.settings.labels[this.id] || { title: this.id };
|
||||
return `
|
||||
<div class="setting cardbox ${this.enabled ? "enabled" : "disabled"}">
|
||||
${this.enabled ? "" : standaloneOnlySettingHtml}
|
||||
|
||||
@ -44,14 +44,16 @@ export class SettingsState extends TextualGameState {
|
||||
const hideDebug = IS_DEBUG ? "" : " style='display:none'";
|
||||
for (let i = 0; i < allApplicationSettings.length; ++i) {
|
||||
const setting = allApplicationSettings[i];
|
||||
const hidden = allDebugSettings.indexOf(setting) != -1 && !globalConfig.debug.enableDebugSettings;
|
||||
const hidden = allDebugSettings.indexOf(setting) != -1 && !globalConfig.debug.enableDebugSettings;
|
||||
|
||||
if (setting.categoryId !== lastCategory) {
|
||||
lastCategory = setting.categoryId;
|
||||
if (i !== 0) {
|
||||
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 : ""}>`;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user