Darktide Mod Manager #39

Merged
lucas merged 91 commits from feat/dtmm into master 2023-03-01 22:27:42 +01:00
Showing only changes of commit 1d12099448 - Show all commits

View file

@ -185,8 +185,13 @@ impl State {
} }
pub fn add_mod(&mut self, info: ModInfo) { pub fn add_mod(&mut self, info: ModInfo) {
self.mods.push_back(info); if let Some(pos) = self.mods.index_of(&info) {
self.selected_mod_index = Some(self.mods.len() - 1); self.mods.set(pos, info);
self.selected_mod_index = Some(pos);
} else {
self.mods.push_back(info);
self.selected_mod_index = Some(self.mods.len() - 1);
}
} }
pub fn can_move_mod_down(&self) -> bool { pub fn can_move_mod_down(&self) -> bool {