+void vg_ui(void)
+{
+ if( world.st.state == k_game_state_settings )
+ {
+ gui_group_id( 35 );
+
+ ui_global_ctx.cursor[2] = 225;
+ gui_fill_y();
+ gui_align_right();
+
+ gui_new_node();
+ {
+ gui_capture_mouse( 200 );
+
+ gui_fill_rect( ui_global_ctx.cursor, 0xC0202020 );
+ ui_rect_pad( ui_global_ctx.cursor, 8 );
+
+ ui_global_ctx.cursor[3] = 25;
+
+ gui_new_node();
+ {
+ gui_text( "Settings", 3 );
+ }
+ gui_end();
+
+ // Colour scheme selection
+ ui_global_ctx.cursor[1] += 30;
+
+ gui_text( "Colour Scheme", 2 );
+ ui_global_ctx.cursor[1] += 25;
+
+ gui_new_node();
+ {
+ ui_global_ctx.cursor[2] = 50;
+
+ for( int i = 0; i < 4; i ++ )
+ {
+ gui_new_node();
+ {
+ // Convert to RGB
+ u32 rgb = 0xff000000;
+
+ for( int j = 0; j < 3; j ++ )
+ rgb |= (u32)(colour_sets[ colour_set_id ][i][j]*255.0f) << j * 8;
+
+ gui_fill_rect( ui_global_ctx.cursor, rgb );
+ }
+ gui_end_right();
+ }
+ }
+ gui_end_down();
+
+ gui_new_node();
+ {
+ ui_global_ctx.cursor[2] = 25;
+ if( gui_button( 0 ) == k_button_click )
+ {
+ if( colour_set_id > 0 )
+ colour_set_id --;
+ }
+ gui_text( "<", 2 );
+ gui_end_right();
+
+ ui_global_ctx.cursor[2] = 150;
+ gui_new_node();
+ {
+ ui_global_ctx.cursor[0] += 45;
+ ui_global_ctx.cursor[1] += 6;
+ gui_text( (const char *[]){ "Normal", "Extra1", "Extra2" }[ colour_set_id ], 2 );
+ }
+ gui_end_right();
+
+ ui_global_ctx.cursor[2] = 25;
+ if( gui_button( 1 ) == k_button_click )
+ {
+ if( colour_set_id < vg_list_size( colour_sets )-1 )
+ colour_set_id ++;
+ }
+ gui_text( ">", 2 );
+ gui_end_down();
+ }
+ gui_end_down();
+ }
+ gui_end();
+ }
+}