Remove unsupported emit sound reverse option
This commit is contained in:
@@ -101,10 +101,6 @@ GLOBAL_ITEM_PROPERTY_METADATA: dict[str, dict[str, object]] = {
|
||||
"tooltip": "Global emitted sound tempo percent. 50 is normal.",
|
||||
"range": {"min": 0, "max": 100, "step": 1},
|
||||
},
|
||||
"emitSoundReverse": {
|
||||
"valueType": "boolean",
|
||||
"tooltip": "Global emitted sound reverse flag.",
|
||||
},
|
||||
}
|
||||
|
||||
ITEM_TYPE_PROPERTY_METADATA: dict[ItemType, dict[str, dict[str, object]]] = {
|
||||
@@ -140,5 +136,4 @@ def get_item_global_properties(item_type: ItemType) -> dict[str, str | int | boo
|
||||
"directional": bool(definition.directional),
|
||||
"emitSoundSpeed": 50,
|
||||
"emitSoundTempo": 50,
|
||||
"emitSoundReverse": False,
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ EDITABLE_PROPERTIES: tuple[str, ...] = (
|
||||
"emitVolume",
|
||||
"emitSoundSpeed",
|
||||
"emitSoundTempo",
|
||||
"emitSoundReverse",
|
||||
"emitEffect",
|
||||
"emitEffectValue",
|
||||
"useSound",
|
||||
@@ -40,7 +39,6 @@ DEFAULT_PARAMS: dict = {
|
||||
"emitVolume": 100,
|
||||
"emitSoundSpeed": 50,
|
||||
"emitSoundTempo": 50,
|
||||
"emitSoundReverse": False,
|
||||
"emitEffect": "off",
|
||||
"emitEffectValue": 50,
|
||||
"useSound": "",
|
||||
@@ -77,10 +75,6 @@ PROPERTY_METADATA: dict[str, dict[str, object]] = {
|
||||
"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},
|
||||
},
|
||||
"emitSoundReverse": {
|
||||
"valueType": "boolean",
|
||||
"tooltip": "Play emitted sound in reverse.",
|
||||
},
|
||||
"emitEffect": {"valueType": "list", "tooltip": "Effect applied to emitted sound."},
|
||||
"emitEffectValue": {
|
||||
"valueType": "number",
|
||||
@@ -160,12 +154,6 @@ def validate_update(item: WorldItem, next_params: dict) -> dict:
|
||||
raise ValueError("emitSoundTempo must be between 0 and 100.")
|
||||
next_params["emitSoundTempo"] = emit_tempo
|
||||
|
||||
emit_reverse = parse_bool_like(
|
||||
next_params.get("emitSoundReverse", item.params.get("emitSoundReverse", False)),
|
||||
default=False,
|
||||
)
|
||||
next_params["emitSoundReverse"] = emit_reverse
|
||||
|
||||
emit_effect = str(next_params.get("emitEffect", item.params.get("emitEffect", "off"))).strip().lower()
|
||||
if emit_effect not in EFFECT_OPTIONS:
|
||||
raise ValueError("emitEffect must be one of reverb, echo, flanger, high_pass, low_pass, off.")
|
||||
|
||||
@@ -294,7 +294,6 @@ async def test_widget_update_and_use(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"emitVolume": 42,
|
||||
"emitSoundSpeed": 25,
|
||||
"emitSoundTempo": 60,
|
||||
"emitSoundReverse": True,
|
||||
"emitEffect": "reverb",
|
||||
"emitEffectValue": 63.2,
|
||||
"useSound": "ping.ogg",
|
||||
@@ -310,7 +309,6 @@ async def test_widget_update_and_use(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
assert item.params.get("emitVolume") == 42
|
||||
assert item.params.get("emitSoundSpeed") == 25
|
||||
assert item.params.get("emitSoundTempo") == 60
|
||||
assert item.params.get("emitSoundReverse") is True
|
||||
assert item.params.get("emitEffect") == "reverb"
|
||||
assert item.params.get("emitEffectValue") == 63.2
|
||||
assert item.params.get("useSound") == "sounds/ping.ogg"
|
||||
@@ -341,10 +339,3 @@ async def test_widget_update_and_use(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
)
|
||||
assert send_payloads[-1].ok is False
|
||||
assert "emitsoundtempo must be between 0 and 100" in send_payloads[-1].message.lower()
|
||||
|
||||
await server._handle_message(
|
||||
client,
|
||||
json.dumps({"type": "item_update", "itemId": item.id, "params": {"emitSoundReverse": "off"}}),
|
||||
)
|
||||
assert send_payloads[-1].ok is True
|
||||
assert item.params.get("emitSoundReverse") is False
|
||||
|
||||
Reference in New Issue
Block a user