Merge pull request #2373 from MartinFournier/feature/mem-verbose

Add detailed ram cost to mem command
This commit is contained in:
hydroflame
2022-01-06 11:25:41 -05:00
committed by GitHub
5 changed files with 55 additions and 22 deletions
+3 -3
View File
@@ -227,11 +227,11 @@ export function Root(props: IProps): React.ReactElement {
setUpdatingRam(true);
const codeCopy = newCode + "";
const ramUsage = await calculateRamUsage(props.player, codeCopy, props.player.getCurrentServer().scripts);
if (ramUsage > 0) {
debouncedSetRAM("RAM: " + numeralWrapper.formatRAM(ramUsage));
if (ramUsage.cost > 0) {
debouncedSetRAM("RAM: " + numeralWrapper.formatRAM(ramUsage.cost));
return;
}
switch (ramUsage) {
switch (ramUsage.cost) {
case RamCalculationErrorCode.ImportError: {
debouncedSetRAM("RAM: Import Error");
break;