ITADN

Implement quick save/load & fast forward shortcuts

#1048Pull Requesttuan2195 创建于 2025-07-26已合并
T
tuan2195commented
This PR adds support for custom shortcut support on gamepads: * Support for menu, quick load, quick save and toggle fast forward (2x) shortcut * Support custom 2-key combo for triggering shortcut * Quick load and save reuses the autosave file * Can be extended in the future to support different shortcuts AI summary below --- This pull request introduces a new feature for gamepad shortcut bindings and enhances the handling of game shortcuts in the Lemuroid app. The most significant changes include the addition of a new activity for managing gamepad shortcuts, updates to the settings screen and view model to support multiple shortcut types, and new functionality for handling shortcuts like quick save, quick load, and fast forward in gameplay. ### New Feature: Gamepad Shortcut Binding * [`lemuroid-app/src/main/AndroidManifest.xml`](diffhunk://#diff-acea5f1fbf3b8b458bffc9e3d7e4de5b44d47773c915242b425d1c518c1e4866R90-R93): Added a new activity, `GamePadShortcutBindingActivity`, for managing gamepad shortcut bindings. * [`lemuroid-app/src/main/java/com/swordfish/lemuroid/app/LemuroidApplicationModule.kt`](diffhunk://#diff-6f22720507fa18a36c20f97bedb3db62a067bbf1f617af589cb7bc5c447aaa19R117-R120): Registered `GamePadShortcutBindingActivity` with Dagger for dependency injection. * [`lemuroid-app/src/main/java/com/swordfish/lemuroid/app/mobile/feature/input/GamePadShortcutBindingActivity.kt`](diffhunk://#diff-8ae40c0c5c8320b2ff88d0779e7fe0a0709351b3ae39089365d0f715309f5e72R1-R66): Implemented the new activity to handle shortcut bindings via a UI dialog. ### Enhancements to Settings Screen and View Model * [`lemuroid-app/src/main/java/com/swordfish/lemuroid/app/mobile/feature/settings/inputdevices/InputDevicesSettingsScreen.kt`](diffhunk://#diff-8bae3000e90fd3fc5207997ad0246e743b5f3066206a7bcb071998a94b23f8e7L72-R95): Replaced the old menu shortcut implementation with a dynamic list of shortcuts, allowing users to configure multiple shortcut types. * [`lemuroid-app/src/main/java/com/swordfish/lemuroid/app/mobile/feature/settings/inputdevices/InputDevicesSettingsViewModel.kt`](diffhunk://#diff-67c1b6b57e32d1e614862685efe0cf1d3e0f7482e92c6d2cf8d296e50be60d21R85-R95): Updated the view model to support fetching and displaying multiple shortcut types per device. ### Gameplay Shortcut Handling * [`lemuroid-app/src/main/java/com/swordfish/lemuroid/app/shared/game/BaseGameActivity.kt`](diffhunk://#diff-d7831e943fff925323413be1de2bed4a209e2c488ce4887ea6a7c4dd2c788fc6R923-R955): Added new methods to handle shortcuts for quick save, quick load, and toggling fast forward during gameplay. Updated shortcut handling logic to accommodate multiple shortcut types. [[1]](diffhunk://#diff-d7831e943fff925323413be1de2bed4a209e2c488ce4887ea6a7c4dd2c788fc6R923-R955) [[2]](diffhunk://#diff-d7831e943fff925323413be1de2bed4a209e2c488ce4887ea6a7c4dd2c788fc6R1061-R1066) [[3]](diffhunk://#diff-d7831e943fff925323413be1de2bed4a209e2c488ce4887ea6a7c4dd2c788fc6L643-R654) ### Input Device Manager Updates * [`lemuroid-app/src/main/java/com/swordfish/lemuroid/app/shared/input/InputDeviceManager.kt`](diffhunk://#diff-73e3bf7534af032138ea0cd704ae0c3e88e5e0ccc8a4f191e465231378219e38R8-R12): Replaced the previous menu shortcut logic with a more flexible implementation for managing game shortcuts using `GameShortcut` and `GameShortcutType`. [[1]](diffhunk://#diff-73e3bf7534af032138ea0cd704ae0c3e88e5e0ccc8a4f191e465231378219e38R8-R12) [[2]](diffhunk://#diff-73e3bf7534af032138ea0cd704ae0c3e88e5e0ccc8a4f191e465231378219e38R23-R28)
合并状态:已合并 合并于 2025-07-30 关闭于 2025-07-30 0 条评论