Changed to filenames

This commit is contained in:
2023-12-24 17:00:39 +00:00
parent da4a89ddf6
commit 2589c7fc3d

View File

@@ -69,16 +69,17 @@ impl Default for RustDoomLauncher {
fn is_wad_file(entry: &DirEntry) -> bool {
let filename = entry.file_name().to_str().unwrap().to_lowercase();
println!("{} - > {}", filename, filename.ends_with("wad"));
filename.ends_with("wad")
filename.ends_with("wad") || filename.ends_with("pk3")
}
fn get_wads_in_folder(path: &PathBuf) -> Vec<WadInfo> {
let mut wads = Vec::new();
for entry in WalkDir::new(path) {
for entry in WalkDir::new(path).max_depth(2) {
let entry = entry.unwrap();
if is_wad_file(&entry) {
wads.push(WadInfo {
name: format!("{}", entry.path().display()),
name: format!("{}", entry.path().file_name().unwrap().to_str().unwrap()),
path: entry.path().to_path_buf(),
info_text: None,
})
@@ -267,16 +268,19 @@ impl eframe::App for RustDoomLauncher {
}
});
}
/*
if let Some(rp) = remove_pos {
self.pwad_manager.remove_selectable(rp);
self.command_manager
.add_pwads(&self.pwad_manager.get_current())
}
*/
if let Some(ap) = add_pos {
self.pwad_manager.set_current(ap);
self.command_manager
.add_pwads(&self.pwad_manager.get_current())
}
});
});
ui.separator();