add config options to show/hide timing debug info and power directions

This commit is contained in:
Crispy 2025-04-21 00:23:19 +02:00
parent 440cd7a759
commit c8fc484e9c
7 changed files with 115 additions and 64 deletions

View file

@ -285,7 +285,7 @@ impl Grid {
out
}
pub fn draw(&self, d: &mut RaylibDrawHandle, textures: &Textures, offset: Vector2, scale: f32) {
pub fn draw(&self, d: &mut RaylibDrawHandle, textures: &Textures, offset: Vector2, scale: f32, power_directions: bool) {
let tile_size = (TILE_TEXTURE_SIZE * scale) as i32;
let start_x = (-offset.x as i32) / tile_size - 1;
@ -304,14 +304,14 @@ impl Grid {
}
let texture = textures.get(texname);
draw_scaled_texture(d, texture, px, py, scale);
#[cfg(debug_assertions)]
// todo some in-game option to show power direction
if power_directions
{
if let Tile::Powerable(_, state) = &tile {
for dir in Direction::ALL {
if state.get_dir(dir) {
let texture = textures.get(dir.debug_arrow_texture_name());
draw_scaled_texture(d, texture, px, py, scale);
}
}}
}
}
} else {