Stabilize playback state and cursor feedback
This commit is contained in:
@@ -55,6 +55,7 @@ class UIControllerModule extends BaseModule {
|
||||
'hideUI',
|
||||
'clearDisplay',
|
||||
'sendCommand',
|
||||
'isInteractiveClickTarget',
|
||||
'updateButtonStates'
|
||||
]);
|
||||
}
|
||||
@@ -263,7 +264,7 @@ class UIControllerModule extends BaseModule {
|
||||
});
|
||||
|
||||
this.addEventListener(document, 'click', (event) => {
|
||||
if (event.target && event.target.closest && event.target.closest('#options-modal, #controls, #player_input, #command_input, #story_scrollbar')) {
|
||||
if (this.isInteractiveClickTarget(event.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -635,6 +636,38 @@ class UIControllerModule extends BaseModule {
|
||||
|
||||
console.log('UIController: SentenceQueue pipeline configured');
|
||||
}
|
||||
|
||||
isInteractiveClickTarget(target) {
|
||||
if (!target || typeof target.closest !== 'function') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Boolean(target.closest([
|
||||
'a',
|
||||
'button',
|
||||
'input',
|
||||
'textarea',
|
||||
'select',
|
||||
'label',
|
||||
'[role="button"]',
|
||||
'[role="link"]',
|
||||
'[data-control]',
|
||||
'#controls',
|
||||
'#player_input',
|
||||
'#command_input',
|
||||
'#story_scrollbar',
|
||||
'#story_choices',
|
||||
'#options-modal',
|
||||
'.modal',
|
||||
'.modal-content',
|
||||
'.credits-modal',
|
||||
'.credits-dialog',
|
||||
'.story-popup-modal',
|
||||
'.story-popup-dialog',
|
||||
'.choice-button',
|
||||
'.volume-toggle'
|
||||
].join(',')));
|
||||
}
|
||||
|
||||
handleCommand(command) {
|
||||
// Route commands to appropriate handlers
|
||||
|
||||
Reference in New Issue
Block a user