mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-08 08:43:53 +01:00
MISC: Expose internal data in dev build (#1611)
This commit is contained in:
parent
8d9f63f49f
commit
4a3dcf8a26
@ -22,7 +22,7 @@ import { checkForMessagesToSend } from "./Message/MessageHelpers";
|
||||
import { loadAllRunningScripts, updateOnlineScriptTimes } from "./NetscriptWorker";
|
||||
import { Player } from "@player";
|
||||
import { saveObject, loadGame } from "./SaveObject";
|
||||
import { initForeignServers } from "./Server/AllServers";
|
||||
import { GetAllServers, initForeignServers } from "./Server/AllServers";
|
||||
import { Settings } from "./Settings/Settings";
|
||||
import { FormatsNeedToChange } from "./ui/formatNumber";
|
||||
import { initSymbolToStockMap, processStockPrices } from "./StockMarket/StockMarket";
|
||||
@ -46,6 +46,22 @@ import { SnackbarEvents } from "./ui/React/Snackbar";
|
||||
import { SaveData } from "./types";
|
||||
import { Go } from "./Go/Go";
|
||||
import { EventEmitter } from "./utils/EventEmitter";
|
||||
import { Companies } from "./Company/Companies";
|
||||
|
||||
declare global {
|
||||
// This property is only available in the dev build
|
||||
// eslint-disable-next-line no-var
|
||||
var Bitburner: {
|
||||
Player: typeof Player;
|
||||
GetAllServers: typeof GetAllServers;
|
||||
Factions: typeof Factions;
|
||||
Companies: typeof Companies;
|
||||
SaveObject: {
|
||||
saveObject: typeof saveObject;
|
||||
loadGame: typeof loadGame;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// Only show warning if the time diff is greater than this value.
|
||||
const thresholdOfTimeDiffForShowingWarningAboutSystemClock = CONSTANTS.MillisecondsPerFiveMinutes;
|
||||
@ -408,6 +424,24 @@ const Engine: {
|
||||
// Start interactive tutorial
|
||||
iTutorialStart();
|
||||
}
|
||||
|
||||
// Expose internal objects/functions in the dev build
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
globalThis.Bitburner = {
|
||||
// Most data is in this object
|
||||
Player: Player,
|
||||
// Manipulate data of servers
|
||||
GetAllServers: GetAllServers,
|
||||
// Manipulate data of Factions and Companies
|
||||
Factions: Factions,
|
||||
Companies: Companies,
|
||||
// saveObject and loadGame can be used to create a custom save/load tool
|
||||
SaveObject: {
|
||||
saveObject: saveObject,
|
||||
loadGame: loadGame,
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
start: function () {
|
||||
|
Loading…
Reference in New Issue
Block a user