Replace "constants" module with "resources"

These aren't constants and they were never meant to be.

I've also started collecting the UI theme values. For now, just button
colors.
This commit is contained in:
2025-08-25 12:48:05 -05:00
parent aa0c8b421b
commit 74302afab1
3 changed files with 35 additions and 13 deletions

34
src/resources.rs Normal file
View File

@@ -0,0 +1,34 @@
//! Program constants & defaults
use bevy::{color::palettes::css::*, prelude::*};
#[derive(Debug, Reflect, Resource)]
pub struct UiTheme {
// TODO: Panes
// Colors for the "Big Red Buttons" (the main actions of the machines)
// normal
brb_bg: Color,
brb_border: Color,
// hover
brb_hover_bg: Color,
brb_hover_border: Color,
// pressed
brb_pressed_bg: Color,
brb_pressed_border: Color,
}
impl FromWorld for UiTheme {
fn from_world(world: &mut World) -> Self {
Self {
brb_bg: RED.into(),
brb_border: DARK_RED.into(),
brb_hover_bg: PINK.into(),
brb_hover_border: RED.into(),
brb_pressed_bg: GREEN.into(),
brb_pressed_border: DARK_GREEN.into(),
}
}
}