Merge pull request #959 from MartinFournier/suppress-bladeburner-popup

Add setting to suppress Bladeburner prompts
This commit is contained in:
hydroflame 2021-05-17 21:09:21 -04:00 committed by GitHub
commit eb7004feaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 2 deletions

@ -24,6 +24,7 @@ import {
convertTimeMsToTimeElapsedString, convertTimeMsToTimeElapsedString,
} from "../utils/StringHelperFunctions"; } from "../utils/StringHelperFunctions";
import { Settings } from "./Settings/Settings";
import { ConsoleHelpText } from "./Bladeburner/data/Help"; import { ConsoleHelpText } from "./Bladeburner/data/Help";
import { City } from "./Bladeburner/City"; import { City } from "./Bladeburner/City";
import { BladeburnerConstants } from "./Bladeburner/data/Constants"; import { BladeburnerConstants } from "./Bladeburner/data/Constants";
@ -359,8 +360,10 @@ Bladeburner.prototype.process = function() {
msg += `<br><br>Your automation was disabled as well. You will have to re-enable it through the Bladeburner console` msg += `<br><br>Your automation was disabled as well. You will have to re-enable it through the Bladeburner console`
this.automateEnabled = false; this.automateEnabled = false;
} }
if (!Settings.SuppressBladeburnerPopup) {
dialogBoxCreate(msg); dialogBoxCreate(msg);
} }
}
this.resetAction(); this.resetAction();
} }

@ -74,6 +74,11 @@ interface IDefaultSettings {
* Whether the user should be asked to confirm travelling between cities. * Whether the user should be asked to confirm travelling between cities.
*/ */
SuppressTravelConfirmation: boolean; SuppressTravelConfirmation: boolean;
/**
* Whether the user should be displayed a popup message when his Bladeburner actions are cancelled.
*/
SuppressBladeburnerPopup: boolean;
} }
/** /**
@ -122,6 +127,7 @@ const defaultSettings: IDefaultSettings = {
SuppressHospitalizationPopup: false, SuppressHospitalizationPopup: false,
SuppressMessages: false, SuppressMessages: false,
SuppressTravelConfirmation: false, SuppressTravelConfirmation: false,
SuppressBladeburnerPopup: false,
}; };
/** /**
@ -147,6 +153,7 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = {
SuppressHospitalizationPopup: defaultSettings.SuppressHospitalizationPopup, SuppressHospitalizationPopup: defaultSettings.SuppressHospitalizationPopup,
SuppressMessages: defaultSettings.SuppressMessages, SuppressMessages: defaultSettings.SuppressMessages,
SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation, SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation,
SuppressBladeburnerPopup: defaultSettings.SuppressBladeburnerPopup,
init() { init() {
Object.assign(Settings, defaultSettings); Object.assign(Settings, defaultSettings);
}, },

@ -519,6 +519,16 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %>
<input class="optionCheckbox" type="checkbox" name="settingsSuppressHospitalizationPopup" id="settingsSuppressHospitalizationPopup"> <input class="optionCheckbox" type="checkbox" name="settingsSuppressHospitalizationPopup" id="settingsSuppressHospitalizationPopup">
</fieldset> </fieldset>
<!-- Suppress Bladeburner popups -->
<fieldset>
<label for="settingsSuppressBladeburnerPopup" class="tooltip">Suppress Bladeburner Popup:
<span class="tooltiptext">
If this is set, then having your Bladeburner actions interrupted by being busy with something else will not display a popup message.
</span>
</label>
<input class="optionCheckbox" type="checkbox" name="settingsSuppressBladeburnerPopup" id="settingsSuppressBladeburnerPopup">
</fieldset>
<!-- Disable Terminal and Navigation Shortcuts --> <!-- Disable Terminal and Navigation Shortcuts -->
<fieldset> <fieldset>
<label for="settingsDisableHotkeys" class="tooltip">Disable Hotkeys: <label for="settingsDisableHotkeys" class="tooltip">Disable Hotkeys:

@ -1,6 +1,6 @@
import {Engine} from "../engine"; import {Engine} from "../engine";
import {Settings} from "../Settings/Settings"; import {Settings} from "../Settings/Settings";
import {Player} from "../Player";
import {numeralWrapper} from "./numeralFormat"; import {numeralWrapper} from "./numeralFormat";
@ -21,6 +21,7 @@ function setSettingsLabels() {
const suppressTravelConfirmation = document.getElementById("settingsSuppressTravelConfirmation"); const suppressTravelConfirmation = document.getElementById("settingsSuppressTravelConfirmation");
const suppressBuyAugmentationConfirmation = document.getElementById("settingsSuppressBuyAugmentationConfirmation"); const suppressBuyAugmentationConfirmation = document.getElementById("settingsSuppressBuyAugmentationConfirmation");
const suppressHospitalizationPopup = document.getElementById("settingsSuppressHospitalizationPopup"); const suppressHospitalizationPopup = document.getElementById("settingsSuppressHospitalizationPopup");
const suppressBladeburnerPopup = document.getElementById("settingsSuppressBladeburnerPopup");
const autosaveInterval = document.getElementById("settingsAutosaveIntervalValLabel"); const autosaveInterval = document.getElementById("settingsAutosaveIntervalValLabel");
const disableHotkeys = document.getElementById("settingsDisableHotkeys"); const disableHotkeys = document.getElementById("settingsDisableHotkeys");
const disableASCIIArt = document.getElementById("settingsDisableASCIIArt"); const disableASCIIArt = document.getElementById("settingsDisableASCIIArt");
@ -36,6 +37,9 @@ function setSettingsLabels() {
suppressTravelConfirmation.checked = Settings.SuppressTravelConfirmation; suppressTravelConfirmation.checked = Settings.SuppressTravelConfirmation;
suppressBuyAugmentationConfirmation.checked = Settings.SuppressBuyAugmentationConfirmation; suppressBuyAugmentationConfirmation.checked = Settings.SuppressBuyAugmentationConfirmation;
suppressHospitalizationPopup.checked = Settings.SuppressHospitalizationPopup; suppressHospitalizationPopup.checked = Settings.SuppressHospitalizationPopup;
suppressBladeburnerPopup.checked = Settings.SuppressBladeburnerPopup;
suppressBladeburnerPopup.closest('fieldset').style.display =
Player.canAccessBladeburner() ? 'block' : 'none';
setAutosaveLabel(autosaveInterval); setAutosaveLabel(autosaveInterval);
disableHotkeys.checked = Settings.DisableHotkeys; disableHotkeys.checked = Settings.DisableHotkeys;
disableASCIIArt.checked = Settings.CityListView; disableASCIIArt.checked = Settings.CityListView;
@ -99,6 +103,10 @@ function setSettingsLabels() {
Settings.SuppressHospitalizationPopup = this.checked; Settings.SuppressHospitalizationPopup = this.checked;
} }
suppressBladeburnerPopup.onclick = function() {
Settings.SuppressBladeburnerPopup = this.checked;
}
disableHotkeys.onclick = function() { disableHotkeys.onclick = function() {
Settings.DisableHotkeys = this.checked; Settings.DisableHotkeys = this.checked;
} }