mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-04-05 01:41:26 +02:00
enable/disable dev mode with a global var
This commit is contained in:
1
src/devmode.js
Normal file
1
src/devmode.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const DevModeEnabled = false;
|
@ -24,6 +24,7 @@ import {CONSTANTS} from "./Constants.js";
|
|||||||
import {Programs, displayCreateProgramContent,
|
import {Programs, displayCreateProgramContent,
|
||||||
getNumAvailableCreateProgram,
|
getNumAvailableCreateProgram,
|
||||||
initCreateProgramButtons} from "./CreateProgram.js";
|
initCreateProgramButtons} from "./CreateProgram.js";
|
||||||
|
import {DevModeEnabled} from "./devmode.js"
|
||||||
import {displayFactionContent, joinFaction,
|
import {displayFactionContent, joinFaction,
|
||||||
processPassiveFactionRepGain, Factions,
|
processPassiveFactionRepGain, Factions,
|
||||||
inviteToFaction, initFactions} from "./Faction.js";
|
inviteToFaction, initFactions} from "./Faction.js";
|
||||||
@ -1823,19 +1824,17 @@ let Engine = {
|
|||||||
var tutorialLink = document.getElementById("tutorial-menu-link");
|
var tutorialLink = document.getElementById("tutorial-menu-link");
|
||||||
var options = document.getElementById("options-tab");
|
var options = document.getElementById("options-tab");
|
||||||
var optionsLink = document.getElementById("options-menu-link");
|
var optionsLink = document.getElementById("options-menu-link");
|
||||||
var dev = document.getElementById("dev-tab");
|
|
||||||
var devLink = document.getElementById("dev-menu-link");
|
|
||||||
this.classList.toggle("opened");
|
this.classList.toggle("opened");
|
||||||
|
const elems = [tutorial, options];
|
||||||
|
const links = [tutorialLink, optionsLink];
|
||||||
|
if(DevModeEnabled) {
|
||||||
|
elems.push(document.getElementById("dev-tab"));
|
||||||
|
links.push(document.getElementById("dev-menu-link"));
|
||||||
|
}
|
||||||
if (tutorial.style.maxHeight) {
|
if (tutorial.style.maxHeight) {
|
||||||
Engine.toggleMainMenuHeader(false,
|
Engine.toggleMainMenuHeader(false, elems, links);
|
||||||
[tutorial, options, dev],
|
|
||||||
[tutorialLink, optionsLink, devLink]
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
Engine.toggleMainMenuHeader(true,
|
Engine.toggleMainMenuHeader(true, elems, links);
|
||||||
[tutorial, options, dev],
|
|
||||||
[tutorialLink, optionsLink, devLink]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user