8 #include "ent_miniworld.h"
12 #include "control_overlay.h"
14 #include "shaders/model_menu.h"
16 struct global_menu menu
= { .skip_starter
= 0 };
18 void menu_at_begin(void)
20 if( menu
.skip_starter
) return;
22 skaterift
.activity
= k_skaterift_menu
;
23 menu
.page
= k_menu_page_starter
;
28 vg_console_reg_var( "skip_starter_menu", &menu
.skip_starter
,
29 k_var_dtype_i32
, VG_VAR_PERSISTENT
);
32 void menu_open( enum menu_page page
)
34 skaterift
.activity
= k_skaterift_menu
;
36 if( page
!= k_menu_page_any
)
42 bool menu_viewing_map(void)
44 return (skaterift
.activity
== k_skaterift_menu
) &&
45 (menu
.page
== k_menu_page_main
) &&
46 (menu
.main_index
== k_menu_main_map
);
49 static void menu_decor_select( ui_rect rect
)
51 ui_px b
= vg_ui
.font
->sx
, hb
= b
/2;
52 ui_rect a0
= { rect
[0] - 20 - hb
, rect
[1] + rect
[3]/2 - hb
, b
,b
},
53 a1
= { rect
[0] + rect
[2] + 20 + hb
, rect
[1] + rect
[3]/2 - hb
, b
,b
};
55 ui_text( a0
, "\x95", 1, k_ui_align_middle_center
, 0 );
56 ui_text( a1
, "\x93", 1, k_ui_align_middle_center
, 0 );
59 static void menu_standard_widget( ui_rect inout_panel
, ui_rect rect
, ui_px s
)
61 ui_split( inout_panel
, k_ui_axis_h
, vg_ui
.font
->sy
*s
*2,
62 8, rect
, inout_panel
);
65 static bool menu_slider( ui_rect inout_panel
, bool select
, const char *label
,
66 const f32 disp_min
, const f32 disp_max
, f32
*value
,
70 menu_standard_widget( inout_panel
, rect
, 1 );
71 ui_label( rect
, label
, 1, 8, box
);
74 enum ui_button_state state
= ui_slider_base( box
, 0, 1, value
, &t
),
76 k_ui_button_holding_inside
|
77 k_ui_button_holding_outside
|
79 mask_brighter
= mask_using
| k_ui_button_hover
;
81 if( vg_input
.display_input_method
== k_input_method_controller
)
85 f32 m
= axis_state( k_sraxis_mbrowse_h
);
88 *value
+= m
* vg
.time_frame_delta
* (1.0f
/2.0f
);
89 *value
= vg_clampf( *value
, 0, 1 );
92 menu_decor_select( rect
);
93 state
|= k_ui_button_hover
;
97 ui_rect line
= { box
[0], box
[1], t
* (f32
)box
[2], box
[3] };
98 ui_fill( line
, state
&mask_brighter
? GUI_COL_ACTIVE
: GUI_COL_NORM
);
99 ui_fill( (ui_rect
){ box
[0]+line
[2], box
[1], box
[2]-line
[2], box
[3] },
102 ui_outline( box
, 1, state
? GUI_COL_HI
: GUI_COL_ACTIVE
, 0 );
103 ui_slider_text( box
, format
, disp_min
+ (*value
)*( disp_max
-disp_min
) );
105 return (state
& mask_using
) && 1;
108 static bool menu_button( ui_rect inout_panel
, bool select
, const char *text
)
111 menu_standard_widget( inout_panel
, rect
, 1 );
113 enum ui_button_state state
= k_ui_button_none
;
115 if( vg_input
.display_input_method
== k_input_method_controller
)
119 menu_decor_select( rect
);
121 if( button_down( k_srbind_maccept
) )
122 state
= k_ui_button_click
;
127 state
= ui_button_base( rect
);
131 if( state
== k_ui_button_click
)
133 ui_fill( rect
, GUI_COL_DARK
);
135 else if( state
== k_ui_button_holding_inside
)
137 ui_fill( rect
, GUI_COL_DARK
);
139 else if( state
== k_ui_button_holding_outside
)
141 ui_fill( rect
, GUI_COL_DARK
);
142 ui_outline( rect
, 1, GUI_COL_CLICK
, 0 );
144 else if( state
== k_ui_button_hover
)
146 ui_fill( rect
, GUI_COL_ACTIVE
);
147 ui_outline( rect
, 1, GUI_COL_CLICK
, 0 );
151 ui_fill( rect
, select
? GUI_COL_ACTIVE
: GUI_COL_NORM
);
153 ui_outline(rect
, 1, GUI_COL_HI
, 0 );
156 ui_text( rect
, text
, 1, k_ui_align_middle_center
, 0 );
158 if( state
== k_ui_button_click
)
161 audio_oneshot( &audio_ui
[0], 1.0f
, 0.0f
);
168 static bool menu_checkbox( ui_rect inout_panel
, bool select
,
169 const char *str_label
, i32
*data
)
171 ui_rect rect
, label
, box
;
172 menu_standard_widget( inout_panel
, rect
, 1 );
174 ui_split( rect
, k_ui_axis_v
, -rect
[3], 0, label
, box
);
175 ui_text( label
, str_label
, k_ui_scale
, k_ui_align_middle_left
, 0 );
177 enum ui_button_state state
= k_ui_button_none
;
179 if( vg_input
.display_input_method
== k_input_method_controller
)
183 menu_decor_select( rect
);
185 if( button_down( k_srbind_maccept
) )
187 *data
= (*data
) ^ 0x1;
188 state
= k_ui_button_click
;
194 state
= ui_checkbox_base( box
, data
);
198 if( state
== k_ui_button_holding_inside
)
200 ui_fill( box
, GUI_COL_ACTIVE
);
201 ui_outline( box
, 1, GUI_COL_CLICK
, 0 );
203 else if( state
== k_ui_button_holding_outside
)
205 ui_fill( box
, GUI_COL_DARK
);
206 ui_outline( box
, 1, GUI_COL_CLICK
, 0 );
208 else if( state
== k_ui_button_hover
)
210 ui_fill( box
, GUI_COL_ACTIVE
);
211 ui_outline( box
, 1, GUI_COL_HI
, 0 );
215 ui_fill( box
, select
? GUI_COL_ACTIVE
: GUI_COL_DARK
);
216 ui_outline( box
, 1, select
? GUI_COL_HI
: GUI_COL_NORM
, 0 );
221 ui_rect_pad( box
, (ui_px
[2]){8,8} );
222 ui_fill( box
, GUI_COL_HI
);
225 if( state
== k_ui_button_click
)
228 audio_oneshot( &audio_ui
[0], 1.0f
, 0.0f
);
235 static void menu_heading( ui_rect inout_panel
, const char *label
, u32 colour
)
238 menu_standard_widget( inout_panel
, rect
, 1 );
243 u32 c0
= ui_opacity( GUI_COL_DARK
, 0.36f
),
244 c1
= ui_opacity( GUI_COL_DARK
, 0.5f
);
246 struct ui_vert
*vs
= ui_fill( rect
, c0
);
252 ui_text( rect
, label
, 1, k_ui_align_middle_center
, 1 );
255 ui_text( rect
, label
, 1, k_ui_align_middle_center
, colour
? colour
:
256 ui_colour(k_ui_blue
+k_ui_brighter
) );
259 static u32
medal_colour( u32 flags
)
261 if( flags
& k_ent_route_flag_achieve_gold
)
262 return ui_colour( k_ui_yellow
);
263 else if( flags
& k_ent_route_flag_achieve_silver
)
264 return ui_colour( k_ui_fg
);
268 static i32
menu_nav( i32
*p_row
, int mv
, i32 max
)
270 i32 row_prev
= *p_row
;
272 if( mv
< 0 ) *p_row
= vg_min( max
, (*p_row
) +1 );
273 if( mv
> 0 ) *p_row
= vg_max( 0, (*p_row
) -1 );
275 if( *p_row
!= row_prev
)
278 audio_oneshot( &audio_ui
[3], 1.0f
, 0.0f
);
285 static void menu_try_find_cam( i32 id
)
287 world_instance
*world
= &world_static
.instances
[0];
288 for( u32 i
=0; i
<mdl_arrcount(&world
->ent_npc
); i
++ )
290 ent_npc
*fnpc
= mdl_arritm( &world
->ent_npc
, i
);
291 if( (fnpc
->id
== 50) && (fnpc
->context
== id
) )
293 if( mdl_entity_id_type(fnpc
->camera
) == k_ent_camera
)
295 u32 index
= mdl_entity_id_id( fnpc
->camera
);
296 menu
.bg_cam
= mdl_arritm( &world
->ent_camera
, index
);
305 if( button_down( k_srbind_mopen
) )
307 if( skaterift
.activity
== k_skaterift_default
)
309 menu_open( k_menu_page_main
);
314 if( skaterift
.activity
!= k_skaterift_menu
)
320 /* get buttons inputs
321 * -------------------------------------------------------------------*/
322 int ml
= button_down( k_srbind_mleft
),
323 mr
= button_down( k_srbind_mright
),
324 mu
= button_down( k_srbind_mup
),
325 md
= button_down( k_srbind_mdown
),
328 enter
= button_down( k_srbind_maccept
);
330 if( vg_input
.display_input_method
== k_input_method_kbm
)
332 vg_ui
.wants_mouse
= 1;
335 if( skaterift
.activity
!= k_skaterift_menu
) return;
337 if( vg
.settings_open
)
339 if( button_down( k_srbind_mback
) )
342 audio_oneshot( &audio_ui
[3], 1.0f
, 0.0f
);
345 srinput
.state
= k_input_state_resume
;
351 if( menu
.page
== k_menu_page_credits
)
353 ui_rect panel
= { 0,0, 600, 400 },
354 screen
= { 0,0, vg
.window_x
,vg
.window_y
};
355 ui_rect_center( screen
, panel
);
356 ui_fill( panel
, GUI_COL_DARK
);
357 ui_outline( panel
, 1, GUI_COL_NORM
, 0 );
358 ui_rect_pad( panel
, (ui_px
[]){8,8} );
361 ui_split( panel
, k_ui_axis_h
, 28*2, 0, title
, panel
);
362 ui_font_face( &vgf_default_title
);
363 ui_text( title
, "Skate Rift - Credits", 1, k_ui_align_middle_center
, 0 );
365 ui_split( panel
, k_ui_axis_h
, 28, 0, title
, panel
);
366 ui_font_face( &vgf_default_large
);
367 ui_text( title
, "Mt.Zero Software", 1, k_ui_align_middle_center
, 0 );
369 ui_split( panel
, k_ui_axis_h
, 8, 0, title
, panel
);
370 ui_split( panel
, k_ui_axis_h
, 28*2, 0, title
, panel
);
371 ui_font_face( &vgf_default_title
);
372 ui_text( title
, "Free Software", 1, k_ui_align_middle_center
, 0 );
374 ui_split( panel
, k_ui_axis_h
, 8, 0, title
, panel
);
375 ui_font_face( &vgf_default_large
);
377 "Sam Lantinga - SDL2 - libsdl.org\n"
378 "Hunter WB - Anyascii\n"
379 "David Herberth - GLAD\n"
380 "Dominic Szablewski - QOI - qoiformat.org\n"
381 "Sean Barrett - stb_image, stb_vorbis,\n"
383 "Khronos Group - OpenGL\n"
384 , 1, k_ui_align_left
, 0 );
386 ui_rect end
= { panel
[0], panel
[1] + panel
[3] - 64, panel
[2], 64 };
388 if( menu_button( end
, 1, "Back" ) || button_down( k_srbind_mback
) )
390 menu
.page
= k_menu_page_main
;
395 else if( menu
.page
== k_menu_page_starter
)
397 i32 R
= menu_nav( &menu
.intro_row
, mv
, 3 );
398 ui_rect panel
= { 0,0, 600, 400 },
399 screen
= { 0,0, vg
.window_x
,vg
.window_y
};
400 ui_rect_center( screen
, panel
);
401 ui_fill( panel
, ui_opacity( GUI_COL_DARK
, 0.35f
) );
402 ui_outline( panel
, 1, GUI_COL_NORM
, 0 );
403 ui_rect_pad( panel
, (ui_px
[]){8,8} );
406 ui_split( panel
, k_ui_axis_h
, 28*2, 0, title
, panel
);
407 ui_font_face( &vgf_default_title
);
408 ui_text( title
, "Welcome to Skate Rift", 1, k_ui_align_middle_center
, 0 );
410 ui_split( panel
, k_ui_axis_h
, 28, 0, title
, panel
);
411 ui_font_face( &vgf_default_large
);
413 menu_checkbox( panel
, R
== 0,
414 "Show controls overlay (good for new players)",
415 &control_overlay
.enabled
);
416 menu_checkbox( panel
, R
== 1, "Auto connect to global server",
417 &network_client
.auto_connect
);
419 ui_rect end
= { panel
[0], panel
[1] + panel
[3] - 100, panel
[2], 100 };
420 menu_checkbox( end
, R
== 2, "Don't show this again", &menu
.skip_starter
);
421 if( menu_button( end
, R
== 3, "OK" ) )
423 menu
.page
= k_menu_page_main
;
424 skaterift
.activity
= k_skaterift_default
;
427 menu_try_find_cam( 3 );
432 * -------------------------------------------------------------------*/
434 ui_font_face( &vgf_default_title
);
435 ui_px height
= vg_ui
.font
->ch
+ 16;
436 ui_rect topbar
= { 0, 0, vg
.window_x
, height
};
438 const char *opts
[] = {
439 [k_menu_main_main
] = "Menu",
440 [k_menu_main_map
] = "Map",
441 [k_menu_main_settings
] = "Settings",
442 [k_menu_main_guide
] = "Guides"
446 u8 lb_down
= 0, rb_down
= 0;
447 vg_exec_input_program( k_vg_input_type_button_u8
,
449 vg_joy_button
, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
, vg_end
451 vg_exec_input_program( k_vg_input_type_button_u8
,
453 vg_joy_button
, SDL_CONTROLLER_BUTTON_LEFTSHOULDER
, vg_end
456 if( menu
.repeater
> 0.0f
)
458 menu
.repeater
-= vg_minf( vg
.time_frame_delta
, 0.5f
);
462 if( lb_down
!= rb_down
)
464 menu
.main_index
+= rb_down
;
465 menu
.main_index
-= lb_down
;
466 menu
.repeater
+= 0.2f
;
468 if( menu
.main_index
== -1 )
471 if( menu
.main_index
== vg_list_size(opts
) )
475 audio_oneshot( &audio_ui
[3], 1.0f
, 0.0f
);
480 ui_px x
= 0, spacer
= 8;
481 for( u32 draw
=0; draw
<2; draw
++ )
483 if( vg_input
.display_input_method
== k_input_method_controller
)
487 ui_rect inf_lb
= { x
, 0, 32, height
};
488 ui_fill( inf_lb
, lb_down
? GUI_COL_NORM
: GUI_COL_NORM
);
489 ui_text( inf_lb
, "\x91", 1, k_ui_align_middle_center
, 0 );
494 for( i32 i
=0; i
<vg_list_size(opts
); i
++ )
496 ui_rect box
= { x
, 0, ui_text_line_width(opts
[i
]) + 32, height
};
500 enum ui_button_state state
= ui_button_base( box
);
501 if( state
== k_ui_button_click
)
503 ui_fill( box
, GUI_COL_DARK
);
506 else if( state
== k_ui_button_holding_inside
)
508 ui_fill( box
, GUI_COL_DARK
);
510 else if( state
== k_ui_button_holding_outside
)
512 ui_fill( box
, GUI_COL_DARK
);
513 ui_outline( box
, 1, GUI_COL_CLICK
, 0 );
515 else if( state
== k_ui_button_hover
)
517 ui_fill( box
, GUI_COL_NORM
);
518 ui_outline( box
, 1, GUI_COL_ACTIVE
, 0 );
521 ui_fill( box
, i
==menu
.main_index
? GUI_COL_ACTIVE
: GUI_COL_NORM
);
523 ui_text( box
, opts
[i
], 1, k_ui_align_middle_center
, 0 );
526 x
+= box
[2] + spacer
;
529 if( vg_input
.display_input_method
== k_input_method_controller
)
533 ui_rect inf_rb
= { x
, 0, 32, height
};
534 ui_fill( inf_rb
, rb_down
? GUI_COL_NORM
: GUI_COL_NORM
);
535 ui_text( inf_rb
, "\x92", 1, k_ui_align_middle_center
, 0 );
541 ui_fill( (ui_rect
){ x
+8,0, vg
.window_x
-(x
+8),height
}, GUI_COL_NORM
);
544 x
= vg
.window_x
/2 - x
/2;
545 ui_fill( (ui_rect
){ 0, 0, x
-8, height
}, GUI_COL_NORM
);
549 if( menu
.main_index
== k_menu_main_map
)
552 ui_font_face( &vgf_default_large
);
553 ui_rect title
= { vg
.window_x
/2 - 512/2, height
+8, 512, 64 };
559 ui_fill( (ui_rect
){ x
,y
, 0,height
},
560 world_static
.active_instance
? GUI_COL_DARK
: GUI_COL_ACTIVE
);
564 vg_strnull( &str
, buf
, sizeof(buf
) );
565 vg_strcat( &str
, "Hub World" );
567 if( world_static
.active_instance
)
569 vg_strcat( &str
, " (" );
570 vg_input_string( &str
, input_button_list
[k_srbind_mhub
], 1 );
571 vg_strcatch( &str
, '\x06' );
572 vg_strcatch( &str
, '\x00' );
573 vg_strcat( &str
, "\x1B[0m)" );
576 ui_px w
= ui_text( (ui_rect
){ x
+8, y
, 1000, height
}, buf
, 1,
577 k_ui_align_middle_left
, 0 );
586 world_instance
*world
= &world_static
.instances
[1];
587 if( world
->status
== k_world_status_loaded
)
589 const char *world_name
=
590 mdl_pstr( &world
->meta
, world
->info
.pstr_name
);
592 vg_strnull( &str
, buf
, sizeof(buf
) );
593 vg_strcat( &str
, world_name
);
595 if( !world_static
.active_instance
&&
596 (vg_input
.display_input_method
== k_input_method_controller
) )
598 vg_strcat( &str
, " (" );
599 vg_input_string( &str
, input_button_list
[k_srbind_mhub
], 1 );
600 vg_strcatch( &str
, '\x06' );
601 vg_strcatch( &str
, '\x00' );
602 vg_strcat( &str
, "\x1B[0m)" );
605 vs
= ui_fill( (ui_rect
){ x
,y
, 1000,height
},
606 world_static
.active_instance
? GUI_COL_ACTIVE
: GUI_COL_DARK
);
607 w
= ui_text( (ui_rect
){ x
+16,y
, 1000,height
}, buf
,
608 1, k_ui_align_middle_left
, 0 );
610 w
= w
*vg_ui
.font
->sx
+ 8*3;
613 if( button_down( k_srbind_mhub
) ||
614 ui_button_base( (ui_rect
){0,y
,x
,height
} ) == k_ui_button_click
)
616 world_switch_instance( world_static
.active_instance
^ 0x1 );
617 skaterift
.activity
= k_skaterift_default
;
618 world_map
.view_ready
= 0;
629 if( world_static
.active_instance
)
631 ui_rect stat_panel
= { x
,y
, 256,vg
.window_y
-y
};
632 u32 c0
= ui_opacity( GUI_COL_DARK
, 0.36f
);
633 struct ui_vert
*vs
= ui_fill( stat_panel
, c0
);
635 ui_rect_pad( stat_panel
, (ui_px
[2]){8,0} );
637 for( u32 i
=0; i
<mdl_arrcount( &world
->ent_region
); i
++ )
639 ent_region
*region
= mdl_arritm( &world
->ent_region
, i
);
641 if( !region
->zone_volume
)
644 const char *title
= mdl_pstr( &world
->meta
, region
->pstr_title
);
645 ui_font_face( &vgf_default_large
);
648 menu_standard_widget( stat_panel
, title_box
, 1 );
652 ui_font_face( &vgf_default_small
);
654 ent_volume
*volume
= mdl_arritm(&world
->ent_volume
,
655 mdl_entity_id_id(region
->zone_volume
));
657 u32 combined
= k_ent_route_flag_achieve_gold
|
658 k_ent_route_flag_achieve_silver
;
663 for( u32 j
=0; j
<mdl_arrcount(&world
->ent_route
); j
++ )
665 ent_route
*route
= mdl_arritm(&world
->ent_route
, j
);
668 m4x3_mulv( volume
->to_local
, route
->board_transform
[3], local
);
669 if( !((fabsf(local
[0]) <= 1.0f
) &&
670 (fabsf(local
[1]) <= 1.0f
) &&
671 (fabsf(local
[2]) <= 1.0f
)) )
676 combined
&= route
->flags
;
678 vg_strnull( &str
, buf
, sizeof(buf
) );
679 vg_strcat( &str
, "(Race) " );
680 vg_strcat( &str
, mdl_pstr(&world
->meta
, route
->pstr_name
));
682 if( route
->flags
& k_ent_route_flag_achieve_silver
)
683 vg_strcat( &str
, " \xb3");
684 if( route
->flags
& k_ent_route_flag_achieve_gold
)
685 vg_strcat( &str
, "\xb3");
688 ui_standard_widget( stat_panel
, r
, 1 );
689 ui_text( r
, buf
, 1, k_ui_align_middle_left
,
690 medal_colour(route
->flags
) );
693 for( u32 j
=0; j
<mdl_arrcount(&world
->ent_challenge
); j
++ )
695 ent_challenge
*challenge
= mdl_arritm( &world
->ent_challenge
, j
);
698 m4x3_mulv( volume
->to_local
, challenge
->transform
.co
, local
);
699 if( !((fabsf(local
[0]) <= 1.0f
) &&
700 (fabsf(local
[1]) <= 1.0f
) &&
701 (fabsf(local
[2]) <= 1.0f
)) )
706 vg_strnull( &str
, buf
, sizeof(buf
) );
707 vg_strcat( &str
, mdl_pstr(&world
->meta
, challenge
->pstr_alias
));
710 if( challenge
->status
)
712 flags
|= k_ent_route_flag_achieve_gold
;
713 flags
|= k_ent_route_flag_achieve_silver
;
714 vg_strcat( &str
, " \xb3\xb3" );
720 ui_standard_widget( stat_panel
, r
, 1 );
721 ui_text( r
, buf
, 1, k_ui_align_middle_left
, medal_colour(flags
) );
728 if( combined
& k_ent_route_flag_achieve_gold
)
729 title_col
= ui_colour( k_ui_yellow
);
730 else if( combined
& k_ent_route_flag_achieve_silver
)
731 title_col
= ui_colour( k_ui_fg
);
733 menu_heading( title_box
, title
, title_col
);
736 vs
[2].co
[1] = stat_panel
[1];
737 vs
[3].co
[1] = stat_panel
[1];
742 if( button_down( k_srbind_mback
) )
745 audio_oneshot( &audio_ui
[3], 1.0f
, 0.0f
);
747 skaterift
.activity
= k_skaterift_default
;
751 ui_rect list0
= { vg
.window_x
/2 - 512/2, height
+32,
752 512, vg
.window_y
-height
-64 }, list
;
753 rect_copy( list0
, list
);
754 ui_rect_pad( list
, (ui_px
[2]){8,8} );
757 * -------------------------------------------------------------------*/
759 if( menu
.main_index
== k_menu_main_main
)
761 i32 R
= menu_nav( &menu
.main_row
, mv
, 2 );
763 if( menu_button( list
, R
== 0, "Resume" ) )
765 skaterift
.activity
= k_skaterift_default
;
769 if( menu_button( list
, R
== 1, "Credits" ) )
771 menu
.page
= k_menu_page_credits
;
774 ui_rect end
= { list
[0], list
[1]+list
[3]-64, list
[2], 72 };
775 if( menu_button( end
, R
== 2, "Quit Game" ) )
777 vg
.window_should_close
= 1;
780 else if( menu
.main_index
== k_menu_main_settings
)
782 ui_fill( list0
, ui_opacity( GUI_COL_DARK
, 0.36f
) );
783 ui_outline( list0
, 1, GUI_COL_NORM
, 0 );
784 i32 R
= menu_nav( &menu
.settings_row
, mv
, 8 );
786 ui_font_face( &vgf_default_large
);
788 menu_heading( list
, "Game", 0 );
789 menu_checkbox( list
, R
== 0, "Show controls overlay",
790 &control_overlay
.enabled
);
791 menu_checkbox( list
, R
== 1, "Auto connect to global server",
792 &network_client
.auto_connect
);
794 menu_heading( list
, "Audio/Video", 0 );
795 menu_slider( list
, R
== 2, "Volume", 0, 100,
796 &vg_audio
.external_global_volume
, "%.f%%" );
797 menu_slider( list
, R
== 3, "Resolution", 0, 100,
798 &k_render_scale
, "%.f%%" );
799 menu_checkbox( list
, R
== 4, "Motion Blur", &k_blur_effect
);
801 menu_heading( list
, "Camera", 0 );
802 menu_slider( list
, R
== 5, "Fov", 97, 135,
803 &k_fov
, "%.1f\xb0" );
804 menu_slider( list
, R
== 6, "Cam Height", -0.4f
, +1.4f
,
805 &k_cam_height
, vg_lerpf(-0.4f
,1.4f
,k_cam_height
)>=0.0f
?
807 menu_checkbox( list
, R
== 7, "Invert Y Axis", &k_invert_y
);
810 ui_rect end
= { list
[0], list
[1]+list
[3]-64, list
[2], 72 };
811 ui_font_face( &vgf_default_small
);
812 menu_heading( end
, "Advanced", 0 );
813 if( menu_button( end
, R
== 8, "Open Engine Settings" ) )
818 else if( menu
.main_index
== k_menu_main_guide
)
823 ui_fill( list0
, ui_opacity( GUI_COL_DARK
, 0.36f
) );
824 ui_outline( list0
, 1, GUI_COL_NORM
, 0 );
825 i32 R
= menu_nav( &menu
.guides_row
, mv
, 7 );
827 ui_font_face( &vgf_default_large
);
829 menu_heading( list
, "Info", 0 );
830 if( R
== 0 ) menu_try_find_cam( 1 );
831 if( menu_button( list
, R
== 0, "Where to go" ) )
835 if( R
== 1 ) menu_try_find_cam( 0 );
836 if( menu_button( list
, R
== 1, "Finding worlds" ) )
840 if( R
== 2 ) menu_try_find_cam( 2 );
841 if( menu_button( list
, R
== 2, "Playing Online" ) )
845 menu_heading( list
, "Controls", 0 );
846 if( R
>= 3 ) menu_try_find_cam( 3 );
847 if( menu_button( list
, R
== 3, "Skating \xb2" ) )
850 if( menu_button( list
, R
== 4, "Tricks \xb2" ) )
854 menu_heading( list
, "Workshop", 0 );
855 if( menu_button( list
, R
== 5, "Create a Board \xb2" ) )
858 if( menu_button( list
, R
== 6, "Create a World \xb2" ) )
861 if( menu_button( list
, R
== 7, "Create a Playermodel \xb2" ) )
870 vg_ui
.frosting
= 0.015f
;
871 ui_flush( k_ui_shader_colour
, vg
.window_x
, vg
.window_y
);
872 vg_ui
.frosting
= 0.0f
;
874 ui_font_face( &vgf_default_small
);