move some android guards (#917)

* move some android guards

* more
This commit is contained in:
Logan McNaughton
2026-05-19 14:10:25 +02:00
committed by GitHub
parent dbe67f1034
commit be9ba1366e
2 changed files with 13 additions and 4 deletions
+1 -4
View File
@@ -139,7 +139,6 @@ fn local_game_window(app: &AppWindow, config: &ui::config::Config) {
file_dropped(app);
}
#[cfg(not(target_os = "android"))]
fn input_profiles(config: &ui::config::Config) -> Vec<String> {
let mut profiles = vec![];
for key in config.input.input_profiles.keys() {
@@ -178,7 +177,6 @@ fn settings_window(app: &AppWindow, config: &ui::config::Config) {
}
}
#[cfg(not(target_os = "android"))]
fn update_input_profiles(weak: &slint::Weak<AppWindow>, config: &ui::config::Config) {
let profiles = input_profiles(config);
let config_bindings = config.input.input_profile_binding.clone();
@@ -224,8 +222,8 @@ fn clear_gb_paths(weak: &slint::Weak<AppWindow>, player: i32) {
.unwrap();
}
#[cfg(not(target_os = "android"))]
fn controller_window(app: &AppWindow, config: &ui::config::Config) {
#[cfg(not(target_os = "android"))]
ui::sdl_init(sdl3_sys::init::SDL_INIT_GAMEPAD);
app.set_emulate_vru(config.input.emulate_vru);
@@ -510,7 +508,6 @@ pub fn app_window() {
{
let config = ui::config::Config::new();
settings_window(&app, &config);
#[cfg(not(target_os = "android"))]
controller_window(&app, &config);
local_game_window(&app, &config);
}
+12
View File
@@ -343,6 +343,7 @@ fn hotkey_pressed(
pressed
}
#[cfg(not(target_os = "android"))]
pub fn get_controller_names() -> Vec<String> {
let mut controllers: Vec<String> = vec![];
@@ -359,6 +360,11 @@ pub fn get_controller_names() -> Vec<String> {
controllers
}
#[cfg(target_os = "android")]
pub fn get_controller_names() -> Vec<String> {
vec!["None".into()]
}
#[cfg(not(target_os = "android"))]
#[cfg(feature = "gui")]
pub fn get_controller_paths() -> Vec<String> {
@@ -377,6 +383,12 @@ pub fn get_controller_paths() -> Vec<String> {
controller_paths
}
#[cfg(target_os = "android")]
#[cfg(feature = "gui")]
pub fn get_controller_paths() -> Vec<String> {
vec![String::new()]
}
fn handle_joystick_events(ui: &mut ui::Ui) {
let joystick_event = unsafe { ui::video::get_joystick_event() };
if joystick_event.joystick_id != 0 {