Apply item-specific spatial range to use sounds

This commit is contained in:
Jage9
2026-02-27 01:10:32 -05:00
parent 4ed52649f1
commit 47a7aa0a83
7 changed files with 15 additions and 6 deletions

View File

@@ -68,7 +68,7 @@ type MessageHandlerDeps = {
shouldAnnounceItemPropertyEcho: () => boolean;
playLocateToneAt: (x: number, y: number) => void;
resolveIncomingSoundUrl: (url: string) => string;
playIncomingItemUseSound: (url: string, x: number, y: number) => void;
playIncomingItemUseSound: (url: string, x: number, y: number, range?: number) => void;
playClockAnnouncement: (sounds: string[], x: number, y: number) => void;
handleAuthRequired: (message: Extract<IncomingMessage, { type: 'auth_required' }>) => void;
handleAuthResult: (message: Extract<IncomingMessage, { type: 'auth_result' }>) => Promise<void>;
@@ -297,7 +297,7 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco
const soundUrl = deps.resolveIncomingSoundUrl(message.sound);
if (!soundUrl) break;
if (deps.getAudioLayers().world) {
deps.playIncomingItemUseSound(soundUrl, message.x, message.y);
deps.playIncomingItemUseSound(soundUrl, message.x, message.y, message.range);
}
break;
}