Skip to content

Commit

Permalink
Add menu items for generating caves/dungeons
Browse files Browse the repository at this point in the history
  • Loading branch information
seilis committed Nov 16, 2024
1 parent 59d12e3 commit 9230fec
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/bin/rpgmap-gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,30 @@ impl RpgMapGui {

impl eframe::App for RpgMapGui {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::TopBottomPanel::top("menu").show(ctx, |ui| {
egui::menu::bar(ui, |ui| {
ui.menu_button("File", |ui| {
if ui.button("Save").clicked() {
// TODO: SAVE!
}
});
ui.menu_button("Generate", |ui| {
if ui.button("Dungeon").clicked() {
// Generate a dungeon!
self.map.generate_dungeon(10, 5);
self.map.place_entrance_near((0, 0));
}

if ui.button("Cave").clicked() {
// Generate a cave!
self.map.generate_cave(4, 50);
self.map.place_entrance_near((0, 0));
}
});
});
});


egui::CentralPanel::default().show(ctx, |ui| {
let cell_size = 20.0;

Expand Down

0 comments on commit 9230fec

Please sign in to comment.