mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-24 18:22:58 +02:00
some work on dev menu
This commit is contained in:
+60
-7
@@ -12,7 +12,8 @@ import {loxBoxCreate, logBoxUpdateText,
|
||||
import {updateActiveScriptsItems} from "./ActiveScriptsUI.js";
|
||||
import {Augmentations, installAugmentations,
|
||||
initAugmentations, AugmentationNames,
|
||||
displayAugmentationsContent} from "./Augmentations.js";
|
||||
displayAugmentationsContent,
|
||||
PlayerOwnedAugmentation} from "./Augmentations.js";
|
||||
import {BitNodes, initBitNodes,
|
||||
initBitNodeMultipliers} from "./BitNode.js";
|
||||
import {Bladeburner} from "./Bladeburner.js";
|
||||
@@ -145,6 +146,7 @@ let Engine = {
|
||||
factionsMainMenuButton: null,
|
||||
augmentationsMainMenuButton: null,
|
||||
tutorialMainMenuButton: null,
|
||||
devMainMenuButton: null,
|
||||
saveMainMenuButton: null,
|
||||
deleteMainMenuButton: null,
|
||||
|
||||
@@ -158,6 +160,11 @@ let Engine = {
|
||||
tutorialFactionsButton: null,
|
||||
tutorialAugmentationsButton: null,
|
||||
tutorialBackButton: null,
|
||||
|
||||
//Dev menu
|
||||
devMenuGiveMoney: null,
|
||||
devMenuAugDropdown: null,
|
||||
devMenuAddAug: null,
|
||||
},
|
||||
|
||||
//Display objects
|
||||
@@ -183,6 +190,7 @@ let Engine = {
|
||||
factionAugmentationsContent: null,
|
||||
augmentationsContent: null,
|
||||
tutorialContent: null,
|
||||
devMenuContent: null,
|
||||
infiltrationContent: null,
|
||||
stockMarketContent: null,
|
||||
locationContent: null,
|
||||
@@ -208,6 +216,7 @@ let Engine = {
|
||||
Faction: "Faction",
|
||||
Augmentations: "Augmentations",
|
||||
Tutorial: "Tutorial",
|
||||
DevMenu: "Dev Menu",
|
||||
Location: "Location",
|
||||
workInProgress: "WorkInProgress",
|
||||
RedPill: "RedPill",
|
||||
@@ -319,6 +328,14 @@ let Engine = {
|
||||
document.getElementById("tutorial-menu-link").classList.add("active");
|
||||
},
|
||||
|
||||
loadDevMenuContent: function() {
|
||||
Engine.hideAllContent();
|
||||
Engine.Display.devMenuContent.style.display = "block";
|
||||
Engine.displayDevMenuContent();
|
||||
Engine.currentPage = Engine.Page.DevMenu;
|
||||
document.getElementById("dev-menu-link").classList.add("active");
|
||||
},
|
||||
|
||||
loadLocationContent: function() {
|
||||
Engine.hideAllContent();
|
||||
Engine.Display.locationContent.style.display = "block";
|
||||
@@ -455,6 +472,7 @@ let Engine = {
|
||||
Engine.Display.factionAugmentationsContent.style.display = "none";
|
||||
Engine.Display.augmentationsContent.style.display = "none";
|
||||
Engine.Display.tutorialContent.style.display = "none";
|
||||
Engine.Display.devMenuContent.style.display = "none";
|
||||
Engine.Display.locationContent.style.display = "none";
|
||||
Engine.Display.workInProgressContent.style.display = "none";
|
||||
Engine.Display.redPillContent.style.display = "none";
|
||||
@@ -494,6 +512,7 @@ let Engine = {
|
||||
document.getElementById("city-menu-link").classList.remove("active");
|
||||
document.getElementById("tutorial-menu-link").classList.remove("active");
|
||||
document.getElementById("options-menu-link").classList.remove("active");
|
||||
document.getElementById("dev-menu-link").classList.remove("active");
|
||||
},
|
||||
|
||||
displayCharacterOverviewInfo: function() {
|
||||
@@ -784,6 +803,12 @@ let Engine = {
|
||||
document.getElementById("tutorial-text").style.display = "none";
|
||||
},
|
||||
|
||||
displayDevMenuContent: function() {
|
||||
Engine.Clickables.devMenuGiveMoney.style.display = "block";
|
||||
Engine.Clickables.devMenuAugDropdown.style.display = "block";
|
||||
Engine.Clickables.devMenuAddAug.style.display = "block";
|
||||
},
|
||||
|
||||
//Displays the text when a section of the Tutorial is opened
|
||||
displayTutorialPage: function(text) {
|
||||
document.getElementById("tutorial-getting-started-link").style.display = "none";
|
||||
@@ -1182,6 +1207,7 @@ let Engine = {
|
||||
var job = document.getElementById("job-tab");
|
||||
var tutorial = document.getElementById("tutorial-tab");
|
||||
var options = document.getElementById("options-tab");
|
||||
var dev = document.getElementById("dev-tab");
|
||||
|
||||
//Load game from save or create new game
|
||||
if (loadGame(saveString)) {
|
||||
@@ -1258,7 +1284,7 @@ let Engine = {
|
||||
formatNumber(offlineProductionFromHacknetNodes, 2));
|
||||
//Close main menu accordions for loaded game
|
||||
var visibleMenuTabs = [terminal, createScript, activeScripts, stats,
|
||||
hacknetnodes, city, tutorial, options];
|
||||
hacknetnodes, city, tutorial, options, dev];
|
||||
if (Player.firstFacInvRecvd) {visibleMenuTabs.push(factions);}
|
||||
else {factions.style.display = "none";}
|
||||
if (Player.firstAugPurchased) {visibleMenuTabs.push(augmentations);}
|
||||
@@ -1312,7 +1338,7 @@ let Engine = {
|
||||
Engine.openMainMenuHeader(
|
||||
[terminal, createScript, activeScripts, stats,
|
||||
hacknetnodes, city,
|
||||
tutorial, options]
|
||||
tutorial, options, dev]
|
||||
);
|
||||
|
||||
//Start interactive tutorial
|
||||
@@ -1365,6 +1391,9 @@ let Engine = {
|
||||
Engine.Display.tutorialContent = document.getElementById("tutorial-container");
|
||||
Engine.Display.tutorialContent.style.display = "none";
|
||||
|
||||
Engine.Display.devMenuContent = document.getElementById("dev-menu-container");
|
||||
Engine.Display.devMenuContent.style.display = "none";
|
||||
|
||||
Engine.Display.infiltrationContent = document.getElementById("infiltration-container");
|
||||
Engine.Display.infiltrationContent.style.display = "none";
|
||||
|
||||
@@ -1452,6 +1481,22 @@ let Engine = {
|
||||
Engine.displayTutorialContent();
|
||||
});
|
||||
|
||||
Engine.Clickables.devMenuGiveMoney = document.getElementById("dev-need-money");
|
||||
Engine.Clickables.devMenuGiveMoney.addEventListener("click", function() {
|
||||
Player.gainMoney(1e15);
|
||||
});
|
||||
|
||||
Engine.Clickables.devMenuAugDropdown = document.getElementById("dev-menu-aug-dropdown");
|
||||
const augDD = Engine.Clickables.devMenuAugDropdown;
|
||||
for(const i in AugmentationNames) {
|
||||
augDD.options[augDD.options.length] = new Option(AugmentationNames[i], AugmentationNames[i]);
|
||||
}
|
||||
|
||||
Engine.Clickables.devMenuAddAug = document.getElementById("dev-add-aug");
|
||||
Engine.Clickables.devMenuAddAug.addEventListener("click", function() {
|
||||
Player.queueAugmentation(augDD.options[augDD.selectedIndex].value);
|
||||
});
|
||||
|
||||
//If DarkWeb already purchased, disable the button
|
||||
if (SpecialServerIps.hasOwnProperty("Darkweb Server")) {
|
||||
document.getElementById("location-purchase-tor").setAttribute("class", "a-link-button-inactive");
|
||||
@@ -1548,16 +1593,18 @@ let Engine = {
|
||||
var tutorialLink = document.getElementById("tutorial-menu-link");
|
||||
var options = document.getElementById("options-tab");
|
||||
var optionsLink = document.getElementById("options-menu-link");
|
||||
var dev = document.getElementById("dev-tab");
|
||||
var devLink = document.getElementById("dev-menu-link");
|
||||
this.classList.toggle("opened");
|
||||
if (tutorial.style.maxHeight) {
|
||||
Engine.toggleMainMenuHeader(false,
|
||||
[tutorial, options],
|
||||
[tutorialLink, optionsLink]
|
||||
[tutorial, options, dev],
|
||||
[tutorialLink, optionsLink, devLink]
|
||||
);
|
||||
} else {
|
||||
Engine.toggleMainMenuHeader(true,
|
||||
[tutorial, options],
|
||||
[tutorialLink, optionsLink]
|
||||
[tutorial, options, dev],
|
||||
[tutorialLink, optionsLink, devLink]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1636,6 +1683,12 @@ let Engine = {
|
||||
return false;
|
||||
});
|
||||
|
||||
Engine.Clickables.devMainMenuButton = clearEventListeners("dev-menu-link");
|
||||
Engine.Clickables.devMainMenuButton.addEventListener("click", function() {
|
||||
Engine.loadDevMenuContent();
|
||||
return false;
|
||||
});
|
||||
|
||||
//Active scripts list
|
||||
Engine.ActiveScriptsList = document.getElementById("active-scripts-list");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user