Skip to content

Commit 19c5da7

Browse files
committed
Fix UI differences due to Bevy 0.15 update
1 parent 040c931 commit 19c5da7

File tree

8 files changed

+22
-16
lines changed

8 files changed

+22
-16
lines changed

src/game/stats.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl EntityCommand for Stats {
107107
Node {
108108
display: Display::Grid,
109109
grid_template_columns: RepeatedGridTrack::auto(2),
110-
row_gap: Vw(1.2),
110+
row_gap: Vw(0.7),
111111
column_gap: Vw(2.5),
112112
..default()
113113
},

src/screen/intro.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn header(mut entity: EntityWorldMut) {
6363
DynamicFontSize::new(Vw(5.0)).with_step(8.0),
6464
ThemeColor::BodyText.target::<TextColor>(),
6565
Node {
66-
margin: UiRect::vertical(Vw(5.0)),
66+
margin: UiRect::top(Vw(4.5)).with_bottom(Vw(4.2)),
6767
..default()
6868
},
6969
));
@@ -76,7 +76,7 @@ fn body(mut entity: EntityWorldMut) {
7676
Node {
7777
flex_direction: FlexDirection::Column,
7878
align_items: AlignItems::Center,
79-
row_gap: Vw(1.4),
79+
row_gap: Vw(0.8),
8080
..default()
8181
},
8282
))
@@ -127,7 +127,7 @@ fn button_container(mut entity: EntityWorldMut) {
127127
width: Percent(100.0),
128128
align_items: AlignItems::Center,
129129
flex_direction: FlexDirection::Column,
130-
margin: UiRect::vertical(VMin(9.0)),
130+
margin: UiRect::vertical(VMin(8.5)),
131131
row_gap: Vw(2.5),
132132
..default()
133133
},

src/screen/playing/defeat_menu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn header(mut entity: EntityWorldMut) {
9494
DynamicFontSize::new(Vw(5.0)).with_step(8.0),
9595
ThemeColor::BodyText.target::<TextColor>(),
9696
Node {
97-
margin: UiRect::top(Vw(4.5)),
97+
margin: UiRect::top(Vw(4.2)),
9898
..default()
9999
},
100100
));

src/screen/playing/hud.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn upper_hud(player: Entity) -> impl EntityCommand<World> {
4141
width: Percent(100.0),
4242
align_items: AlignItems::Center,
4343
justify_content: default(),
44-
padding: UiRect::all(Px(16.0)),
44+
padding: UiRect::all(Px(16.0)).with_top(Px(13.0)),
4545
column_gap: Px(16.0),
4646
..default()
4747
},
@@ -68,7 +68,7 @@ fn level_display(player: Entity) -> impl EntityCommand<World> {
6868
ThemeColor::Indicator.target::<TextColor>(),
6969
TextLayout::new_with_no_wrap(),
7070
Node {
71-
margin: UiRect::new(Val::ZERO, Px(-4.0), Px(-4.0), Val::ZERO),
71+
margin: UiRect::new(Val::ZERO, Px(-4.0), Px(-3.0), Val::ZERO),
7272
..default()
7373
},
7474
))

src/screen/playing/level_up_menu.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn level_up_menu(mut entity: EntityWorldMut) {
6666
Name::new("LevelUpMenu"),
6767
Node {
6868
height: VMin(63.0),
69-
top: Vw(-1.7),
69+
top: Vw(-2.1),
7070
align_items: AlignItems::Center,
7171
justify_content: JustifyContent::SpaceBetween,
7272
flex_direction: FlexDirection::Column,
@@ -102,7 +102,7 @@ fn instructions_container(mut entity: EntityWorldMut) {
102102
Node {
103103
display: Display::None,
104104
flex_direction: FlexDirection::Column,
105-
row_gap: Vh(2.3),
105+
row_gap: Vh(2.0),
106106
..default()
107107
},
108108
ToggleDisplay(Display::Flex),
@@ -130,7 +130,7 @@ fn instructions_container(mut entity: EntityWorldMut) {
130130
Node {
131131
display: Display::Grid,
132132
grid_template_columns: RepeatedGridTrack::auto(2),
133-
row_gap: Vw(1.2),
133+
row_gap: Vw(0.7),
134134
column_gap: Vw(2.5),
135135
..default()
136136
},
@@ -287,7 +287,13 @@ fn card_label(key: impl Into<String>) -> impl EntityCommand {
287287

288288
fn button_container(mut entity: EntityWorldMut) {
289289
entity
290-
.insert((Name::new("ButtonContainer"), Node::default()))
290+
.insert((
291+
Name::new("ButtonContainer"),
292+
Node {
293+
top: Vh(0.7),
294+
..default()
295+
},
296+
))
291297
.with_children(|children| {
292298
children.spawn_with(skip_button);
293299
children.spawn_with(ready_button);

src/screen/playing/pause_menu.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn header(mut entity: EntityWorldMut) {
5555
DynamicFontSize::new(Vw(5.0)).with_step(8.0),
5656
ThemeColor::BodyText.target::<TextColor>(),
5757
Node {
58-
margin: UiRect::top(Vw(4.5)),
58+
margin: UiRect::top(Vw(4.0)),
5959
..default()
6060
},
6161
));
@@ -68,7 +68,7 @@ fn button_container(mut entity: EntityWorldMut) {
6868
Node {
6969
align_items: AlignItems::Center,
7070
flex_direction: FlexDirection::Column,
71-
margin: UiRect::top(VMin(6.0)),
71+
margin: UiRect::top(VMin(5.1)),
7272
row_gap: Vw(2.5),
7373
..default()
7474
},

src/screen/playing/victory_menu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn header(mut entity: EntityWorldMut) {
9494
DynamicFontSize::new(Vw(5.0)).with_step(8.0),
9595
ThemeColor::BodyText.target::<TextColor>(),
9696
Node {
97-
margin: UiRect::top(Vw(4.5)),
97+
margin: UiRect::top(Vw(4.2)),
9898
..default()
9999
},
100100
));

src/screen/title.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn header(mut entity: EntityWorldMut) {
3636
DynamicFontSize::new(Vw(5.0)).with_step(8.0),
3737
ThemeColor::BodyText.target::<TextColor>(),
3838
Node {
39-
margin: UiRect::vertical(Vw(5.0)),
39+
margin: UiRect::top(Vw(4.5)).with_bottom(Vw(4.2)),
4040
..default()
4141
},
4242
));
@@ -50,7 +50,7 @@ fn button_container(mut entity: EntityWorldMut) {
5050
width: Percent(100.0),
5151
align_items: AlignItems::Center,
5252
flex_direction: FlexDirection::Column,
53-
margin: UiRect::vertical(VMin(9.0)),
53+
margin: UiRect::vertical(VMin(9.5)),
5454
row_gap: Vw(2.5),
5555
..default()
5656
},

0 commit comments

Comments
 (0)