Commit Graph

44 Commits

Author SHA1 Message Date
hyper f893ac9ff7 feat(framework): add generic types to GameHostScene
Update GameHostScene to support generic types for TResult and TModule,
allowing better type safety when interacting with the game host and
its modules.
2026-04-23 16:11:15 +08:00
hypercross c29b9a43b3 feat(framework): decouple spawner update logic
Extract the core update logic from `spawnEffect` into
`createSpawnUpdate`.
This allows manual updates of spawned objects without relying on
Preact effects, which is useful for non-reactive or imperative
update cycles.

Refactor `Buff` and `BuffSpawner` in `sts-like-viewer` to use the new
`createSpawnUpdate` API for more efficient buff rendering.
2026-04-22 20:59:35 +08:00
hypercross dda290bf9c feat(framework): add hoverEffect utility
Add a `hoverEffect` utility to `boardgame-phaser` to simplify
handling pointerover and pointerout events. Refactor
`CardContainer` in `sts-like-viewer` to use this new utility and
centralize card dimensions in `CARD_CONFIG`.
2026-04-22 15:13:33 +08:00
hypercross 887da22baa fix(framework): check instance of Scene in PhaserScene
Ensure the scene passed to PhaserScene is an instance of Phaser.Scene
before deciding whether to instantiate it.
2026-04-22 00:55:38 +08:00
hypercross cc796d1e11 feat(framework): support multi-button drag and drop
Adds support for tracking the specific mouse button used during
drag-and-drop operations. This includes a new `ALTBUTTON` event type
to handle cases where a different button is pressed while a drag is
already in progress, and disables the browser context menu by default
in the Phaser configuration to prevent interference.
2026-04-20 20:33:56 +08:00
hypercross 7039938a72 refactor: delegate signal effects to DisposableBag
Introduce `addEffect` to `DisposableBag` to encapsulate Preact
signal effect creation and disposal. Update `ReactiveScene` to use
this method, simplifying effect management and ensuring proper
cleanup.
2026-04-20 18:18:26 +08:00
hypercross 22817945cc fix(framework): access scene key via sys.settings in PhaserScene
Use `scene.sys.settings.key` instead of `scene.scene.key` to correctly
retrieve the scene key from the Phaser scene instance.
2026-04-20 15:47:56 +08:00
hypercross 2d412eedb5 refactor(framework): improve PhaserScene flexibility
Allow `PhaserScene` to accept either a scene instance or a scene
constructor. This enables more flexible scene registration within
the `PhaserBridge`. Also updates `sceneKey` to be optional,
defaulting to the scene's internal key.
2026-04-20 15:11:45 +08:00
hypercross 4d34f9fa78 refactor(framework): use callback instead of events in
dragDropEventEffect

Replace Phaser event emissions with a `DragDropCallback` in
`dragDropEventEffect` to provide a more explicit and type-safe API
for handling drag-and-drop interactions.
2026-04-19 13:04:53 +08:00
hypercross 3afe78f54f refactor(framework): allow string ID for GameUI container
Update GameUIOptions to accept either an HTMLElement or a string ID.
If a string is provided, the class will attempt to find the element
by ID or create a new div if it does not exist. Also update the root
property to accept a JSX.Element.
2026-04-19 11:30:14 +08:00
hypercross b0e74a5257 refactor(framework): simplify spawner state management
Consolidate object and data tracking into a single Map in `spawnEffect`
to improve clarity and reduce redundant lookups. Also switch to
type-only
imports for Phaser.
2026-04-19 11:00:01 +08:00
hypercross 648e801dad Style: enforce 2-space indent and double quotes 2026-04-19 10:48:32 +08:00
hypercross d993d55576 Refactor dnd utility and add drag lifecycle events
Attach pointerup and pointermove listeners to scene.input
for reliable tracking. Emit dragstart, dragmove, and
dragend events alongside drag. Rename relativeX/Y to
deltaX/Y in DragDropEvent and integrate DisposableBag.
2026-04-18 23:33:13 +08:00
hypercross 23575dd516 feat: dnd 2026-04-17 21:55:14 +08:00
hypercross 3ca2a16e29 refactor: global state for scenes 2026-04-14 14:21:51 +08:00
hypercross c9acb7f228 refactor: scene control 2026-04-14 11:10:14 +08:00
hyper cc80cbad06 fix: fading 2026-04-12 18:18:45 +08:00
hyper 6584578316 fix: overlay init 2026-04-12 18:11:23 +08:00
hyper f6f18b4789 fix: wait for fade scene init 2026-04-12 18:02:10 +08:00
hyper 70334fa9e3 refactor: wait to launch scene 2026-04-12 18:00:08 +08:00
hyper 9ab7ae3e60 refactor: improved scene manager 2026-04-12 17:52:44 +08:00
hyper fe57583a8f refactor: api 2026-04-12 17:34:25 +08:00
hyper 50531446c2 feat: scene manager and transitions 2026-04-12 16:52:53 +08:00
hyper f8a19653ba refactor: details 2026-04-12 16:31:10 +08:00
hyper 59fa0e6122 refactor: ReactiveScene 2026-04-12 16:26:52 +08:00
hypercross a53f162c03 refactor: update api 2026-04-06 13:59:00 +08:00
hypercross fa104d10f2 refactor: update api 2026-04-06 11:31:51 +08:00
hypercross 61857b8256 fix: api changes fix 2026-04-04 23:14:30 +08:00
hypercross 76687de672 refactor: misc 2026-04-04 16:34:17 +08:00
hypercross bf62805c38 refactor: context update 2026-04-04 16:19:18 +08:00
hypercross 6c86a97c8f refactor: await for tween interruption 2026-04-04 15:43:50 +08:00
hypercross db83e89a46 refactor: expose addInterruption 2026-04-04 15:40:18 +08:00
hypercross aba035f2ec fix: details 2026-04-04 14:47:03 +08:00
hypercross 5fd2c3d208 chore: clean up 2026-04-04 13:48:48 +08:00
hypercross 2984d8b20d refactor: clean up 2026-04-04 13:21:44 +08:00
hypercross 32509d7812 chore: add tests 2026-04-04 00:48:44 +08:00
hypercross 3395a315a6 refactor: simplify input handling? 2026-04-04 00:17:52 +08:00
hypercross 7501b5f592 fix: fix bugs 2026-04-04 00:10:26 +08:00
hypercross 656c33cb59 update: various improvements 2026-04-03 19:39:07 +08:00
hypercross 5d4c169fea fix: update according to boardgame-core 2026-04-03 19:13:12 +08:00
hypercross cbee709a27 docs: sync updated boardgame-core 2026-04-03 17:45:56 +08:00
hypercross 01407b5ede fix: usage compliance 2026-04-03 16:18:11 +08:00
hypercross 6daa77f6f9 refactor: use link instead of file for local dependency 2026-04-03 15:31:29 +08:00
hypercross 588d28ff07 init: board game phaser start 2026-04-03 15:18:47 +08:00