Save input mappings to disk

This commit is contained in:
2024-12-11 23:44:14 -05:00
parent ae04f9f73b
commit 6e2d70abd7
8 changed files with 270 additions and 22 deletions
+3 -1
View File
@@ -17,6 +17,7 @@ use crate::{
controller::ControllerManager,
emulator::{EmulatorClient, EmulatorCommand, SimId},
input::MappingProvider,
persistence::Persistence,
window::{AppWindow, GameWindow, InputWindow},
};
@@ -44,7 +45,8 @@ pub struct Application {
impl Application {
pub fn new(client: EmulatorClient, proxy: EventLoopProxy<UserEvent>) -> Self {
let icon = load_icon().ok().map(Arc::new);
let mappings = MappingProvider::new();
let persistence = Persistence::new();
let mappings = MappingProvider::new(persistence);
let controllers = ControllerManager::new(client.clone(), &mappings);
{
let mappings = mappings.clone();