First step or removing the wad window
I might re-implement it with a question mark or something which pops out a new window perhaps
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,4 @@
|
|||||||
/target
|
/target
|
||||||
|
*~
|
||||||
|
Cargo.lock
|
||||||
|
test_files/
|
||||||
|
|||||||
18
src/main.rs
18
src/main.rs
@@ -39,7 +39,6 @@ struct RustDoomLauncher {
|
|||||||
config_filename: PathBuf,
|
config_filename: PathBuf,
|
||||||
config: Option<Config>,
|
config: Option<Config>,
|
||||||
config_tried: bool,
|
config_tried: bool,
|
||||||
wad_summary: String,
|
|
||||||
command_manager: CommandManager,
|
command_manager: CommandManager,
|
||||||
display_command: bool,
|
display_command: bool,
|
||||||
add_stuff_window_displayed: bool,
|
add_stuff_window_displayed: bool,
|
||||||
@@ -60,7 +59,6 @@ impl Default for RustDoomLauncher {
|
|||||||
config_filename: default_save_filename(),
|
config_filename: default_save_filename(),
|
||||||
config: None, // TODO: put the config_filename in the config stuct - or something
|
config: None, // TODO: put the config_filename in the config stuct - or something
|
||||||
config_tried: false,
|
config_tried: false,
|
||||||
wad_summary: "".to_string(),
|
|
||||||
display_command: false,
|
display_command: false,
|
||||||
add_stuff_window_displayed: false,
|
add_stuff_window_displayed: false,
|
||||||
selected_file_type: FileType::Pwad,
|
selected_file_type: FileType::Pwad,
|
||||||
@@ -82,16 +80,11 @@ impl RustDoomLauncher {
|
|||||||
if let Some(config) = &self.config {
|
if let Some(config) = &self.config {
|
||||||
if let Some(iwads) = &config.iwads {
|
if let Some(iwads) = &config.iwads {
|
||||||
for iwad in iwads {
|
for iwad in iwads {
|
||||||
let mut iwad = iwad.clone();
|
|
||||||
iwad.info_text = Some("I'm sure you know what's in that bloody IWAD".to_string());
|
|
||||||
self.iwad_manager.add(&iwad);
|
self.iwad_manager.add(&iwad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(pwads) = &config.pwads {
|
if let Some(pwads) = &config.pwads {
|
||||||
for pwad in pwads {
|
for pwad in pwads {
|
||||||
let mut pwad = pwad.clone();
|
|
||||||
pwad.info_text = get_summary(&pwad.path);
|
|
||||||
println!("{:?}", pwad);
|
|
||||||
self.pwad_manager.add(&pwad.clone());
|
self.pwad_manager.add(&pwad.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,7 +215,6 @@ impl eframe::App for RustDoomLauncher {
|
|||||||
.clicked()
|
.clicked()
|
||||||
{
|
{
|
||||||
add_pos = Some(pos);
|
add_pos = Some(pos);
|
||||||
self.wad_summary = iwad.info_text.as_ref().unwrap().clone();
|
|
||||||
}
|
}
|
||||||
if ui.button("❌").clicked() {
|
if ui.button("❌").clicked() {
|
||||||
remove_pos = Some(pos);
|
remove_pos = Some(pos);
|
||||||
@@ -256,9 +248,6 @@ impl eframe::App for RustDoomLauncher {
|
|||||||
.clicked()
|
.clicked()
|
||||||
{
|
{
|
||||||
add_pos = Some(pos);
|
add_pos = Some(pos);
|
||||||
if let Some(txt) = pwad.info_text.clone() {
|
|
||||||
self.wad_summary = txt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ui.button("❌").clicked() {
|
if ui.button("❌").clicked() {
|
||||||
remove_pos = Some(pos);
|
remove_pos = Some(pos);
|
||||||
@@ -276,13 +265,6 @@ impl eframe::App for RustDoomLauncher {
|
|||||||
.add_pwads(&self.pwad_manager.get_current())
|
.add_pwads(&self.pwad_manager.get_current())
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let window_size = frame.info().window_info.size;
|
|
||||||
ui.set_max_height(300.0);
|
|
||||||
ui.add(
|
|
||||||
egui::TextEdit::multiline(&mut self.wad_summary)
|
|
||||||
.desired_width(window_size[0] / 1.6)
|
|
||||||
.desired_rows(20)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
ui.separator();
|
ui.separator();
|
||||||
ui.horizontal_wrapped(|ui| {
|
ui.horizontal_wrapped(|ui| {
|
||||||
|
|||||||
Reference in New Issue
Block a user