mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-02 13:57:05 +02:00
[refactor] Breaking out page tracking from 'engine'
This commit is contained in:
@@ -13,7 +13,6 @@ import {Companies, Company, CompanyPosition,
|
||||
import {CONSTANTS} from "./Constants";
|
||||
import {Programs} from "./CreateProgram";
|
||||
import {DarkWebItems} from "./DarkWeb";
|
||||
import {Engine} from "./engine";
|
||||
import {AllGangs} from "./Gang";
|
||||
import {Factions, Faction, joinFaction,
|
||||
factionExists, purchaseAugmentation} from "./Faction";
|
||||
@@ -50,6 +49,7 @@ import {makeRuntimeRejectMsg, netscriptDelay, runScriptFromScript,
|
||||
import {NetscriptPort} from "./NetscriptPort";
|
||||
|
||||
import Decimal from "decimal.js";
|
||||
import {Page, routing} from "./ui/navigationTracking";
|
||||
import {dialogBoxCreate} from "../utils/DialogBox";
|
||||
import {isPowerOfTwo} from "../utils/helpers/isPowerOfTwo";
|
||||
import {arrayToString} from "../utils/helpers/arrayToString";
|
||||
@@ -1415,7 +1415,7 @@ function NetscriptFunctions(workerScript) {
|
||||
var newTotal = origTotal + totalPrice;
|
||||
stock.playerShares += shares;
|
||||
stock.playerAvgPx = newTotal / stock.playerShares;
|
||||
if (Engine.currentPage == Engine.Page.StockMarket) {
|
||||
if (routing.isOn(Page.StockMarket)) {
|
||||
updateStockPlayerPosition(stock);
|
||||
}
|
||||
if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.buyStock == null) {
|
||||
@@ -1456,7 +1456,7 @@ function NetscriptFunctions(workerScript) {
|
||||
if (stock.playerShares == 0) {
|
||||
stock.playerAvgPx = 0;
|
||||
}
|
||||
if (Engine.currentPage == Engine.Page.StockMarket) {
|
||||
if (routing.isOn(Page.StockMarket)) {
|
||||
updateStockPlayerPosition(stock);
|
||||
}
|
||||
if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.sellStock == null) {
|
||||
|
||||
Reference in New Issue
Block a user