fix(android): gate handle_fullscreen and its imports to non-Android
F11 fullscreen toggle only makes sense on desktop; Android windows are always full-screen. Gates the fn and the MonitorSelection/WindowMode imports with #[cfg(not(target_os = "android"))] to keep clippy clean on the Android target. The add_systems call is extracted as a separate statement so #[cfg] can annotate it (cannot appear mid-chain). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,9 @@ use bevy::input::touch::{TouchInput, TouchPhase, Touches};
|
|||||||
use bevy::input::ButtonInput;
|
use bevy::input::ButtonInput;
|
||||||
use bevy::math::{Vec2, Vec3};
|
use bevy::math::{Vec2, Vec3};
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy::window::{MonitorSelection, PrimaryWindow, WindowMode};
|
use bevy::window::PrimaryWindow;
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
|
use bevy::window::{MonitorSelection, WindowMode};
|
||||||
use solitaire_core::card::{Card, Suit};
|
use solitaire_core::card::{Card, Suit};
|
||||||
use solitaire_core::game_state::GameState;
|
use solitaire_core::game_state::GameState;
|
||||||
use solitaire_core::pile::PileType;
|
use solitaire_core::pile::PileType;
|
||||||
@@ -110,8 +112,11 @@ impl Plugin for InputPlugin {
|
|||||||
)
|
)
|
||||||
.chain(),
|
.chain(),
|
||||||
)
|
)
|
||||||
.add_systems(Update, handle_fullscreen)
|
.add_systems(Update, reset_hint_cycle_on_state_change);
|
||||||
.add_systems(Update, reset_hint_cycle_on_state_change)
|
// F11 fullscreen toggle is desktop-only; Android windows are always full-screen.
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
|
app.add_systems(Update, handle_fullscreen);
|
||||||
|
app
|
||||||
// Async hint pipeline: state-change drop runs before the
|
// Async hint pipeline: state-change drop runs before the
|
||||||
// poll system so a move applied this frame cancels any
|
// poll system so a move applied this frame cancels any
|
||||||
// in-flight task before its result can be surfaced.
|
// in-flight task before its result can be surfaced.
|
||||||
@@ -424,6 +429,7 @@ fn reset_hint_cycle_on_state_change(
|
|||||||
|
|
||||||
/// `F11` toggles between borderless-fullscreen and windowed mode.
|
/// `F11` toggles between borderless-fullscreen and windowed mode.
|
||||||
/// Not gated by the pause flag — the player can always resize the window.
|
/// Not gated by the pause flag — the player can always resize the window.
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
fn handle_fullscreen(
|
fn handle_fullscreen(
|
||||||
keys: Res<ButtonInput<KeyCode>>,
|
keys: Res<ButtonInput<KeyCode>>,
|
||||||
mut windows: Query<&mut Window, With<PrimaryWindow>>,
|
mut windows: Query<&mut Window, With<PrimaryWindow>>,
|
||||||
|
|||||||
Reference in New Issue
Block a user