Set new radio default emit range to 10
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// Maintainer-controlled web client version.
|
// Maintainer-controlled web client version.
|
||||||
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
||||||
window.CHGRID_WEB_VERSION = "2026.02.25 R241";
|
window.CHGRID_WEB_VERSION = "2026.02.25 R242";
|
||||||
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
||||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
- `emitSound`: optional continuously-looping spatial sound emitted from the item on the grid; global item field and not user-editable in V1.
|
- `emitSound`: optional continuously-looping spatial sound emitted from the item on the grid; global item field and not user-editable in V1.
|
||||||
- `capabilities`, `useSound`, and `emitSound` are derived from global item-type definitions at runtime (not stored per-instance in persisted state).
|
- `capabilities`, `useSound`, and `emitSound` are derived from global item-type definitions at runtime (not stored per-instance in persisted state).
|
||||||
- `useCooldownMs`: global per item type (`radio_station=1000`, `dice=1000`, `wheel=4000`, `clock=1000`, `widget=1000`, `piano=1000`), not per-instance editable.
|
- `useCooldownMs`: global per item type (`radio_station=1000`, `dice=1000`, `wheel=4000`, `clock=1000`, `widget=1000`, `piano=1000`), not per-instance editable.
|
||||||
- `emitRange`: global spatial range default per item type (`radio_station=20`, `dice=15`, `wheel=15`, `clock=10`, `widget=15`, `piano=15`).
|
- `emitRange`: global spatial range default per item type (`radio_station=10`, `dice=15`, `wheel=15`, `clock=10`, `widget=15`, `piano=15`).
|
||||||
- `radio_station` can override this per instance via `params.emitRange` (`5..20`).
|
- `radio_station` can override this per instance via `params.emitRange` (`5..20`).
|
||||||
- `directional`: global directional attenuation flag per item type (`radio_station=true`, others `false`); `widget` can override per instance via `params.directional`.
|
- `directional`: global directional attenuation flag per item type (`radio_station=true`, others `false`); `widget` can override per instance via `params.directional`.
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
"mediaEffect": "off",
|
"mediaEffect": "off",
|
||||||
"mediaEffectValue": 50,
|
"mediaEffectValue": 50,
|
||||||
"facing": 0,
|
"facing": 0,
|
||||||
"emitRange": 20
|
"emitRange": 10
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
- `mediaEffectValue`: number, range `0-100`, precision `0.1`.
|
- `mediaEffectValue`: number, range `0-100`, precision `0.1`.
|
||||||
- `facing`: number, range `0-360`, step `1` (used when `directional=true`).
|
- `facing`: number, range `0-360`, step `1` (used when `directional=true`).
|
||||||
- UI visibility: `facing` is shown only when `directional=true` (`visibleWhen` metadata).
|
- UI visibility: `facing` is shown only when `directional=true` (`visibleWhen` metadata).
|
||||||
- `emitRange`: integer, range `5-20`, default `20`.
|
- `emitRange`: integer, range `5-20`, default `10`.
|
||||||
|
|
||||||
### `dice`
|
### `dice`
|
||||||
|
|
||||||
|
|||||||
@@ -26,12 +26,12 @@ This is behavior-focused documentation for item types and their defaults.
|
|||||||
- `mediaEffect="off"`
|
- `mediaEffect="off"`
|
||||||
- `mediaEffectValue=50`
|
- `mediaEffectValue=50`
|
||||||
- `facing=0`
|
- `facing=0`
|
||||||
- `emitRange=20`
|
- `emitRange=10`
|
||||||
- Global:
|
- Global:
|
||||||
- `useSound=none`
|
- `useSound=none`
|
||||||
- `emitSound=none`
|
- `emitSound=none`
|
||||||
- `useCooldownMs=1000`
|
- `useCooldownMs=1000`
|
||||||
- `emitRange=20`
|
- `emitRange=10`
|
||||||
- `directional=true`
|
- `directional=true`
|
||||||
|
|
||||||
### Use
|
### Use
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ CAPABILITIES: tuple[str, ...] = ("editable", "carryable", "deletable", "usable")
|
|||||||
USE_SOUND: str | None = None
|
USE_SOUND: str | None = None
|
||||||
EMIT_SOUND: str | None = None
|
EMIT_SOUND: str | None = None
|
||||||
USE_COOLDOWN_MS = 1000
|
USE_COOLDOWN_MS = 1000
|
||||||
EMIT_RANGE = 20
|
EMIT_RANGE = 10
|
||||||
DIRECTIONAL = True
|
DIRECTIONAL = True
|
||||||
DEFAULT_TITLE = "radio"
|
DEFAULT_TITLE = "radio"
|
||||||
DEFAULT_PARAMS: dict = {
|
DEFAULT_PARAMS: dict = {
|
||||||
@@ -30,7 +30,7 @@ DEFAULT_PARAMS: dict = {
|
|||||||
"mediaEffect": "off",
|
"mediaEffect": "off",
|
||||||
"mediaEffectValue": 50,
|
"mediaEffectValue": 50,
|
||||||
"facing": 0,
|
"facing": 0,
|
||||||
"emitRange": 20,
|
"emitRange": 10,
|
||||||
}
|
}
|
||||||
PARAM_KEYS: tuple[str, ...] = (
|
PARAM_KEYS: tuple[str, ...] = (
|
||||||
"streamUrl",
|
"streamUrl",
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ def validate_update(item: WorldItem, next_params: dict) -> dict:
|
|||||||
next_params["facing"] = int(round(facing))
|
next_params["facing"] = int(round(facing))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
emit_range = int(next_params.get("emitRange", item.params.get("emitRange", 20)))
|
emit_range = int(next_params.get("emitRange", item.params.get("emitRange", 10)))
|
||||||
except (TypeError, ValueError) as exc:
|
except (TypeError, ValueError) as exc:
|
||||||
raise ValueError("emitRange must be an integer between 5 and 20.") from exc
|
raise ValueError("emitRange must be an integer between 5 and 20.") from exc
|
||||||
if not (5 <= emit_range <= 20):
|
if not (5 <= emit_range <= 20):
|
||||||
|
|||||||
Reference in New Issue
Block a user