From 276e16857c287be2275fe5b9fb03ecba94cdc37f Mon Sep 17 00:00:00 2001 From: Warren Hood Date: Sat, 24 Aug 2024 04:22:39 +0200 Subject: [PATCH] Load profile for edit profile view --- mmm/src/main.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mmm/src/main.rs b/mmm/src/main.rs index 3367d2e..3abea4c 100644 --- a/mmm/src/main.rs +++ b/mmm/src/main.rs @@ -134,7 +134,20 @@ impl Application for ManagerGUI { } }; } - // TODO: Load profile for EditProfile + ManagerView::EditProfile { profile } => { + let loaded_profile = self.userdata.get_profile(profile); + self.profile_edit_settings.name = profile.trim().into(); + if let Some(loaded_profile) = loaded_profile { + self.profile_edit_settings.name = profile.into(); + self.profile_edit_settings.mods_dir = + Some(loaded_profile.mods_folder.clone()); + self.profile_edit_settings.pack_source = + loaded_profile.pack_source.to_string(); + self.profile_edit_settings.side = loaded_profile.side; + } else { + eprintln!("Failed to load existing profile data for {profile}"); + } + } _ => {} }; self.current_view = view;