mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-04 14:47:53 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
+32
-29
@@ -2,50 +2,53 @@
|
||||
import { Player } from "../src/Player";
|
||||
|
||||
//Close box when clicking outside
|
||||
$(document).click(function(event) {
|
||||
if (gameOptionsOpened) {
|
||||
if ( $(event.target).closest(".game-options-box").get(0) == null ) {
|
||||
gameOptionsBoxClose();
|
||||
}
|
||||
$(document).click(function (event) {
|
||||
if (gameOptionsOpened) {
|
||||
if ($(event.target).closest(".game-options-box").get(0) == null) {
|
||||
gameOptionsBoxClose();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var gameOptionsOpened = false;
|
||||
function gameOptionsBoxInit() {
|
||||
//Menu link button
|
||||
document.getElementById("options-menu-link").addEventListener("click", function() {
|
||||
gameOptionsBoxOpen();
|
||||
return false;
|
||||
//Menu link button
|
||||
document
|
||||
.getElementById("options-menu-link")
|
||||
.addEventListener("click", function () {
|
||||
gameOptionsBoxOpen();
|
||||
return false;
|
||||
});
|
||||
|
||||
//Close button
|
||||
var closeButton = document.getElementById("game-options-close-button");
|
||||
closeButton.addEventListener("click", function() {
|
||||
gameOptionsBoxClose();
|
||||
return false;
|
||||
});
|
||||
//Close button
|
||||
var closeButton = document.getElementById("game-options-close-button");
|
||||
closeButton.addEventListener("click", function () {
|
||||
gameOptionsBoxClose();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", gameOptionsBoxInit, false);
|
||||
|
||||
function gameOptionsBoxClose() {
|
||||
gameOptionsOpened = false;
|
||||
var box = document.getElementById("game-options-container");
|
||||
box.style.display = "none";
|
||||
gameOptionsOpened = false;
|
||||
var box = document.getElementById("game-options-container");
|
||||
box.style.display = "none";
|
||||
}
|
||||
|
||||
function gameOptionsBoxOpen() {
|
||||
var box = document.getElementById("game-options-container");
|
||||
box.style.display = "flex";
|
||||
|
||||
// special exception for bladeburner popup because it's only visible later.
|
||||
document.getElementById("settingsSuppressBladeburnerPopup")
|
||||
.closest('fieldset').style.display =
|
||||
Player.canAccessBladeburner() ? 'block' : 'none';
|
||||
setTimeout(function() {
|
||||
gameOptionsOpened = true;
|
||||
}, 500);
|
||||
var box = document.getElementById("game-options-container");
|
||||
box.style.display = "flex";
|
||||
|
||||
// special exception for bladeburner popup because it's only visible later.
|
||||
document
|
||||
.getElementById("settingsSuppressBladeburnerPopup")
|
||||
.closest("fieldset").style.display = Player.canAccessBladeburner()
|
||||
? "block"
|
||||
: "none";
|
||||
setTimeout(function () {
|
||||
gameOptionsOpened = true;
|
||||
}, 500);
|
||||
}
|
||||
|
||||
export {gameOptionsBoxOpen, gameOptionsBoxClose};
|
||||
export { gameOptionsBoxOpen, gameOptionsBoxClose };
|
||||
|
||||
Reference in New Issue
Block a user