mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-22 14:12:27 +01:00
Merge pull request #321 from hydroflame/buy-aug-setting
moved the suppress buy aug confirmation to settings, will now persist
This commit is contained in:
commit
60c308a28f
11
index.html
11
index.html
@ -886,6 +886,17 @@
|
|||||||
<input type="checkbox" name="settingsSuppressTravelConfirmation" id="settingsSuppressTravelConfirmation">
|
<input type="checkbox" name="settingsSuppressTravelConfirmation" id="settingsSuppressTravelConfirmation">
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Suppress buy aug confirmation -->
|
||||||
|
<fieldset>
|
||||||
|
<label for="settingsSuppressBuyAugmentationConfirmation" class="tooltip">Suppress buy augmentation confirmation:
|
||||||
|
<span class="tooltiptext">
|
||||||
|
If this is set, the confirmation message before buying augmentation will not show up.
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
<input type="checkbox" name="settingsSuppressBuyAugmentationConfirmation" id="settingsSuppressBuyAugmentationConfirmation">
|
||||||
|
</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:
|
||||||
|
@ -439,7 +439,6 @@ function displayFactionContent(factionName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var confirmingPurchases = true;
|
|
||||||
var sortOption = null;
|
var sortOption = null;
|
||||||
function displayFactionAugmentations(factionName) {
|
function displayFactionAugmentations(factionName) {
|
||||||
var faction = Factions[factionName];
|
var faction = Factions[factionName];
|
||||||
@ -468,19 +467,6 @@ function displayFactionAugmentations(factionName) {
|
|||||||
"Augmentations are powerful upgrades that will enhance your abilities."
|
"Augmentations are powerful upgrades that will enhance your abilities."
|
||||||
}));
|
}));
|
||||||
|
|
||||||
//Confirming not confirming button
|
|
||||||
elements.push(createElement("label", {
|
|
||||||
for:"faction-augmentations-confirming-checkbox",innerText:"Confirm Purchases",
|
|
||||||
color:"white", margin:"4px", padding:"4px",
|
|
||||||
}));
|
|
||||||
var confirmingPurchasesCheckbox = createElement("input", {
|
|
||||||
type:"checkbox", id:"faction-augmentations-confirming-checkbox", checked:confirmingPurchases,
|
|
||||||
margin:"4px", padding:"4px",
|
|
||||||
clickListener:()=>{
|
|
||||||
confirmingPurchases = confirmingPurchasesCheckbox.checked;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
elements.push(confirmingPurchasesCheckbox);
|
|
||||||
elements.push(createElement("br"));
|
elements.push(createElement("br"));
|
||||||
elements.push(createElement("br"));
|
elements.push(createElement("br"));
|
||||||
|
|
||||||
@ -585,7 +571,8 @@ function createFactionAugmentationDisplayElements(augmentationsList, augs, facti
|
|||||||
var aElem = createElement("a", {
|
var aElem = createElement("a", {
|
||||||
innerText:aug.name, display:"inline",
|
innerText:aug.name, display:"inline",
|
||||||
clickListener:()=>{
|
clickListener:()=>{
|
||||||
if (confirmingPurchases) {
|
console.log('sup buy in fac: '+Settings.SuppressBuyAugmentationConfirmation);
|
||||||
|
if (!Settings.SuppressBuyAugmentationConfirmation) {
|
||||||
purchaseAugmentationBoxCreate(aug, faction);
|
purchaseAugmentationBoxCreate(aug, faction);
|
||||||
} else {
|
} else {
|
||||||
purchaseAugmentation(aug, faction);
|
purchaseAugmentation(aug, faction);
|
||||||
@ -723,11 +710,13 @@ function purchaseAugmentation(aug, fac, sing=false) {
|
|||||||
if (sing) {
|
if (sing) {
|
||||||
return "You purchased " + aug.name;
|
return "You purchased " + aug.name;
|
||||||
} else {
|
} else {
|
||||||
|
if(!Settings.SuppressBuyAugmentationConfirmation){
|
||||||
dialogBoxCreate("You purchased " + aug.name + ". It's enhancements will not take " +
|
dialogBoxCreate("You purchased " + aug.name + ". It's enhancements will not take " +
|
||||||
"effect until they are installed. To install your augmentations, go to the " +
|
"effect until they are installed. To install your augmentations, go to the " +
|
||||||
"'Augmentations' tab on the left-hand navigation menu. Purchasing additional " +
|
"'Augmentations' tab on the left-hand navigation menu. Purchasing additional " +
|
||||||
"augmentations will now be more expensive.");
|
"augmentations will now be more expensive.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
displayFactionAugmentations(fac.name);
|
displayFactionAugmentations(fac.name);
|
||||||
} else {
|
} else {
|
||||||
|
@ -8,6 +8,7 @@ let Settings = {
|
|||||||
SuppressMessages: false,
|
SuppressMessages: false,
|
||||||
SuppressFactionInvites: false,
|
SuppressFactionInvites: false,
|
||||||
SuppressTravelConfirmation: false,
|
SuppressTravelConfirmation: false,
|
||||||
|
SuppressBuyAugmentationConfirmation: false,
|
||||||
AutosaveInterval: 60,
|
AutosaveInterval: 60,
|
||||||
DisableHotkeys: false,
|
DisableHotkeys: false,
|
||||||
ThemeHighlightColor: "#ffffff",
|
ThemeHighlightColor: "#ffffff",
|
||||||
@ -28,6 +29,7 @@ function initSettings() {
|
|||||||
Settings.SuppressMessages = false;
|
Settings.SuppressMessages = false;
|
||||||
Settings.SuppressFactionInvites = false;
|
Settings.SuppressFactionInvites = false;
|
||||||
Settings.SuppressTravelConfirmation = false,
|
Settings.SuppressTravelConfirmation = false,
|
||||||
|
Settings.SuppressBuyAugmentationConfirmation = false,
|
||||||
Settings.AutosaveInterval = 60;
|
Settings.AutosaveInterval = 60;
|
||||||
Settings.DisableHotkeys = false;
|
Settings.DisableHotkeys = false;
|
||||||
}
|
}
|
||||||
@ -39,6 +41,7 @@ function setSettingsLabels() {
|
|||||||
var suppressMsgs = document.getElementById("settingsSuppressMessages");
|
var suppressMsgs = document.getElementById("settingsSuppressMessages");
|
||||||
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 autosaveInterval = document.getElementById("settingsAutosaveIntervalValLabel");
|
var autosaveInterval = document.getElementById("settingsAutosaveIntervalValLabel");
|
||||||
var disableHotkeys = document.getElementById("settingsDisableHotkeys");
|
var disableHotkeys = document.getElementById("settingsDisableHotkeys");
|
||||||
|
|
||||||
@ -49,6 +52,7 @@ function setSettingsLabels() {
|
|||||||
suppressMsgs.checked = Settings.SuppressMessages;
|
suppressMsgs.checked = Settings.SuppressMessages;
|
||||||
suppressFactionInv.checked = Settings.SuppressFactionInvites;
|
suppressFactionInv.checked = Settings.SuppressFactionInvites;
|
||||||
suppressTravelConfirmation.checked = Settings.SuppressTravelConfirmation;
|
suppressTravelConfirmation.checked = Settings.SuppressTravelConfirmation;
|
||||||
|
suppressBuyAugmentationConfirmation.checked = Settings.SuppressBuyAugmentationConfirmation;
|
||||||
autosaveInterval.innerHTML = Settings.AutosaveInterval;
|
autosaveInterval.innerHTML = Settings.AutosaveInterval;
|
||||||
disableHotkeys.checked = Settings.DisableHotkeys;
|
disableHotkeys.checked = Settings.DisableHotkeys;
|
||||||
|
|
||||||
@ -99,6 +103,11 @@ function setSettingsLabels() {
|
|||||||
Settings.SuppressTravelConfirmation = this.checked;
|
Settings.SuppressTravelConfirmation = this.checked;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
suppressBuyAugmentationConfirmation.onclick = function() {
|
||||||
|
Settings.SuppressBuyAugmentationConfirmation = this.checked;
|
||||||
|
console.log('sup buy: '+Settings.SuppressBuyAugmentationConfirmation);
|
||||||
|
};
|
||||||
|
|
||||||
disableHotkeys.onclick = function() {
|
disableHotkeys.onclick = function() {
|
||||||
Settings.DisableHotkeys = this.checked;
|
Settings.DisableHotkeys = this.checked;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user