Touch: tapping the A button during dialogue advances two lines

Aperta
#49 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
frontend, game-dev

Direzione di ricerca

Start in src/systems/TouchControls.js (_bind), where the A button fires a synthetic Space keydown, then follow it to InputHandler.handleDialogueInput. Compare that with the pointerdown handler on the overlay in src/DialogueManager.js near line 111. Reproduce by dispatching a touch on .tc-a with ?touch=1 in headless Chrome and checking that dialogue index moves by one. Done when one tap advances once and mouse clicks still behave the same.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

With touch controls on (?touch=1), a touch on the on-screen A button while a dialogue is open advances the dialogue twice.

Cause (from an event trace): the touch fires the button's synthetic Space keydown (src/systems/TouchControls.js _bind), which InputHandler.handleDialogueInput turns into dialogueManager.advance(). The same touch also reaches Phaser as a pointer-down on DialogueManager's full-screen overlay (this.overlay.on('pointerdown', () => this.advance()), src/DialogueManager.js around line 111), which advances again in the same millisecond.

How it was seen: headless Chrome with touch events dispatched over CDP (Input.dispatchTouchEvent) on the .tc-a button; dialogue index went 0 -> 2 from one tap. Mouse clicks on the same button advance once. Not yet confirmed on a real phone.

Likely also affected: the B button (overlay advance, then ESC close).

Possible fix: ignore overlay pointer-downs whose DOM target is inside #touch-controls, or stop the touch event from propagating out of the touch-control buttons.

Found while implementing #5.

Lingua principale
JavaScript
Stelle
1
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di devhou-se/game

Tutte le issue di devhou-se/game

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.