prettify marble direction and value rendering

This commit is contained in:
Crispy 2024-10-12 20:53:47 +02:00
parent 23ac416c7e
commit 27ff77f133
9 changed files with 65 additions and 28 deletions

View file

@ -164,7 +164,7 @@ impl Tile {
Tile::Marble { value: _, dir: _ } => "marble",
Tile::Digit(n) => return format!("tile_digit_{n}"),
Tile::Mirror(mirror) => mirror.texture_name(),
Tile::Arrow(dir) => dir.arrow_texture_name(),
Tile::Arrow(dir) => dir.arrow_tile_texture_name(),
Tile::Powerable(tile, state) => {
let root = match tile {
PTile::Trigger => "trigger",
@ -222,7 +222,7 @@ impl Direction {
pos
}
pub const fn arrow_texture_name(&self) -> &'static str {
pub const fn arrow_tile_texture_name(&self) -> &'static str {
match self {
Direction::Up => "arrow_up",
Direction::Down => "arrow_down",
@ -230,6 +230,15 @@ impl Direction {
Direction::Right => "arrow_right",
}
}
pub const fn arrow_texture_name(&self) -> &'static str {
match self {
Direction::Up => "direction_up",
Direction::Down => "direction_down",
Direction::Left => "direction_left",
Direction::Right => "direction_right",
}
}
}
impl WireType {