mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-02 05:47:14 +02:00
v2.2.1 (#293)
* handle enums differently * Enums are frozen and fed directly to the proxy * Enums are not included in the NSFull definition, allowing samekeys for RamCostTree<API>, InternalAPI<API>, and ExternalAPI<API> * Rewrote a lot of the ramcalc test, with better typing thanks to the samekeys above * Fix ns1 for proxy (args, pid, and enums after above changes were not being added to ns1 scripts.) * Fixed an overview issue where the bars could display inaccurately. Update changelog and bump version to 2.2.1
This commit is contained in:
@@ -91,11 +91,12 @@ export const enums: NSEnums = {
|
||||
ToastVariant,
|
||||
UniversityClassType,
|
||||
};
|
||||
for (const val of Object.values(enums)) Object.freeze(val);
|
||||
Object.freeze(enums);
|
||||
|
||||
export type NSFull = Readonly<Omit<NS & INetscriptExtra, "pid" | "args">>;
|
||||
export type NSFull = Readonly<Omit<NS & INetscriptExtra, "pid" | "args" | "enums">>;
|
||||
|
||||
export const ns: InternalAPI<NSFull> = {
|
||||
enums,
|
||||
singularity: NetscriptSingularity(),
|
||||
gang: NetscriptGang(),
|
||||
bladeburner: NetscriptBladeburner(),
|
||||
@@ -1894,7 +1895,7 @@ Object.assign(ns, {
|
||||
});
|
||||
|
||||
export function NetscriptFunctions(ws: WorkerScript): ExternalAPI<NSFull> {
|
||||
return NSProxy(ws, ns, [], { args: ws.args.slice(), pid: ws.pid });
|
||||
return NSProxy(ws, ns, [], { args: ws.args.slice(), pid: ws.pid, enums });
|
||||
}
|
||||
|
||||
const possibleLogs = Object.fromEntries([...getFunctionNames(ns, "")].map((a) => [a, true]));
|
||||
|
||||
Reference in New Issue
Block a user