Fix piano playback controls and recorded settings

This commit is contained in:
Jage9
2026-02-23 00:45:17 -05:00
parent 93b9d19455
commit 9477beb345
9 changed files with 127 additions and 22 deletions

View File

@@ -243,6 +243,13 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco
case 'item_action_result': {
if (message.ok) {
if (message.action === 'use') {
const pianoStatusLabel =
message.message === 'record' || message.message === 'play' || message.message === 'stop' ? message.message : null;
if (pianoStatusLabel) {
deps.updateStatus(pianoStatusLabel);
deps.audioUiBlip();
break;
}
deps.pushChatMessage(message.message);
const item = message.itemId ? deps.getItemById(message.itemId) : null;
if (!item?.useSound && item && item.type !== 'piano') {

View File

@@ -199,7 +199,7 @@ export type OutgoingMessage =
| { type: 'item_delete'; itemId: string }
| { type: 'item_use'; itemId: string }
| { type: 'item_piano_note'; itemId: string; keyId: string; midi: number; on: boolean }
| { type: 'item_piano_recording'; itemId: string; action: 'toggle_record' | 'playback' }
| { type: 'item_piano_recording'; itemId: string; action: 'toggle_record' | 'playback' | 'stop_playback' }
| {
type: 'item_update';
itemId: string;