aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 8e3bf51..1ebcbfe 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,6 +8,7 @@ pub mod config;
pub mod dimension_indicator;
pub mod editor;
pub mod grid;
+pub mod gui;
pub mod map_data;
pub mod math;
pub mod svg;
@@ -16,6 +17,7 @@ pub mod transform;
use config::Config;
use editor::Editor;
+use gui::ToolSidebar;
use raylib::prelude::*;
use std::io;
use transform::Transform;
@@ -52,6 +54,7 @@ fn main() {
};
let mut editor = Editor::new(&mut rl, &thread, config);
+ let tool_sidebar = ToolSidebar::new(&mut rl, &thread);
let mut transform = Transform::new();
let mut last_mouse_pos = rl.get_mouse_position();
@@ -74,7 +77,11 @@ fn main() {
);
}
- editor.update(&rl, &transform);
+ editor.update(
+ &rl,
+ &transform,
+ ToolSidebar::mouse_captured(screen_height as u16, rl.get_mouse_position().into()),
+ );
// Update the last mouse position
last_mouse_pos = rl.get_mouse_position();
@@ -86,6 +93,7 @@ fn main() {
grid::draw_grid(&mut d, screen_width, screen_height, &transform);
editor.draw_tools(&mut d, &transform);
+ tool_sidebar.draw(screen_height as u16, &mut d, &mut editor);
}
}
}