mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 01:03:01 +02:00
CORPORATION: adding prevState and changed state display in the warehouse UI (#861)
This commit is contained in:
@@ -7,7 +7,7 @@ import { Warehouse } from "../Corporation/Warehouse";
|
||||
import { Division } from "../Corporation/Division";
|
||||
import { Corporation, CorporationResolvers } from "../Corporation/Corporation";
|
||||
import { cloneDeep, omit } from "lodash";
|
||||
|
||||
import { setDeprecatedProperties } from "../utils/DeprecationHelper";
|
||||
import {
|
||||
Corporation as NSCorporation,
|
||||
Division as NSDivision,
|
||||
@@ -698,7 +698,7 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
||||
getCorporation: (ctx) => () => {
|
||||
checkAccess(ctx);
|
||||
const corporation = getCorporation();
|
||||
return {
|
||||
const data = {
|
||||
name: corporation.name,
|
||||
funds: corporation.funds,
|
||||
revenue: corporation.revenue,
|
||||
@@ -714,9 +714,18 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
||||
dividendRate: corporation.dividendRate,
|
||||
dividendTax: corporation.dividendTax,
|
||||
dividendEarnings: corporation.getCycleDividends() / corpConstants.secondsPerMarketCycle,
|
||||
state: corporation.state.getState(),
|
||||
nextState: corporation.state.nextName,
|
||||
prevState: corporation.state.prevName,
|
||||
divisions: [...corporation.divisions.keys()],
|
||||
};
|
||||
setDeprecatedProperties(data, {
|
||||
state: {
|
||||
identifier: "ns.corporation.getCorporation().state",
|
||||
message: "Use ns.corporation.getCorporation().nextState instead.",
|
||||
value: corporation.state.nextName,
|
||||
},
|
||||
});
|
||||
return data;
|
||||
},
|
||||
createCorporation:
|
||||
(ctx) =>
|
||||
|
||||
Reference in New Issue
Block a user