|
|
|
|
@ -71,10 +71,10 @@ fn init_debug_ui(mut commands: Commands) {
|
|
|
|
|
commands.spawn((
|
|
|
|
|
DebuggingState::On,
|
|
|
|
|
Name::new("Debug Indicator"),
|
|
|
|
|
Text(" Debug: ON ".into()),
|
|
|
|
|
TextColor(WHITE.into()),
|
|
|
|
|
BackgroundColor(RED.into()),
|
|
|
|
|
BorderRadius::MAX,
|
|
|
|
|
GlobalZIndex(i32::MAX - 1),
|
|
|
|
|
children![
|
|
|
|
|
Text(" Debug: ON ".into()),
|
|
|
|
|
],
|
|
|
|
|
Node {
|
|
|
|
|
align_self: AlignSelf::Center,
|
|
|
|
|
justify_self: JustifySelf::End,
|
|
|
|
|
@ -86,9 +86,10 @@ fn init_debug_ui(mut commands: Commands) {
|
|
|
|
|
commands.spawn((
|
|
|
|
|
DebuggingState::On,
|
|
|
|
|
Name::new("Version #"),
|
|
|
|
|
Text::new(VERSION),
|
|
|
|
|
TextColor(WHITE.into()),
|
|
|
|
|
BackgroundColor(BLACK.into()),
|
|
|
|
|
children![
|
|
|
|
|
Text::new(VERSION),
|
|
|
|
|
],
|
|
|
|
|
GlobalZIndex(i32::MAX - 1),
|
|
|
|
|
Node {
|
|
|
|
|
width: Val::Auto,
|
|
|
|
|
align_self: AlignSelf::End,
|
|
|
|
|
@ -101,41 +102,42 @@ fn init_debug_ui(mut commands: Commands) {
|
|
|
|
|
commands.spawn((
|
|
|
|
|
DebuggingState::On,
|
|
|
|
|
Name::new("FPS"),
|
|
|
|
|
Text::new("FPS: ##.#"),
|
|
|
|
|
TextColor(WHITE.into()),
|
|
|
|
|
BackgroundColor(BLACK.into()),
|
|
|
|
|
SyncResource::<Fps>::default(),
|
|
|
|
|
GlobalZIndex(i32::MAX - 1),
|
|
|
|
|
Node {
|
|
|
|
|
width: Val::Auto,
|
|
|
|
|
align_self: AlignSelf::Start,
|
|
|
|
|
justify_self: JustifySelf::End,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
)).with_children(|parent| {
|
|
|
|
|
parent.spawn((
|
|
|
|
|
Text::new("FPS: ##.#"),
|
|
|
|
|
SyncResource::<Fps>::default(),
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
commands.spawn((
|
|
|
|
|
DebuggingState::On,
|
|
|
|
|
Name::new("Entity Count"),
|
|
|
|
|
Text::new("Entities: ###"),
|
|
|
|
|
TextColor(WHITE.into()),
|
|
|
|
|
BackgroundColor(BLACK.into()),
|
|
|
|
|
SyncResource::<EntityCount>::default(),
|
|
|
|
|
GlobalZIndex(i32::MAX - 1),
|
|
|
|
|
Node {
|
|
|
|
|
width: Val::Auto,
|
|
|
|
|
align_self: AlignSelf::Start,
|
|
|
|
|
justify_self: JustifySelf::Center,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
)).with_children(|parent| {
|
|
|
|
|
parent.spawn((
|
|
|
|
|
Text::new("Entities: ###"),
|
|
|
|
|
SyncResource::<EntityCount>::default(),
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Tooltip
|
|
|
|
|
commands.spawn((
|
|
|
|
|
DebuggingState::On,
|
|
|
|
|
Text("Tooltip Placeholder".into()),
|
|
|
|
|
Pickable::IGNORE,
|
|
|
|
|
TextColor(WHITE.into()),
|
|
|
|
|
SyncResource::<ToolTip>::default(),
|
|
|
|
|
BackgroundColor(BLACK.with_alpha(0.9).into()),
|
|
|
|
|
Pickable::IGNORE,
|
|
|
|
|
GlobalZIndex(i32::MAX),
|
|
|
|
|
Node {
|
|
|
|
|
position_type: PositionType::Absolute,
|
|
|
|
|
@ -147,7 +149,12 @@ fn init_debug_ui(mut commands: Commands) {
|
|
|
|
|
justify_content: JustifyContent::Center,
|
|
|
|
|
..default()
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
)).with_children(|parent| {
|
|
|
|
|
parent.spawn((
|
|
|
|
|
Text("Tooltip Placeholder".into()),
|
|
|
|
|
SyncResource::<ToolTip>::default(),
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Toggles the debug state from off -> on // off -> on when triggered
|
|
|
|
|
@ -197,7 +204,7 @@ impl Display for ToolTip {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn tooltip_follow(
|
|
|
|
|
mut tooltip: Single<(&mut Node, &mut Visibility), With<SyncResource<ToolTip>>>,
|
|
|
|
|
mut tooltip: Single<(&mut Node, &mut Visibility), (With<SyncResource<ToolTip>>, Without<Text>)>,
|
|
|
|
|
window: Single<&Window>,
|
|
|
|
|
) {
|
|
|
|
|
if let Some(Vec2 { x, y }) = window.cursor_position() {
|
|
|
|
|
|