Improve relic shard mode autobuyer box formatting

This commit is contained in:
SpectralFlame 2023-07-12 22:05:19 -05:00 committed by cyip92
parent da392637e6
commit 24e9a2f6ce
2 changed files with 4 additions and 2 deletions

View File

@ -111,7 +111,7 @@ export default {
</div>
<AutobuyerInput
:autobuyer="autobuyer"
:type="(hasAlternateInputs && hasRelicMode) ? 'float' : 'int'"
:type="(hasAlternateInputs && hasRelicMode) ? 'decimal' : 'int'"
:property="(hasAlternateInputs && hasRelicMode) ? 'shard' : 'glyph'"
/>
<div v-if="isOverCap">

View File

@ -53,8 +53,10 @@ export class RealityAutobuyerState extends AutobuyerState {
return this.data.shard;
}
// This only gets set via functions in AutobuyerInput.vue; we want to take advantage of auto-formatting when the input
// is for a Decimal prop, but the actual value needs to be clamped to fit within a Number
set shard(value) {
this.data.shard = value;
this.data.shard = value.clamp(0, Number.MAX_VALUE).toNumber();
}
toggleMode() {