Plug in the new UiTheme resource
Fixed struct field visibility, initialize the resource, and register it with the EGUI Debug overlay. The button observers have also been updated to use the resource.
This commit is contained in:
@@ -3,32 +3,31 @@
|
||||
use bevy::{color::palettes::css::*, prelude::*};
|
||||
|
||||
#[derive(Debug, Reflect, Resource)]
|
||||
#[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,
|
||||
pub brb_bg: Color,
|
||||
pub brb_border: Color,
|
||||
// hover
|
||||
brb_hover_bg: Color,
|
||||
brb_hover_border: Color,
|
||||
pub brb_hover_bg: Color,
|
||||
pub brb_hover_border: Color,
|
||||
// pressed
|
||||
brb_pressed_bg: Color,
|
||||
brb_pressed_border: Color,
|
||||
|
||||
pub brb_pressed_bg: Color,
|
||||
pub 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(),
|
||||
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