theme overhaul
This commit is contained in:
parent
2720735a58
commit
866a4c7127
4 changed files with 54 additions and 78 deletions
10
src/main.rs
10
src/main.rs
|
@ -10,11 +10,13 @@ mod editor;
|
|||
mod level;
|
||||
mod marble_engine;
|
||||
mod solution;
|
||||
mod theme;
|
||||
mod util;
|
||||
|
||||
use editor::{Editor, ExitState};
|
||||
use level::Level;
|
||||
use solution::Solution;
|
||||
use theme::*;
|
||||
use util::*;
|
||||
|
||||
struct Game {
|
||||
|
@ -94,11 +96,11 @@ impl Game {
|
|||
}
|
||||
|
||||
fn draw(&mut self, d: &mut RaylibDrawHandle) {
|
||||
d.clear_background(Color::new(64, 64, 64, 255));
|
||||
d.clear_background(BG_DARK);
|
||||
|
||||
let level_list_width = (d.get_screen_width() / 3).min(400);
|
||||
let screen_height = d.get_screen_height();
|
||||
d.draw_rectangle(0, 0, level_list_width, screen_height, Color::GRAY);
|
||||
d.draw_rectangle(0, 0, level_list_width, screen_height, BG_MEDIUM);
|
||||
|
||||
let clicked = d.is_mouse_button_pressed(MouseButton::MOUSE_BUTTON_LEFT);
|
||||
let mouse_pos = d.get_mouse_position();
|
||||
|
@ -130,9 +132,7 @@ impl Game {
|
|||
self.editing_solution_name = false;
|
||||
self.selected_level = index;
|
||||
}
|
||||
if self.selected_level == index {
|
||||
d.draw_rectangle_rec(bounds, Color::DARKCYAN);
|
||||
}
|
||||
d.draw_rectangle_rec(bounds, widget_bg(self.selected_level == index));
|
||||
|
||||
let mut title_color = Color::WHITE;
|
||||
if let Some(solutions) = self.solutions.get(level.id()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue