Skip to content

Fix frame script dispatch and mouse hover event tracking - #88

Open
matthewdean wants to merge 2 commits into
mainfrom
bionicle-atticmedia-behaviors
Open

Fix frame script dispatch and mouse hover event tracking#88
matthewdean wants to merge 2 commits into
mainfrom
bionicle-atticmedia-behaviors

Conversation

@matthewdean

@matthewdean matthewdean commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Dispatch beginSprite/enterFrame/exitFrame to channel 0 (frame script) behavior instances directly, matching ScummVM's script channel handling
  • Use get_interactable_sprite_at for mouse hover tracking so only sprites with mouse handlers participate in hover state (matching Director behavior)
  • Clear hovered_sprite and fire mouseLeave when mouse leaves all interactable sprites

Context

Replaces the previous large score parsing refactor with two targeted fixes. The score parsing on main already handles D6+ games correctly — the actual issues were event dispatch routing and mouse event semantics.

Verified against ScummVM (engines/director/events.cpp, score.cpp) and Adobe Director documentation.

Test plan

  • Builds with wasm-pack build --dev --target web
  • Bionicle Atticmedia: menu → character select → hover shows single flyout → click starts game
  • Verify D5 movies still work
  • Verify other D6+ movies still work

🤖 Generated with Claude Code

@matthewdean
matthewdean marked this pull request as ready for review March 25, 2026 08:03
@matthewdean
matthewdean force-pushed the bionicle-atticmedia-behaviors branch 2 times, most recently from bc860d5 to 8dc4fbc Compare March 29, 2026 00:42
@igorlira

igorlira commented Apr 4, 2026

Copy link
Copy Markdown
Owner

@matthewdean This has some conflicts with the other changes made to the score, it's also introducing some playback issues on previously working games, such as Furni Factory, Habbo and some Nintendo games. Let me know how I can help you debug those issues

matthewdean and others added 2 commits April 4, 2026 15:51
Channel 0 behavior instances now receive beginSprite via targeted
dispatch instead of the frame/movie script path. Also dispatch
enterFrame/exitFrame to channel 0 behaviors in the all-behaviors
loop, matching ScummVM's script channel handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use get_interactable_sprite_at instead of get_sprite_at for hover
tracking, matching Director behavior where only sprites with mouse
handlers participate in hover state. Also clear hovered_sprite and
fire mouseLeave when the mouse leaves all interactable sprites.

Fixes repeated mouseEnter events when non-scripted sprites overlap
scripted ones (e.g. Bionicle Atticmedia character selection flyouts).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matthewdean
matthewdean force-pushed the bionicle-atticmedia-behaviors branch from 8dc4fbc to 56c9bee Compare April 4, 2026 22:56
@matthewdean matthewdean changed the title D6+ behavior and score system Fix frame script dispatch and mouse hover event tracking Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants