Added option to disable hospitalization popup message

This commit is contained in:
Daniel Xie 2018-08-12 00:39:37 -05:00
parent b15582ff71
commit bb4094f879
8 changed files with 104 additions and 78 deletions

File diff suppressed because one or more lines are too long

29
dist/engine.css vendored

@ -388,32 +388,29 @@ a:visited {
/* Status text */ /* Status text */
@-webkit-keyframes status-text { @-webkit-keyframes status-text {
from { from {
opacity: 1; opacity: 1; }
top: 0; }
to { to {
opacity: 0; opacity: 0; } }
top: 0; } }
.status-text { .status-text {
display: inline; display: inline-block;
height: 15%;
position: fixed; position: fixed;
top: 0; z-index: 2;
-webkit-animation: status-text 3s 1; -webkit-animation: status-text 3s 1; }
background-color: transparent;
height: 15%; }
#status-text-container { #status-text-container {
background-color: transparent; } background-color: transparent; }
#status-text { #status-text {
font-size: 20px;
color: #fff;
right: 0;
bottom: 0;
padding: 4px;
margin-right: 14px;
background-color: transparent; background-color: transparent;
z-index: 2; font-size: 20px;
bottom: 0;
color: #fff;
margin-right: 14px;
padding: 4px;
right: 0;
top: 0;
width: auto; } width: auto; }
/* Character Overview */ /* Character Overview */

114
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

@ -931,6 +931,16 @@
</label> </label>
<input type="checkbox" name="settingsSuppressBuyAugmentationConfirmation" id="settingsSuppressBuyAugmentationConfirmation"> <input type="checkbox" name="settingsSuppressBuyAugmentationConfirmation" id="settingsSuppressBuyAugmentationConfirmation">
</fieldset> </fieldset>
<!-- Hospitalization Popup -->
<fieldset>
<label for="settingsSuppressHospitalizationPopup" class="tooltip">Suppress Hospitalization popup:
<span class="tooltiptext">
If this is set, a popup message will no longer be shown when you are hospitalized after taking too much damage.
</span>
</label>
<input type="checkbox" name="settingsSuppressHospitalizationPopup" id="settingsSuppressHospitalizationPopup">
</fieldset>
<!-- Disable Terminal and Navigation Shortcuts --> <!-- Disable Terminal and Navigation Shortcuts -->
<fieldset> <fieldset>

@ -504,6 +504,7 @@ let CONSTANTS = {
"*** The number (count) of Operations should now increase significantly faster<br>" + "*** The number (count) of Operations should now increase significantly faster<br>" +
"*** There are now, on average, more Synthoid communities in a city<br>" + "*** There are now, on average, more Synthoid communities in a city<br>" +
"*** If automation is enabled (the feature in Bladeburner console), then switching to another action such as working for a company will now disable the automation<br>" + "*** If automation is enabled (the feature in Bladeburner console), then switching to another action such as working for a company will now disable the automation<br>" +
"* There is now a setting for enabling/disabling the popup that appears when you are hospitalized<br>" +
"* Bug Fix: Stock market should now be correctly initialized in BitNode-8 (by Kline-)<br>" + "* Bug Fix: Stock market should now be correctly initialized in BitNode-8 (by Kline-)<br>" +
"* Bug Fix: bladeburner.getCurrentAction() should now properly an 'Idle' object rather than null (by Kline-)<br>" + "* Bug Fix: bladeburner.getCurrentAction() should now properly an 'Idle' object rather than null (by Kline-)<br>" +
"* Bug Fix: Bladeburner skill cost multiplier should now properly increase in BitNode-12 (by hydroflame)<br>" "* Bug Fix: Bladeburner skill cost multiplier should now properly increase in BitNode-12 (by hydroflame)<br>"

@ -16,6 +16,7 @@ import {Gang, resetGangs} from "./Gang";
import {Locations} from "./Locations"; import {Locations} from "./Locations";
import {hasBn11SF, hasWallStreetSF,hasAISF} from "./NetscriptFunctions"; import {hasBn11SF, hasWallStreetSF,hasAISF} from "./NetscriptFunctions";
import {AllServers, Server, AddToAllServers} from "./Server"; import {AllServers, Server, AddToAllServers} from "./Server";
import {Settings} from "./Settings";
import {SpecialServerIps, SpecialServerNames} from "./SpecialServerIps"; import {SpecialServerIps, SpecialServerNames} from "./SpecialServerIps";
import {SourceFiles, applySourceFile} from "./SourceFile"; import {SourceFiles, applySourceFile} from "./SourceFile";
@ -1692,9 +1693,14 @@ PlayerObject.prototype.takeDamage = function(amt) {
} }
PlayerObject.prototype.hospitalize = function() { PlayerObject.prototype.hospitalize = function() {
dialogBoxCreate("You were in critical condition! You were taken to the hospital where " + if (Settings.SuppressHospitalizationPopup === false) {
"luckily they were able to save your life. You were charged $" + dialogBoxCreate(
formatNumber(this.max_hp * CONSTANTS.HospitalCostPerHp, 2)); "You were in critical condition! You were taken to the hospital where " +
"luckily they were able to save your life. You were charged " +
numeral(this.max_hp * CONSTANTS.HospitalCostPerHp).format('$0.000a')
);
}
this.loseMoney(this.max_hp * CONSTANTS.HospitalCostPerHp); this.loseMoney(this.max_hp * CONSTANTS.HospitalCostPerHp);
this.hp = this.max_hp; this.hp = this.max_hp;
} }

