Added the misc options
This commit is contained in:
40
src/main.rs
40
src/main.rs
@@ -1,7 +1,7 @@
|
||||
use eframe::egui;
|
||||
use std::path::PathBuf;
|
||||
use config::{default_save_filename, save_config, load_config, Config};
|
||||
use infos::{WadInfo, LauncherInfo};
|
||||
use infos::{WadInfo, LauncherInfo, Difficulty};
|
||||
|
||||
pub mod config;
|
||||
pub mod infos;
|
||||
@@ -27,6 +27,10 @@ struct RustDoomLauncher {
|
||||
name: String,
|
||||
config_filename: PathBuf,
|
||||
config_file_loaded: bool,
|
||||
warp_string: String,
|
||||
difficulty: Difficulty,
|
||||
fast_monsters: bool,
|
||||
respawning_monsters: bool,
|
||||
}
|
||||
|
||||
impl Default for RustDoomLauncher {
|
||||
@@ -41,6 +45,10 @@ impl Default for RustDoomLauncher {
|
||||
name: "".to_string(),
|
||||
config_filename: default_save_filename(),
|
||||
config_file_loaded: false,
|
||||
warp_string: String::new(),
|
||||
difficulty: Difficulty::None,
|
||||
fast_monsters: false,
|
||||
respawning_monsters: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,6 +190,36 @@ impl eframe::App for RustDoomLauncher {
|
||||
}
|
||||
});
|
||||
});
|
||||
ui.separator();
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.horizontal(|ui| {
|
||||
ui.set_max_width(180.0);
|
||||
let warp_label = ui.label("warp");
|
||||
ui.text_edit_singleline(&mut self.warp_string).labelled_by(warp_label.id);
|
||||
});
|
||||
ui.separator();
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("difficulty");
|
||||
eframe::egui::ComboBox::new("difficulty", "")
|
||||
.selected_text(format!("{}", self.difficulty))
|
||||
.show_ui(ui, |ui| {
|
||||
for diff in Difficulty::iterator() {
|
||||
ui.selectable_value(&mut self.difficulty, *diff, diff.to_string());
|
||||
}
|
||||
});
|
||||
});
|
||||
ui.separator();
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("fast");
|
||||
ui.checkbox(&mut self.fast_monsters, "");
|
||||
});
|
||||
ui.separator();
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("respawn");
|
||||
ui.checkbox(&mut self.respawning_monsters, "");
|
||||
});
|
||||
});
|
||||
ui.separator();
|
||||
ui.label("Command");
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
// I don't actually think using SelectableLabel is correct here -
|
||||
|
||||
Reference in New Issue
Block a user