Using BitFlume program now opens a confirmation window first

This commit is contained in:
danielyxie 2018-01-21 15:24:51 -06:00
parent 73bca9099f
commit 97ca8121be
2 changed files with 35 additions and 5 deletions

21
dist/bundle.js vendored

@ -2598,13 +2598,10 @@ function createElement(type, params) {
if (params.display) {el.style.display = params.display;}
if (params.visibility) {el.style.visibility = params.visibility;}
if (params.margin) {el.style.margin = params.margin;}
if (params.marginLeft) {el.style.marginLeft = params.marginLeft;}
if (params.padding) {el.style.padding = params.padding;}
if (params.color) {el.style.color = params.color;}
if (params.border) {el.style.border = params.border;}
if (params.float) {el.style.cssFloat = params.float;}
if (params.fontSize) {el.style.fontSize = params.fontSize;}
if (params.width) {el.style.width = params.width;}
if (params.backgroundColor) {
el.style.backgroundColor = params.backgroundColor
}
@ -27746,6 +27743,8 @@ function NetscriptFunctions(workerScript) {
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__utils_StringHelperFunctions_js__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__utils_HelperFunctions_js__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__utils_LogBox_js__ = __webpack_require__(30);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__utils_YesNoBox_js__ = __webpack_require__(14);
@ -29371,7 +29370,21 @@ let Terminal = {
post("Agility: " + __WEBPACK_IMPORTED_MODULE_11__Player_js__["a" /* Player */].agility + " / 1500");
break;
case __WEBPACK_IMPORTED_MODULE_2__CreateProgram_js__["a" /* Programs */].BitFlume:
Object(__WEBPACK_IMPORTED_MODULE_12__RedPill_js__["a" /* hackWorldDaemon */])(__WEBPACK_IMPORTED_MODULE_11__Player_js__["a" /* Player */].bitNodeN, true);
var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_20__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(),
noBtn = Object(__WEBPACK_IMPORTED_MODULE_20__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])();
yesBtn.innerHTML = "Travel to BitNode Nexus";
noBtn.innerHTML = "Cancel";
yesBtn.addEventListener("click", function() {
Object(__WEBPACK_IMPORTED_MODULE_12__RedPill_js__["a" /* hackWorldDaemon */])(__WEBPACK_IMPORTED_MODULE_11__Player_js__["a" /* Player */].bitNodeN, true);
return Object(__WEBPACK_IMPORTED_MODULE_20__utils_YesNoBox_js__["a" /* yesNoBoxClose */])();
});
noBtn.addEventListener("click", function() {
return Object(__WEBPACK_IMPORTED_MODULE_20__utils_YesNoBox_js__["a" /* yesNoBoxClose */])();
});
Object(__WEBPACK_IMPORTED_MODULE_20__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])("WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE.<br><br>" +
"Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode " +
"and select a new one.");
break;
default:
post("Invalid executable. Cannot be run");

@ -32,6 +32,9 @@ import {containsAllStrings, longestCommonStart,
formatNumber, isString} from "../utils/StringHelperFunctions.js";
import {addOffset, printArray} from "../utils/HelperFunctions.js";
import {logBoxCreate} from "../utils/LogBox.js";
import {yesNoBoxCreate,
yesNoBoxGetYesButton,
yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox.js";
/* Write text to terminal */
//If replace is true then spaces are replaced with "&nbsp;"
@ -1636,7 +1639,21 @@ let Terminal = {
post("Agility: " + Player.agility + " / 1500");
break;
case Programs.BitFlume:
hackWorldDaemon(Player.bitNodeN, true);
var yesBtn = yesNoBoxGetYesButton(),
noBtn = yesNoBoxGetNoButton();
yesBtn.innerHTML = "Travel to BitNode Nexus";
noBtn.innerHTML = "Cancel";
yesBtn.addEventListener("click", function() {
hackWorldDaemon(Player.bitNodeN, true);
return yesNoBoxClose();
});
noBtn.addEventListener("click", function() {
return yesNoBoxClose();
});
yesNoBoxCreate("WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE.<br><br>" +
"Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode " +
"and select a new one.");
break;
default:
post("Invalid executable. Cannot be run");