mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-02-12 02:49:20 +00:00
change how debug settings are disabled
This commit is contained in:
parent
480d5b22fd
commit
dee2354ff3
@ -205,11 +205,15 @@ export const allApplicationSettings = [
|
|||||||
/** @type {Array<BaseSetting>} */
|
/** @type {Array<BaseSetting>} */
|
||||||
export const allDebugSettings = [];
|
export const allDebugSettings = [];
|
||||||
for (const k in globalConfig.debug) {
|
for (const k in globalConfig.debug) {
|
||||||
if (!IS_DEBUG) break;
|
|
||||||
allDebugSettings.push(
|
allDebugSettings.push(
|
||||||
new BoolSetting("debug_" + k, categoryDebug, (app, value) => {
|
new BoolSetting(
|
||||||
if (globalConfig.debug.enableDebugSettings) globalConfig.debug[k] = value;
|
"debug_" + k,
|
||||||
})
|
categoryDebug,
|
||||||
|
(app, value) => {
|
||||||
|
if (globalConfig.debug.enableDebugSettings) globalConfig.debug[k] = value;
|
||||||
|
},
|
||||||
|
IS_DEBUG
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
allApplicationSettings.push(...allDebugSettings);
|
allApplicationSettings.push(...allDebugSettings);
|
||||||
|
|||||||
@ -41,20 +41,20 @@ export class SettingsState extends TextualGameState {
|
|||||||
getSettingsHtml() {
|
getSettingsHtml() {
|
||||||
let lastCategory = null;
|
let lastCategory = null;
|
||||||
let html = "";
|
let html = "";
|
||||||
const hideDebug = IS_DEBUG ? "" : " style='display:none'";
|
|
||||||
for (let i = 0; i < allApplicationSettings.length; ++i) {
|
for (let i = 0; i < allApplicationSettings.length; ++i) {
|
||||||
const setting = allApplicationSettings[i];
|
const setting = allApplicationSettings[i];
|
||||||
const hidden = allDebugSettings.indexOf(setting) != -1 && !globalConfig.debug.enableDebugSettings;
|
|
||||||
|
|
||||||
if (setting.categoryId !== lastCategory) {
|
if (setting.categoryId !== lastCategory) {
|
||||||
lastCategory = setting.categoryId;
|
lastCategory = setting.categoryId;
|
||||||
|
const isHidden = setting.categoryId == categoryDebug && !IS_DEBUG;
|
||||||
|
|
||||||
if (i !== 0) {
|
if (i !== 0) {
|
||||||
html += "</div>";
|
html += "</div>";
|
||||||
}
|
}
|
||||||
html += `<strong class="categoryLabel"${lastCategory == categoryDebug ? hideDebug : ""}>${
|
html += `<strong class='categoryLabel'${isHidden ? " style='display:none'" : ""}>${
|
||||||
T.settings.categories[lastCategory]
|
T.settings.categories[lastCategory]
|
||||||
}</strong>`;
|
}</strong>`;
|
||||||
html += `<div class="settingsContainer"${lastCategory == categoryDebug ? hideDebug : ""}>`;
|
html += `<div class='settingsContainer'${isHidden ? " style='display:none'" : ""}>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
html += setting.getHtml();
|
html += setting.getHtml();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user