@@ -145,12 +145,9 @@ mod game {
145
145
146
146
fn game_setup (
147
147
mut commands : Commands ,
148
- asset_server : Res < AssetServer > ,
149
148
display_quality : Res < DisplayQuality > ,
150
149
volume : Res < Volume > ,
151
150
) {
152
- let font = asset_server. load ( "fonts/FiraSans-Bold.ttf" ) ;
153
-
154
151
commands
155
152
. spawn ( (
156
153
NodeBundle {
@@ -187,9 +184,9 @@ mod game {
187
184
TextBundle :: from_section (
188
185
"Will be back to the menu shortly..." ,
189
186
TextStyle {
190
- font : font. clone ( ) ,
191
187
font_size : 80.0 ,
192
188
color : TEXT_COLOR ,
189
+ ..default ( )
193
190
} ,
194
191
)
195
192
. with_style ( Style {
@@ -202,25 +199,25 @@ mod game {
202
199
TextSection :: new (
203
200
format ! ( "quality: {:?}" , * display_quality) ,
204
201
TextStyle {
205
- font : font. clone ( ) ,
206
202
font_size : 60.0 ,
207
203
color : Color :: BLUE ,
204
+ ..default ( )
208
205
} ,
209
206
) ,
210
207
TextSection :: new (
211
208
" - " ,
212
209
TextStyle {
213
- font : font. clone ( ) ,
214
210
font_size : 60.0 ,
215
211
color : TEXT_COLOR ,
212
+ ..default ( )
216
213
} ,
217
214
) ,
218
215
TextSection :: new (
219
216
format ! ( "volume: {:?}" , * volume) ,
220
217
TextStyle {
221
- font : font. clone ( ) ,
222
218
font_size : 60.0 ,
223
219
color : Color :: GREEN ,
220
+ ..default ( )
224
221
} ,
225
222
) ,
226
223
] )
@@ -398,7 +395,6 @@ mod menu {
398
395
}
399
396
400
397
fn main_menu_setup ( mut commands : Commands , asset_server : Res < AssetServer > ) {
401
- let font = asset_server. load ( "fonts/FiraSans-Bold.ttf" ) ;
402
398
// Common style for all buttons on the screen
403
399
let button_style = Style {
404
400
size : Size :: new ( Val :: Px ( 250.0 ) , Val :: Px ( 65.0 ) ) ,
@@ -417,9 +413,9 @@ mod menu {
417
413
..default ( )
418
414
} ;
419
415
let button_text_style = TextStyle {
420
- font : font. clone ( ) ,
421
416
font_size : 40.0 ,
422
417
color : TEXT_COLOR ,
418
+ ..default ( )
423
419
} ;
424
420
425
421
commands
@@ -452,9 +448,9 @@ mod menu {
452
448
TextBundle :: from_section (
453
449
"Bevy Game Menu UI" ,
454
450
TextStyle {
455
- font : font. clone ( ) ,
456
451
font_size : 80.0 ,
457
452
color : TEXT_COLOR ,
453
+ ..default ( )
458
454
} ,
459
455
)
460
456
. with_style ( Style {
@@ -531,7 +527,7 @@ mod menu {
531
527
} ) ;
532
528
}
533
529
534
- fn settings_menu_setup ( mut commands : Commands , asset_server : Res < AssetServer > ) {
530
+ fn settings_menu_setup ( mut commands : Commands ) {
535
531
let button_style = Style {
536
532
size : Size :: new ( Val :: Px ( 200.0 ) , Val :: Px ( 65.0 ) ) ,
537
533
margin : UiRect :: all ( Val :: Px ( 20.0 ) ) ,
@@ -541,9 +537,9 @@ mod menu {
541
537
} ;
542
538
543
539
let button_text_style = TextStyle {
544
- font : asset_server. load ( "fonts/FiraSans-Bold.ttf" ) ,
545
540
font_size : 40.0 ,
546
541
color : TEXT_COLOR ,
542
+ ..default ( )
547
543
} ;
548
544
549
545
commands
@@ -596,11 +592,7 @@ mod menu {
596
592
} ) ;
597
593
}
598
594
599
- fn display_settings_menu_setup (
600
- mut commands : Commands ,
601
- asset_server : Res < AssetServer > ,
602
- display_quality : Res < DisplayQuality > ,
603
- ) {
595
+ fn display_settings_menu_setup ( mut commands : Commands , display_quality : Res < DisplayQuality > ) {
604
596
let button_style = Style {
605
597
size : Size :: new ( Val :: Px ( 200.0 ) , Val :: Px ( 65.0 ) ) ,
606
598
margin : UiRect :: all ( Val :: Px ( 20.0 ) ) ,
@@ -609,9 +601,9 @@ mod menu {
609
601
..default ( )
610
602
} ;
611
603
let button_text_style = TextStyle {
612
- font : asset_server. load ( "fonts/FiraSans-Bold.ttf" ) ,
613
604
font_size : 40.0 ,
614
605
color : TEXT_COLOR ,
606
+ ..default ( )
615
607
} ;
616
608
617
609
commands
@@ -698,11 +690,7 @@ mod menu {
698
690
} ) ;
699
691
}
700
692
701
- fn sound_settings_menu_setup (
702
- mut commands : Commands ,
703
- asset_server : Res < AssetServer > ,
704
- volume : Res < Volume > ,
705
- ) {
693
+ fn sound_settings_menu_setup ( mut commands : Commands , volume : Res < Volume > ) {
706
694
let button_style = Style {
707
695
size : Size :: new ( Val :: Px ( 200.0 ) , Val :: Px ( 65.0 ) ) ,
708
696
margin : UiRect :: all ( Val :: Px ( 20.0 ) ) ,
@@ -711,9 +699,9 @@ mod menu {
711
699
..default ( )
712
700
} ;
713
701
let button_text_style = TextStyle {
714
- font : asset_server. load ( "fonts/FiraSans-Bold.ttf" ) ,
715
702
font_size : 40.0 ,
716
703
color : TEXT_COLOR ,
704
+ ..default ( )
717
705
} ;
718
706
719
707
commands
0 commit comments