@ -48,6 +48,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 to show a popup message when player is hospitalized from taking too much damage
*/
SuppressHospitalizationPopup: boolean;
} }
/** /**
@ -92,6 +97,7 @@ const defaultSettings: IDefaultSettings = {
SuppressFactionInvites: false, SuppressFactionInvites: false,
SuppressMessages: false, SuppressMessages: false,
SuppressTravelConfirmation: false, SuppressTravelConfirmation: false,
SuppressHospitalizationPopup: false,
}; };
/** /**
@ -110,6 +116,7 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = {
SuppressFactionInvites: defaultSettings.SuppressFactionInvites, SuppressFactionInvites: defaultSettings.SuppressFactionInvites,
SuppressMessages: defaultSettings.SuppressMessages, SuppressMessages: defaultSettings.SuppressMessages,
SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation, SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation,
SuppressHospitalizationPopup: defaultSettings.SuppressHospitalizationPopup,
ThemeBackgroundColor: "#000000", ThemeBackgroundColor: "#000000",
ThemeFontColor: "#66ff33", ThemeFontColor: "#66ff33",
ThemeHighlightColor: "#ffffff", ThemeHighlightColor: "#ffffff",

@ -9,6 +9,7 @@ function setSettingsLabels() {
var suppressFactionInv = document.getElementById("settingsSuppressFactionInvites") var suppressFactionInv = document.getElementById("settingsSuppressFactionInvites")
var suppressTravelConfirmation = document.getElementById("settingsSuppressTravelConfirmation"); var suppressTravelConfirmation = document.getElementById("settingsSuppressTravelConfirmation");
var suppressBuyAugmentationConfirmation = document.getElementById("settingsSuppressBuyAugmentationConfirmation"); var suppressBuyAugmentationConfirmation = document.getElementById("settingsSuppressBuyAugmentationConfirmation");
var suppressHospitalizationPopup = document.getElementById("settingsSuppressHospitalizationPopup");
var autosaveInterval = document.getElementById("settingsAutosaveIntervalValLabel"); var autosaveInterval = document.getElementById("settingsAutosaveIntervalValLabel");
var disableHotkeys = document.getElementById("settingsDisableHotkeys"); var disableHotkeys = document.getElementById("settingsDisableHotkeys");
@ -20,6 +21,7 @@ function setSettingsLabels() {
suppressFactionInv.checked = Settings.SuppressFactionInvites; suppressFactionInv.checked = Settings.SuppressFactionInvites;
suppressTravelConfirmation.checked = Settings.SuppressTravelConfirmation; suppressTravelConfirmation.checked = Settings.SuppressTravelConfirmation;
suppressBuyAugmentationConfirmation.checked = Settings.SuppressBuyAugmentationConfirmation; suppressBuyAugmentationConfirmation.checked = Settings.SuppressBuyAugmentationConfirmation;
suppressHospitalizationPopup.checked = Settings.SuppressHospitalizationPopup;
autosaveInterval.innerHTML = Settings.AutosaveInterval; autosaveInterval.innerHTML = Settings.AutosaveInterval;
disableHotkeys.checked = Settings.DisableHotkeys; disableHotkeys.checked = Settings.DisableHotkeys;
@ -72,8 +74,11 @@ function setSettingsLabels() {
suppressBuyAugmentationConfirmation.onclick = function() { suppressBuyAugmentationConfirmation.onclick = function() {
Settings.SuppressBuyAugmentationConfirmation = this.checked; Settings.SuppressBuyAugmentationConfirmation = this.checked;
console.log('sup buy: '+Settings.SuppressBuyAugmentationConfirmation);
}; };
suppressHospitalizationPopup.onclick = function() {
Settings.SuppressHospitalizationPopup = this.checked;
}
disableHotkeys.onclick = function() { disableHotkeys.onclick = function() {
Settings.DisableHotkeys = this.checked; Settings.DisableHotkeys = this.checked;