feat(engine): implement Draw Mode, Theme, and Music Volume settings

Settings panel "coming soon" stubs replaced with live controls:

- Draw Mode toggle (Draw 1 / Draw 3): new games read draw_mode from
  SettingsResource instead of the previous game's mode. Falls back to
  the current game's mode in headless/test contexts where SettingsPlugin
  is absent.

- Theme selector (Green → Blue → Dark → Green): SettingsChangedEvent
  drives TablePlugin's background Sprite colour so the table re-colours
  immediately without a restart.

- Music Volume [−]/[+]: dedicated kira sub-tracks created for SFX and
  music on startup. SFX sounds are routed to the SFX track; the music
  track exists for future ambient audio. Both volumes are set on
  SettingsChangedEvent and at startup.

Also fixed: time_attack timer_expiry test double-fires when
MinimalPlugins time delta is nonzero — removed the intermediate
0.001-remaining update step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-04-26 23:53:48 +00:00
parent 34ba4dc6ed
commit 3c01cef5f3
6 changed files with 245 additions and 65 deletions
+3 -8
View File
@@ -178,14 +178,9 @@ mod tests {
#[test]
fn timer_expiry_fires_ended_event_and_clears_active() {
let mut app = headless_app();
// Manually start a near-expired session.
*app.world_mut().resource_mut::<TimeAttackResource>() = TimeAttackResource {
active: true,
remaining_secs: 0.001,
wins: 5,
};
app.update();
// First update advances time slightly; force the timer past zero.
// Set the session to an already-expired state (remaining < 0).
// MinimalPlugins time delta is nonzero so we skip the intermediate
// 0.001-remaining step to avoid a double-fire.
*app.world_mut().resource_mut::<TimeAttackResource>() = TimeAttackResource {
active: true,
remaining_secs: -1.0,