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:
@@ -1,12 +0,0 @@
|
||||
//! Program constants & defaults
|
||||
|
||||
use bevy::prelude::*;
|
||||
|
||||
#[derive(Debug, Reflect, Resource)]
|
||||
struct ConfigDefaults {}
|
||||
|
||||
impl FromWorld for ConfigDefaults {
|
||||
fn from_world(world: &mut World) -> Self {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ use bevy_inspector_egui::{bevy_egui::EguiPlugin, quick::WorldInspectorPlugin};
|
||||
|
||||
mod assets;
|
||||
mod card;
|
||||
mod constants;
|
||||
mod resources;
|
||||
mod widgets;
|
||||
|
||||
fn main() {
|
||||
|
||||
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