Rename widget emitSoundSpeed property

This commit is contained in:
Jage9
2026-02-21 23:10:17 -05:00
parent dd06d882e7
commit d3a98ef1ea
8 changed files with 23 additions and 23 deletions

View File

@@ -110,7 +110,7 @@ export class ItemEmitRuntime {
const effect = normalizeRadioEffect(item.params.emitEffect);
const effectValue = normalizeRadioEffectValue(item.params.emitEffectValue);
const effectRuntime = connectEffectChain(audioCtx, effectInput, gain, effect, effectValue);
element.playbackRate = resolveEmitPlaybackRate(item.params.emitSpeed);
element.playbackRate = resolveEmitPlaybackRate(item.params.emitSoundSpeed);
if (this.audio.supportsStereoPanner()) {
panner = audioCtx.createStereoPanner();
gain.connect(panner).connect(audioCtx.destination);
@@ -148,7 +148,7 @@ export class ItemEmitRuntime {
output.effect = effect;
output.effectValue = effectValue;
}
const nextPlaybackRate = resolveEmitPlaybackRate(item.params.emitSpeed);
const nextPlaybackRate = resolveEmitPlaybackRate(item.params.emitSoundSpeed);
if (Math.abs(output.element.playbackRate - nextPlaybackRate) > 0.001) {
output.element.playbackRate = nextPlaybackRate;
}

View File

@@ -52,7 +52,7 @@ const DEFAULT_ITEM_TYPE_EDITABLE_PROPERTIES: Record<ItemType, string[]> = {
dice: ['title', 'sides', 'number'],
wheel: ['title', 'spaces'],
clock: ['title', 'timeZone', 'use24Hour'],
widget: ['title', 'enabled', 'directional', 'facing', 'emitRange', 'emitVolume', 'emitSpeed', 'emitEffect', 'emitEffectValue', 'useSound', 'emitSound'],
widget: ['title', 'enabled', 'directional', 'facing', 'emitRange', 'emitVolume', 'emitSoundSpeed', 'emitEffect', 'emitEffectValue', 'useSound', 'emitSound'],
};
const DEFAULT_ITEM_TYPE_GLOBAL_PROPERTIES: Record<ItemType, Record<string, string | number | boolean>> = {
@@ -196,7 +196,7 @@ export function itemPropertyLabel(key: string): string {
if (key === 'emitRange') return 'emit range';
if (key === 'mediaVolume') return 'media volume';
if (key === 'emitVolume') return 'emit volume';
if (key === 'emitSpeed') return 'emit speed';
if (key === 'emitSoundSpeed') return 'emit sound speed';
if (key === 'mediaChannel') return 'media channel';
if (key === 'mediaEffect') return 'media effect';
if (key === 'mediaEffectValue') return 'media effect value';

View File

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