haku2: add stats + fix crash w uninit vm
This commit is contained in:
parent
e667c6336a
commit
00a48527ca
12 changed files with 88 additions and 71 deletions
|
@ -43,31 +43,22 @@ export class BrushCostGauges extends HTMLElement {
|
|||
label: "Fuel",
|
||||
}),
|
||||
);
|
||||
this.objectsGauge = this.appendChild(
|
||||
createGauge({
|
||||
className: "objects",
|
||||
iconName: "object",
|
||||
label: "Objects",
|
||||
}),
|
||||
);
|
||||
this.memoryGauge = this.appendChild(
|
||||
createGauge({
|
||||
className: "memory",
|
||||
iconName: "memory",
|
||||
label: "Bulk memory",
|
||||
label: "Memory",
|
||||
}),
|
||||
);
|
||||
|
||||
this.codeSizeGauge.setValue(0);
|
||||
this.fuelGauge.setValue(0);
|
||||
this.objectsGauge.setValue(0);
|
||||
this.memoryGauge.setValue(0);
|
||||
}
|
||||
|
||||
update(stats) {
|
||||
this.codeSizeGauge.setValue(stats.astSize, stats.astSizeMax);
|
||||
this.fuelGauge.setValue(stats.fuel, stats.fuelMax);
|
||||
this.objectsGauge.setValue(stats.numRefs, stats.numRefsMax);
|
||||
this.memoryGauge.setValue(stats.memory, stats.memoryMax);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue