1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-01-15 23:36:41 +00:00

This implementation is better[ci skip]

This commit is contained in:
biroder 2023-06-28 12:15:54 +03:00
parent 425a26b3a0
commit f7148edd96

View file

@ -42,7 +42,6 @@ enum MainMenuEntry {
Controller, Controller,
Rebind, Rebind,
Rumble, Rumble,
#[cfg(target_os = "android")]
DisplayTouchControls, DisplayTouchControls,
Back, Back,
} }
@ -224,7 +223,7 @@ impl ControlsMenu {
self.main.push_entry(MainMenuEntry::Rumble, MenuEntry::Hidden); self.main.push_entry(MainMenuEntry::Rumble, MenuEntry::Hidden);
} }
#[cfg(target_os = "android")] if state.settings.touch_controls {
self.main.push_entry( self.main.push_entry(
MainMenuEntry::DisplayTouchControls, MainMenuEntry::DisplayTouchControls,
MenuEntry::Toggle( MenuEntry::Toggle(
@ -232,6 +231,7 @@ impl ControlsMenu {
state.settings.display_touch_controls, state.settings.display_touch_controls,
), ),
); );
}
self.main.push_entry(MainMenuEntry::Back, MenuEntry::Active(state.loc.t("common.back").to_owned())); self.main.push_entry(MainMenuEntry::Back, MenuEntry::Active(state.loc.t("common.back").to_owned()));
self.confirm_reset.push_entry( self.confirm_reset.push_entry(
@ -972,7 +972,6 @@ impl ControlsMenu {
state.settings.save(ctx)?; state.settings.save(ctx)?;
} }
} }
#[cfg(target_os = "android")]
MenuSelectionResult::Selected(MainMenuEntry::DisplayTouchControls, toggle) => { MenuSelectionResult::Selected(MainMenuEntry::DisplayTouchControls, toggle) => {
if let MenuEntry::Toggle(_, value) = toggle { if let MenuEntry::Toggle(_, value) = toggle {
state.settings.display_touch_controls = !state.settings.display_touch_controls; state.settings.display_touch_controls = !state.settings.display_touch_controls;