mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 01:33:54 +01:00
Finishing Infiltration returns to company page. Infiltration remembers selected faction
This commit is contained in:
parent
8046ec51a7
commit
393ce096fd
18
dist/engine.bundle.js
vendored
18
dist/engine.bundle.js
vendored
@ -72987,6 +72987,9 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
//Keep track of last faction
|
||||
var lastFac = "";
|
||||
|
||||
/* InfiltrationBox.js */
|
||||
function infiltrationBoxClose() {
|
||||
var box = document.getElementById("infiltration-box-container");
|
||||
@ -73041,12 +73044,22 @@ function infiltrationBoxCreate(inst) {
|
||||
"that faction.");
|
||||
var selector = document.getElementById("infiltration-faction-select");
|
||||
selector.innerHTML = "";
|
||||
for (var i = 0; i < _src_Player__WEBPACK_IMPORTED_MODULE_3__["Player"].factions.length; ++i) {
|
||||
for (let i = 0; i < _src_Player__WEBPACK_IMPORTED_MODULE_3__["Player"].factions.length; ++i) {
|
||||
if (_src_Player__WEBPACK_IMPORTED_MODULE_3__["Player"].factions[i] === "Bladeburners") {continue;}
|
||||
selector.innerHTML += "<option value='" + _src_Player__WEBPACK_IMPORTED_MODULE_3__["Player"].factions[i] +
|
||||
"'>" + _src_Player__WEBPACK_IMPORTED_MODULE_3__["Player"].factions[i] + "</option>";
|
||||
}
|
||||
|
||||
//Set initial value, if applicable
|
||||
if (lastFac !== "") {
|
||||
for (let i = 0; i < selector.options.length; ++i) {
|
||||
if (selector.options[i].value === lastFac) {
|
||||
selector.selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var sellButton = Object(_HelperFunctions__WEBPACK_IMPORTED_MODULE_5__["clearEventListeners"])("infiltration-box-sell");
|
||||
setTimeout(function() {
|
||||
sellButton.addEventListener("click", function() {
|
||||
@ -73069,6 +73082,7 @@ function infiltrationBoxCreate(inst) {
|
||||
setTimeout(function() {
|
||||
factionButton.addEventListener("click", function() {
|
||||
var facName = selector.options[selector.selectedIndex].value;
|
||||
lastFac = facName;
|
||||
var faction = _src_Faction__WEBPACK_IMPORTED_MODULE_2__["Factions"][facName];
|
||||
if (faction == null) {
|
||||
Object(_DialogBox__WEBPACK_IMPORTED_MODULE_4__["dialogBoxCreate"])("Error finding faction. This is a bug please report to developer");
|
||||
@ -73221,7 +73235,7 @@ function endInfiltration(inst, success) {
|
||||
Object(_utils_HelperFunctions__WEBPACK_IMPORTED_MODULE_5__["clearEventListeners"])("infiltration-bribe");
|
||||
Object(_utils_HelperFunctions__WEBPACK_IMPORTED_MODULE_5__["clearEventListeners"])("infiltration-escape");
|
||||
|
||||
_engine__WEBPACK_IMPORTED_MODULE_2__["Engine"].loadWorldContent();
|
||||
_engine__WEBPACK_IMPORTED_MODULE_2__["Engine"].loadLocationContent();
|
||||
}
|
||||
|
||||
function nextInfiltrationLevel(inst) {
|
||||
|
@ -106,7 +106,7 @@ function endInfiltration(inst, success) {
|
||||
clearEventListeners("infiltration-bribe");
|
||||
clearEventListeners("infiltration-escape");
|
||||
|
||||
Engine.loadWorldContent();
|
||||
Engine.loadLocationContent();
|
||||
}
|
||||
|
||||
function nextInfiltrationLevel(inst) {
|
||||
|
@ -6,6 +6,9 @@ import {dialogBoxCreate} from "./DialogBox";
|
||||
import {clearEventListeners} from "./HelperFunctions";
|
||||
import {formatNumber} from "./StringHelperFunctions";
|
||||
|
||||
//Keep track of last faction
|
||||
var lastFac = "";
|
||||
|
||||
/* InfiltrationBox.js */
|
||||
function infiltrationBoxClose() {
|
||||
var box = document.getElementById("infiltration-box-container");
|
||||
@ -60,12 +63,22 @@ function infiltrationBoxCreate(inst) {
|
||||
"that faction.");
|
||||
var selector = document.getElementById("infiltration-faction-select");
|
||||
selector.innerHTML = "";
|
||||
for (var i = 0; i < Player.factions.length; ++i) {
|
||||
for (let i = 0; i < Player.factions.length; ++i) {
|
||||
if (Player.factions[i] === "Bladeburners") {continue;}
|
||||
selector.innerHTML += "<option value='" + Player.factions[i] +
|
||||
"'>" + Player.factions[i] + "</option>";
|
||||
}
|
||||
|
||||
//Set initial value, if applicable
|
||||
if (lastFac !== "") {
|
||||
for (let i = 0; i < selector.options.length; ++i) {
|
||||
if (selector.options[i].value === lastFac) {
|
||||
selector.selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var sellButton = clearEventListeners("infiltration-box-sell");
|
||||
setTimeout(function() {
|
||||
sellButton.addEventListener("click", function() {
|
||||
@ -88,6 +101,7 @@ function infiltrationBoxCreate(inst) {
|
||||
setTimeout(function() {
|
||||
factionButton.addEventListener("click", function() {
|
||||
var facName = selector.options[selector.selectedIndex].value;
|
||||
lastFac = facName;
|
||||
var faction = Factions[facName];
|
||||
if (faction == null) {
|
||||
dialogBoxCreate("Error finding faction. This is a bug please report to developer");
|
||||
|
Loading…
Reference in New Issue
Block a user