fix(engine): prevent stock-tap from toggling HUD on Android
Every draw-from-stock tap was also firing the HUD auto-hide toggle because the stock pile is not an ActionButton and toggle_hud_on_tap had no way to know the tap was consumed by game logic. Add GameInputConsumedResource(bool): handle_touch_stock_tap sets it on TouchPhase::Started when a draw fires; toggle_hud_on_tap checks and clears it on TouchPhase::Ended, treating it as equivalent to started_on_button so the HUD stays put. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -114,6 +114,13 @@ pub struct HintCycleIndex(pub usize);
|
||||
#[derive(Resource, Debug, Clone, Default)]
|
||||
pub struct SettingsScrollPos(pub f32);
|
||||
|
||||
/// Set to `true` by an input system when a touch tap is consumed by game logic
|
||||
/// (e.g. drawing from stock). `toggle_hud_on_tap` checks this flag on
|
||||
/// `TouchPhase::Ended` and skips the HUD visibility toggle when set, then
|
||||
/// resets it to `false` so subsequent taps behave normally.
|
||||
#[derive(Resource, Debug, Clone, Default)]
|
||||
pub struct GameInputConsumedResource(pub bool);
|
||||
|
||||
/// Shared Tokio runtime used by all async-task closures that need HTTP I/O.
|
||||
///
|
||||
/// Bevy's `AsyncComputeTaskPool` uses `async-executor` (not Tokio), so spawned
|
||||
|
||||
Reference in New Issue
Block a user