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:
34
src/resources.rs
Normal file
34
src/resources.rs
Normal 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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user