CODEBASE: Refactor Stanek's Gift UI code and change internal FragmentType enum (#2346)

This commit is contained in:
catloversg
2025-10-13 03:23:45 +07:00
committed by GitHub
parent 950c21d734
commit 030be41df9
13 changed files with 253 additions and 160 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import { AugmentationName, FactionName } from "@enums";
import { canAcceptStaneksGift, staneksGift } from "../CotMG/Helper";
import { Fragments, FragmentById } from "../CotMG/Fragment";
import { FragmentType } from "../CotMG/FragmentType";
import { FragmentTypeEnum } from "../CotMG/FragmentType";
import { Stanek as IStanek } from "@nsdefs";
import { NetscriptContext, InternalAPI } from "../Netscript/APIWrapper";
@@ -37,7 +37,7 @@ export function NetscriptStanek(): InternalAPI<IStanek> {
const fragment = staneksGift.findFragment(rootX, rootY);
//Check whether the selected fragment can ge charged
if (!fragment) throw helpers.errorMessage(ctx, `No fragment with root (${rootX}, ${rootY}).`);
if (fragment.fragment().type == FragmentType.Booster) {
if (fragment.fragment().type == FragmentTypeEnum.Booster) {
throw helpers.errorMessage(
ctx,
`The fragment with root (${rootX}, ${rootY}) is a Booster Fragment and thus cannot be charged.`,