Add emit sound tempo and global emit speed/tempo defaults

This commit is contained in:
Jage9
2026-02-21 23:17:18 -05:00
parent d3a98ef1ea
commit 9571a3c14d
9 changed files with 88 additions and 11 deletions

View File

@@ -754,6 +754,7 @@ function inferItemPropertyValueType(item: WorldItem, key: string): string | unde
key === 'mediaVolume' ||
key === 'emitVolume' ||
key === 'emitSoundSpeed' ||
key === 'emitSoundTempo' ||
key === 'mediaEffectValue' ||
key === 'emitEffectValue' ||
key === 'facing' ||
@@ -2167,6 +2168,14 @@ function handleItemPropertyEditModeInput(code: string, key: string, ctrlKey: boo
return;
}
signaling.send({ type: 'item_update', itemId, params: { emitSoundSpeed: parsed.value } });
} else if (propertyKey === 'emitSoundTempo') {
const parsed = validateNumericItemPropertyInput(item, propertyKey, value, true);
if (!parsed.ok) {
updateStatus(parsed.message);
audio.sfxUiCancel();
return;
}
signaling.send({ type: 'item_update', itemId, params: { emitSoundTempo: parsed.value } });
} else if (propertyKey === 'mediaEffect' || propertyKey === 'emitEffect') {
const normalized = value.trim().toLowerCase() as EffectId;
if (!EFFECT_IDS.has(normalized)) {