Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions unreal_mod_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ sha2 = "0.10.6"
tempfile = { version = "3.4.0", optional = true }
hex = "0.4.3"
egui_commonmark = "0.18.0"
rfd = "0.17.2"

[target.'cfg(windows)'.dependencies]
winreg = "0.11.0"
19 changes: 18 additions & 1 deletion unreal_mod_manager/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,23 @@ impl App for ModLoaderApp {
if ui.button("About").clicked() {
self.about_open.set(true);
}
if ui.button("Install mod").clicked()
{
if let Some(paths) = rfd::FileDialog::new().add_filter(".pak Files", &["pak"]).add_filter("All Files", &["*"]).pick_files()
{
let files_to_import = paths
.into_iter()
.map(|path| FileToProcess::new(path, true))
.collect::<Vec<_>>();

let _ = self
.background_tx
.send(BackgroundThreadMessage::Import(files_to_import));
let _ = self
.background_tx
.send(BackgroundThreadMessage::integrate());
}
}
ui.with_layout(egui::Layout::right_to_left(egui::Align::Min), |ui| {
ui.label(format!("Version: {}", self.modloader_version));
});
Expand Down Expand Up @@ -510,7 +527,7 @@ impl ModLoaderApp {
ui.label(egui::RichText::new("Press DEL to remove this mod.").size(12.0));
}
None => {
ui.label("Drop a .pak file onto this window to install the mod.");
ui.label("Drag-and-drop a .pak file onto this window (or click \"Install mod\") to install the mod.");
ui.label("To enable/disable mods click the checkbox to the left of the mod name.");
ui.label("Then press \"Play\" to start the game with mods.");
ui.label(egui::RichText::new("").size(5.0));
Expand Down
Loading