More bug fixes for Sleeve/Resleeve features. Rebalancing for Sleeve/Resleeve and stock market. Added an option to remove source files in the dev menu

This commit is contained in:
danielyxie
2019-01-21 20:39:52 -08:00
parent 5573e778bb
commit a2237d4319
24 changed files with 2536 additions and 2145 deletions
+34 -1
View File
@@ -9,10 +9,14 @@ import { StockMarket,
SymbolToStockMap } from "./StockMarket/StockMarket";
import { Stock } from "./StockMarket/Stock";
import { Terminal } from "./Terminal";
import { numeralWrapper } from "./ui/numeralFormat";
import { dialogBoxCreate } from "../utils/DialogBox";
import { exceptionAlert } from "../utils/helpers/exceptionAlert";
import { createElement } from "../utils/uiHelpers/createElement";
import { createOptionElement } from "../utils/uiHelpers/createOptionElement";
import { getSelectText } from "../utils/uiHelpers/getSelectData";
import { removeElementById } from "../utils/uiHelpers/removeElementById";
const devMenuContainerId = "dev-menu-container";
@@ -222,7 +226,7 @@ export function createDevMenu() {
innerText: "Receive Invite to Faction",
});
// Augmentations / Source Files
// Augmentations
const augmentationsHeader = createElement("h2", {innerText: "Augmentations"});
const augmentationsDropdown = createElement("select", {
@@ -242,6 +246,32 @@ export function createDevMenu() {
innerText: "Queue Augmentation",
})
// Source Files
const sourceFilesHeader = createElement("h2", { innerText: "Source-Files" });
const removeSourceFileDropdown = createElement("select", {
class: "dropdown",
margin: "5px",
});
for (let i = 0; i < 24; ++i) {
removeSourceFileDropdown.add(createOptionElement(String(i)));
}
const removeSourceFileButton = createElement("button", {
class: "std-button",
clickListener: () => {
const numToRemove = parseInt(getSelectText(removeSourceFileDropdown));
for (let i = 0; i < Player.sourceFiles.length; ++i) {
if (Player.sourceFiles[i].n === numToRemove) {
Player.sourceFiles.splice(i, 1);
hackWorldDaemon(Player.bitNodeN, true);
return;
}
}
},
innerText: "Remove Source File and Trigger Bitflume",
});
// Programs
const programsHeader = createElement("h2", {innerText: "Programs"});
@@ -508,6 +538,9 @@ export function createDevMenu() {
devMenuContainer.appendChild(augmentationsHeader);
devMenuContainer.appendChild(augmentationsDropdown);
devMenuContainer.appendChild(augmentationsQueueButton);
devMenuContainer.appendChild(sourceFilesHeader);
devMenuContainer.appendChild(removeSourceFileDropdown);
devMenuContainer.appendChild(removeSourceFileButton);
devMenuContainer.appendChild(programsHeader);
devMenuContainer.appendChild(programsAddDropdown);
devMenuContainer.appendChild(programsAddButton);