diff --git a/client/public/version.js b/client/public/version.js index 9d9c07e..5d3be8f 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.02.22 R196"; +window.CHGRID_WEB_VERSION = "2026.02.22 R197"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/client/src/items/itemPropertyEditor.ts b/client/src/items/itemPropertyEditor.ts index ff8bcb2..13d184f 100644 --- a/client/src/items/itemPropertyEditor.ts +++ b/client/src/items/itemPropertyEditor.ts @@ -308,13 +308,13 @@ export function createItemPropertyEditor(deps: EditorDeps): { } else if ( propertyKey === 'mediaVolume' || propertyKey === 'emitVolume' || - propertyKey === 'emitSoundSpeed' || - propertyKey === 'emitSoundTempo' || propertyKey === 'emitRange' || propertyKey === 'sides' || propertyKey === 'number' ) { if (!submitNumericParam(propertyKey, true)) return; + } else if (propertyKey === 'emitSoundSpeed' || propertyKey === 'emitSoundTempo') { + if (!submitNumericParam(propertyKey, false)) return; } else if (propertyKey === 'mediaEffect' || propertyKey === 'emitEffect') { const normalized = value.trim().toLowerCase(); if (!deps.effectIds.has(normalized)) { diff --git a/server/app/item_catalog.py b/server/app/item_catalog.py index 877a296..3a4c732 100644 --- a/server/app/item_catalog.py +++ b/server/app/item_catalog.py @@ -102,12 +102,12 @@ GLOBAL_ITEM_PROPERTY_METADATA: dict[str, dict[str, object]] = { "emitSoundSpeed": { "valueType": "number", "tooltip": "Global emitted sound speed/pitch percent. 50 is normal.", - "range": {"min": 0, "max": 100, "step": 1}, + "range": {"min": 0, "max": 100, "step": 0.1}, }, "emitSoundTempo": { "valueType": "number", "tooltip": "Global emitted sound tempo percent. 50 is normal.", - "range": {"min": 0, "max": 100, "step": 1}, + "range": {"min": 0, "max": 100, "step": 0.1}, }, } diff --git a/server/app/items/widget.py b/server/app/items/widget.py index d2db81b..d2a01d1 100644 --- a/server/app/items/widget.py +++ b/server/app/items/widget.py @@ -68,12 +68,12 @@ PROPERTY_METADATA: dict[str, dict[str, object]] = { "emitSoundSpeed": { "valueType": "number", "tooltip": "Playback speed/pitch percent for emitted sound. 50 is normal, 0 is half, 100 is double. Using speed and tempo together may sound weird.", - "range": {"min": 0, "max": 100, "step": 1}, + "range": {"min": 0, "max": 100, "step": 0.1}, }, "emitSoundTempo": { "valueType": "number", "tooltip": "Playback tempo percent for emitted sound. 50 is normal, 0 is half, 100 is double. Using speed and tempo together may sound weird.", - "range": {"min": 0, "max": 100, "step": 1}, + "range": {"min": 0, "max": 100, "step": 0.1}, }, "emitEffect": {"valueType": "list", "tooltip": "Effect applied to emitted sound."}, "emitEffectValue": { @@ -147,20 +147,20 @@ def validate_update(item: WorldItem, next_params: dict) -> dict: next_params["emitVolume"] = emit_volume try: - emit_speed = int(next_params.get("emitSoundSpeed", item.params.get("emitSoundSpeed", 50))) + emit_speed = float(next_params.get("emitSoundSpeed", item.params.get("emitSoundSpeed", 50))) except (TypeError, ValueError) as exc: - raise ValueError("emitSoundSpeed must be an integer between 0 and 100.") from exc + raise ValueError("emitSoundSpeed must be a number between 0 and 100.") from exc if not (0 <= emit_speed <= 100): raise ValueError("emitSoundSpeed must be between 0 and 100.") - next_params["emitSoundSpeed"] = emit_speed + next_params["emitSoundSpeed"] = round(emit_speed, 1) try: - emit_tempo = int(next_params.get("emitSoundTempo", item.params.get("emitSoundTempo", 50))) + emit_tempo = float(next_params.get("emitSoundTempo", item.params.get("emitSoundTempo", 50))) except (TypeError, ValueError) as exc: - raise ValueError("emitSoundTempo must be an integer between 0 and 100.") from exc + raise ValueError("emitSoundTempo must be a number between 0 and 100.") from exc if not (0 <= emit_tempo <= 100): raise ValueError("emitSoundTempo must be between 0 and 100.") - next_params["emitSoundTempo"] = emit_tempo + next_params["emitSoundTempo"] = round(emit_tempo, 1) emit_effect = str(next_params.get("emitEffect", item.params.get("emitEffect", "off"))).strip().lower() if emit_effect not in EFFECT_OPTIONS: