Allow effect values at 0.1 precision
This commit is contained in:
@@ -21,7 +21,7 @@ export type EffectRuntime = {
|
||||
|
||||
export function clampEffectLevel(value: number): number {
|
||||
const clamped = Math.max(0, Math.min(100, value));
|
||||
return Math.round(clamped / 5) * 5;
|
||||
return Math.round(clamped * 10) / 10;
|
||||
}
|
||||
|
||||
export function disconnectEffectRuntime(runtime: EffectRuntime | null): void {
|
||||
|
||||
@@ -1831,8 +1831,8 @@ function handleItemPropertyEditModeInput(code: string, key: string): void {
|
||||
signaling.send({ type: 'item_update', itemId, params: { effect: normalized } });
|
||||
} else if (propertyKey === 'effectValue') {
|
||||
const parsed = Number(value);
|
||||
if (!Number.isInteger(parsed) || parsed < 0 || parsed > 100) {
|
||||
updateStatus('effectValue must be an integer between 0 and 100.');
|
||||
if (!Number.isFinite(parsed) || parsed < 0 || parsed > 100) {
|
||||
updateStatus('effectValue must be a number between 0 and 100.');
|
||||
audio.sfxUiCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user