Forgot to add fast monsters

This commit is contained in:
2023-06-12 22:51:01 +01:00
parent 665470fec0
commit 075f07c971

View File

@@ -134,6 +134,9 @@ impl RustDoomLauncher {
if self.respawning_monsters {
command.push("-respawn");
}
if self.fast_monsters {
command.push("-fast");
}
Ok((launcher.path.to_str().unwrap(), command))
}
@@ -194,7 +197,6 @@ impl eframe::App for RustDoomLauncher {
self.config_file_loaded = true;
}
egui::containers::panel::CentralPanel::default().show(ctx, |ui| {
ui.horizontal(|ui| {
ui.heading("RustDoomLauncher");
let button = match self.launcher_and_iwad() {
@@ -356,83 +358,83 @@ impl eframe::App for RustDoomLauncher {
}
});
egui::Window::new("Add WAD or Launcher")
.open(&mut self.add_stuff_window_displayed)
.show(ctx, |ui| {
ui.horizontal(|ui| {
let name_label = ui.label("Name");
ui.text_edit_singleline(&mut self.name)
.labelled_by(name_label.id);
});
ui.horizontal(|ui| {
ui.label("Path");
ui.label(
self.selected_file_path
.clone()
.into_os_string()
.into_string()
.unwrap(),
);
if ui.button("Find").clicked() {
if let Some(path) = rfd::FileDialog::new().pick_file() {
self.selected_file_path = path;
}
}
});
ui.horizontal(|ui| {
ui.label("What sort of file is it?");
if ui
.add(egui::SelectableLabel::new(
self.selected_file_type == FileType::Pwad,
"PWAD",
))
.clicked()
{
self.selected_file_type = FileType::Pwad
}
if ui
.add(egui::SelectableLabel::new(
self.selected_file_type == FileType::Iwad,
"IWAD",
))
.clicked()
{
self.selected_file_type = FileType::Iwad
}
if ui
.add(egui::SelectableLabel::new(
self.selected_file_type == FileType::Launcher,
"Launcher",
))
.clicked()
{
self.selected_file_type = FileType::Launcher
}
});
if ui.button("Add!").clicked() {
if self.name.is_empty() || self.selected_file_path.as_os_str().is_empty() {
return;
}
match self.selected_file_type {
FileType::Iwad => {
self.all_iwads.push(WadInfo {
name: self.name.clone(),
path: self.selected_file_path.clone(),
});
}
FileType::Pwad => {
self.all_pwads.push(WadInfo {
name: self.name.clone(),
path: self.selected_file_path.clone(),
});
}
FileType::Launcher => {
self.all_launchers.push(LauncherInfo {
name: self.name.clone(),
path: self.selected_file_path.clone(),
});
}
.open(&mut self.add_stuff_window_displayed)
.show(ctx, |ui| {
ui.horizontal(|ui| {
let name_label = ui.label("Name");
ui.text_edit_singleline(&mut self.name)
.labelled_by(name_label.id);
});
ui.horizontal(|ui| {
ui.label("Path");
ui.label(
self.selected_file_path
.clone()
.into_os_string()
.into_string()
.unwrap(),
);
if ui.button("Find").clicked() {
if let Some(path) = rfd::FileDialog::new().pick_file() {
self.selected_file_path = path;
}
}
});
ui.horizontal(|ui| {
ui.label("What sort of file is it?");
if ui
.add(egui::SelectableLabel::new(
self.selected_file_type == FileType::Pwad,
"PWAD",
))
.clicked()
{
self.selected_file_type = FileType::Pwad
}
if ui
.add(egui::SelectableLabel::new(
self.selected_file_type == FileType::Iwad,
"IWAD",
))
.clicked()
{
self.selected_file_type = FileType::Iwad
}
if ui
.add(egui::SelectableLabel::new(
self.selected_file_type == FileType::Launcher,
"Launcher",
))
.clicked()
{
self.selected_file_type = FileType::Launcher
}
});
if ui.button("Add!").clicked() {
if self.name.is_empty() || self.selected_file_path.as_os_str().is_empty() {
return;
}
match self.selected_file_type {
FileType::Iwad => {
self.all_iwads.push(WadInfo {
name: self.name.clone(),
path: self.selected_file_path.clone(),
});
}
FileType::Pwad => {
self.all_pwads.push(WadInfo {
name: self.name.clone(),
path: self.selected_file_path.clone(),
});
}
FileType::Launcher => {
self.all_launchers.push(LauncherInfo {
name: self.name.clone(),
path: self.selected_file_path.clone(),
});
}
}
}
});
}
}