generated from tipragot/rust
This commit is contained in:
parent
e8b6f99852
commit
36fd41fb34
|
@ -27,4 +27,3 @@ pub fn change_scaling(mut ui_scale: ResMut<UiScale>, window: Query<&Window>) {
|
||||||
);
|
);
|
||||||
ui_scale.0 = if a < b { a } else { b } as f64
|
ui_scale.0 = if a < b { a } else { b } as f64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
use crate::{CurrentScene, change_scaling};
|
use crate::{change_scaling, CurrentScene};
|
||||||
|
|
||||||
|
|
||||||
/// The plugin for the menu.
|
/// The plugin for the menu.
|
||||||
pub struct MenuPlugin;
|
pub struct MenuPlugin;
|
||||||
|
@ -19,7 +18,6 @@ impl Plugin for MenuPlugin {
|
||||||
fn menu_ui(mut commands: Commands) {
|
fn menu_ui(mut commands: Commands) {
|
||||||
commands.spawn(Camera2dBundle::default());
|
commands.spawn(Camera2dBundle::default());
|
||||||
|
|
||||||
// Main node
|
|
||||||
commands
|
commands
|
||||||
.spawn(NodeBundle {
|
.spawn(NodeBundle {
|
||||||
style: Style {
|
style: Style {
|
||||||
|
@ -32,8 +30,6 @@ fn menu_ui(mut commands: Commands) {
|
||||||
z_index: ZIndex::Local(0),
|
z_index: ZIndex::Local(0),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
|
|
||||||
// Spawn Border War Text
|
|
||||||
.with_children(|main_node| {
|
.with_children(|main_node| {
|
||||||
main_node.spawn(NodeBundle {
|
main_node.spawn(NodeBundle {
|
||||||
style: Style {
|
style: Style {
|
||||||
|
@ -67,53 +63,45 @@ fn menu_ui(mut commands: Commands) {
|
||||||
},
|
},
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
|
|
||||||
.with_children(|container| {
|
.with_children(|container| {
|
||||||
|
container
|
||||||
|
.spawn(NodeBundle {
|
||||||
|
style: default_style(),
|
||||||
|
..default()
|
||||||
|
})
|
||||||
|
.with_children(|host| {
|
||||||
|
host.spawn(NodeBundle {
|
||||||
|
style: default_style(),
|
||||||
|
background_color: BackgroundColor(Color::YELLOW),
|
||||||
|
..default()
|
||||||
|
});
|
||||||
|
host.spawn(NodeBundle {
|
||||||
|
style: default_style(),
|
||||||
|
background_color: BackgroundColor(Color::YELLOW),
|
||||||
|
..default()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
container
|
container
|
||||||
.spawn(NodeBundle {
|
.spawn(NodeBundle {
|
||||||
style: default_style(),
|
style: default_style(),
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
|
.with_children(|join| {
|
||||||
.with_children(|host| {
|
join.spawn(NodeBundle {
|
||||||
|
|
||||||
host.spawn(NodeBundle {
|
|
||||||
style: default_style(),
|
style: default_style(),
|
||||||
background_color: BackgroundColor(Color::YELLOW),
|
background_color: BackgroundColor(Color::YELLOW),
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
|
join.spawn(NodeBundle {
|
||||||
host.spawn(NodeBundle {
|
|
||||||
style: default_style(),
|
|
||||||
background_color: BackgroundColor(Color::YELLOW),
|
|
||||||
..default()
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
container.spawn(NodeBundle {
|
|
||||||
style: default_style(),
|
style: default_style(),
|
||||||
|
background_color: BackgroundColor(Color::YELLOW),
|
||||||
..default()
|
..default()
|
||||||
})
|
});
|
||||||
|
|
||||||
.with_children(|join| {
|
|
||||||
|
|
||||||
join.spawn(NodeBundle {
|
|
||||||
style: default_style(),
|
|
||||||
background_color: BackgroundColor(Color::YELLOW),
|
|
||||||
..default()
|
|
||||||
});
|
|
||||||
|
|
||||||
join.spawn(NodeBundle {
|
|
||||||
style: default_style(),
|
|
||||||
background_color: BackgroundColor(Color::YELLOW),
|
|
||||||
..default()
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Spawn Settings button
|
|
||||||
commands.spawn(NodeBundle {
|
commands.spawn(NodeBundle {
|
||||||
style: Style {
|
style: Style {
|
||||||
width: Val::Px(75.),
|
width: Val::Px(75.),
|
||||||
|
@ -131,7 +119,6 @@ fn menu_ui(mut commands: Commands) {
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
|
|
||||||
// Spawn Info button
|
|
||||||
commands.spawn(NodeBundle {
|
commands.spawn(NodeBundle {
|
||||||
style: Style {
|
style: Style {
|
||||||
width: Val::Px(75.),
|
width: Val::Px(75.),
|
||||||
|
|
Loading…
Reference in a new issue