mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 04:35:46 +01:00
Add API server information menu item
This commit is contained in:
parent
d0214c1fed
commit
bdef14b029
@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const { app, BrowserWindow, shell } = require("electron");
|
||||
const { app, BrowserWindow } = require("electron");
|
||||
const log = require("electron-log");
|
||||
const utils = require("./utils");
|
||||
const achievements = require("./achievements");
|
||||
@ -31,9 +31,7 @@ async function createWindow(killall) {
|
||||
|
||||
// and open every other protocols on the browser
|
||||
e.preventDefault();
|
||||
shell.openExternal(url);
|
||||
|
||||
global.app_playerOpenedExternalLink = true;
|
||||
utils.openExternal(url);
|
||||
});
|
||||
window.webContents.backgroundThrottling = false;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const { Menu, clipboard } = require("electron");
|
||||
const { Menu, clipboard, dialog } = require("electron");
|
||||
const log = require("electron-log");
|
||||
const api = require("./api-server");
|
||||
const utils = require("./utils");
|
||||
@ -78,6 +78,30 @@ function getMenu(window) {
|
||||
clipboard.writeText(token);
|
||||
})
|
||||
},
|
||||
{
|
||||
type: 'separator',
|
||||
},
|
||||
{
|
||||
label: 'Information',
|
||||
click: () => {
|
||||
dialog.showMessageBox({
|
||||
type: 'info',
|
||||
title: 'Bitburner > API Server Information',
|
||||
message: 'The API Server is used to write script files to your in-game home.',
|
||||
detail: 'There is an official Visual Studio Code extension that makes use of that feature.\n\n' +
|
||||
'It allows you to write your script file in an external IDE and have them pushed over to the game automatically.\n' +
|
||||
'If you want more information, head over to: https://github.com/bitburner-official/bitburner-vscode.',
|
||||
buttons: ['Dismiss', 'Open Extension Link (GitHub)'],
|
||||
defaultId: 0,
|
||||
cancelId: 0,
|
||||
noLink: true,
|
||||
}).then(({response}) => {
|
||||
if (response === 1) {
|
||||
utils.openExternal('https://github.com/bitburner-official/bitburner-vscode');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const { app, dialog } = require("electron");
|
||||
const { app, dialog, shell } = require("electron");
|
||||
const log = require("electron-log");
|
||||
|
||||
const achievements = require("./achievements");
|
||||
@ -93,7 +93,13 @@ async function exportSave(window) {
|
||||
.executeJavaScript(`${exportSaveFromIndexedDb.toString()}; exportSaveFromIndexedDb();`, true);
|
||||
}
|
||||
|
||||
function openExternal(url) {
|
||||
shell.openExternal(url);
|
||||
global.app_playerOpenedExternalLink = true;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
reloadAndKill, showErrorBox, exportSave,
|
||||
attachUnresponsiveAppHandler, detachUnresponsiveAppHandler,
|
||||
openExternal,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user