Skip to content

Commit

Permalink
Move project config and command editor to the edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Nov 26, 2023
1 parent ebb92c3 commit 9b299db
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions src/app/top_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ impl TopBar {
ui.separator();

ui.add_enabled_ui(update_state.filesystem.project_loaded(), |ui| {
if ui.button("Project Config").clicked() {
update_state
.edit_windows
.add_window(luminol_ui::windows::config_window::Window {});
}

if ui.button("Close Project").clicked() {
update_state
.edit_windows
Expand All @@ -102,14 +96,6 @@ impl TopBar {

ui.separator();

ui.add_enabled_ui(update_state.filesystem.project_loaded(), |ui| {
if ui.button("Command Maker").clicked() {
// update_state.windows.add_window(
// luminol_ui::windows::command_gen::CommandGeneratorWindow::default(),
// );
}
});

#[cfg(not(target_arch = "wasm32"))]
{
ui.separator();
Expand All @@ -123,7 +109,18 @@ impl TopBar {
ui.separator();

ui.menu_button("Edit", |ui| {
//
ui.add_enabled_ui(update_state.filesystem.project_loaded(), |ui| {
if ui.button("Project Config").clicked() {
update_state
.edit_windows
.add_window(luminol_ui::windows::config_window::Window {});
}
if ui.button("Event Commands").clicked() {
// update_state.windows.add_window(
// luminol_ui::windows::command_gen::CommandGeneratorWindow::default(),
// );
}
});
if ui.button("Preferences").clicked() {
update_state
.edit_windows
Expand Down Expand Up @@ -179,6 +176,9 @@ impl TopBar {
};
});

#[cfg(debug_assertions)]
ui.separator();
#[cfg(debug_assertions)]
ui.menu_button("Debug", |ui| {
if ui.button("Egui Inspection").clicked() {
update_state
Expand All @@ -192,12 +192,9 @@ impl TopBar {
.add_window(luminol_ui::windows::misc::EguiMemory::default());
}

#[cfg(debug_assertions)]
{
let mut debug_on_hover = ui.ctx().debug_on_hover();
ui.toggle_value(&mut debug_on_hover, "Debug on hover");
ui.ctx().set_debug_on_hover(debug_on_hover);
}
let mut debug_on_hover = ui.ctx().debug_on_hover();
ui.toggle_value(&mut debug_on_hover, "Debug on hover");
ui.ctx().set_debug_on_hover(debug_on_hover);

ui.separator();

Expand Down

0 comments on commit 9b299db

Please sign in to comment.