vg_strnull( &freecam_text, player_replay.helper_freecam->text,
GUI_HELPER_TEXT_LENGTH );
vg_strcat( &freecam_text,
- player_replay.use_freecam? "exit freecam": "freecam" );
+ player_replay.use_freecam? "Exit freecam": "Freecam" );
}
static void replay_show_helpers(void)
vg_str text;
if( gui_new_helper( input_axis_list[k_sraxis_replay_h], &text ) )
- vg_strcat( &text, "scrub" );
+ vg_strcat( &text, "Scrub" );
if( (player_replay.helper_resume = gui_new_helper(
input_button_list[k_srbind_replay_resume], &text )) )
- vg_strcat( &text, "resume" );
+ vg_strcat( &text, "Resume" );
if( gui_new_helper( input_button_list[k_srbind_replay_play], &text ))
- vg_strcat( &text, "playback" );
+ vg_strcat( &text, "Playback" );
player_replay.helper_freecam = gui_new_helper(
input_button_list[k_srbind_replay_freecam], &text );
}
/* move freecam */
- vg_ui.wants_mouse = 0;
+ ui_capture_mouse(0);
freecam_preupdate();
if( vg_getkey(SDLK_q) )
ui_text( timeline, "0s", 1, k_ui_align_middle_right, 0 );
if( !player_replay.editor_mode ) return;
- vg_ui.wants_mouse = 1;
+ ui_capture_mouse(1);
ui_rect panel = { 0, timeline[3] + 20, 200, 400 };
ui_fill( panel, ui_opacity( ui_colour(k_ui_bg), 0.5f ) );
ui_rect script = { 0, height + 2, vg.window_x, 16 };
ui_fill( script, ui_colour( k_ui_bg ) );
- f64 mouse_t = start + ((f64)vg_ui.mouse[0] / (f64)vg.window_x)*len;
+ f64 mouse_t = start + ((f64)g_ui_ctx->mouse[0] / (f64)vg.window_x)*len;
/* keyframe draw and select */
bool absorb_by_keyframe = 0;
/* keyframe selection */
ui_rect tag = { x, script[1], 16, 16 };
- if( ui_inside_rect( tag, vg_ui.mouse ) )
+ if( ui_inside_rect( tag, g_ui_ctx->mouse ) )
{
absorb_by_keyframe = 1;
bool pos_correct = 0;
- if( ui_inside_rect( dragbar, vg_ui.mouse_click ) )
+ if( ui_inside_rect( dragbar, g_ui_ctx->mouse_click ) )
{
if( ui_clicking( UI_MOUSE_LEFT ) )
{
if( pos_correct )
{
- tag[0] = vg_ui.mouse[0]-8;
+ tag[0] = g_ui_ctx->mouse[0]-8;
tray[0] = tag[0]+8-32;
dragbar[0] = tray[0]+16;
}
}
- if( ui_inside_rect( dragbar, vg_ui.mouse ) )
+ if( ui_inside_rect( dragbar, g_ui_ctx->mouse ) )
{
- vg_ui.cursor = k_ui_cursor_hand;
+ g_ui_ctx->cursor = k_ui_cursor_hand;
}
if( !pos_correct )
}
/* adding keyframes */
- if( ui_inside_rect( script, vg_ui.mouse ) )
+ if( ui_inside_rect( script, g_ui_ctx->mouse ) )
{
- vg_ui.cursor = k_ui_cursor_hand;
+ g_ui_ctx->cursor = k_ui_cursor_hand;
- ui_rect cursor = { vg_ui.mouse[0], script[1], 4, 16 };
+ ui_rect cursor = { g_ui_ctx->mouse[0], script[1], 4, 16 };
ui_fill( cursor, ui_colour( k_ui_fg ) );
if( !absorb_by_keyframe && ui_click_down( UI_MOUSE_LEFT ) )
/* timeline scrub */
bool start_in_timeline =
ui_clicking(UI_MOUSE_LEFT) &&
- ui_inside_rect(timeline, vg_ui.mouse_click);
- if( (ui_inside_rect( timeline, vg_ui.mouse )) || start_in_timeline )
+ ui_inside_rect(timeline, g_ui_ctx->mouse_click);
+ if( (ui_inside_rect( timeline, g_ui_ctx->mouse )) || start_in_timeline )
{
- ui_rect cursor = { vg_ui.mouse[0], timeline[1], 4, timeline[3] };
+ ui_rect cursor = { g_ui_ctx->mouse[0], timeline[1], 4, timeline[3] };
ui_fill( cursor, ui_colour( k_ui_fg ) );
- vg_ui.cursor = k_ui_cursor_ibeam;
+ g_ui_ctx->cursor = k_ui_cursor_ibeam;
if( ui_clicking( UI_MOUSE_LEFT ) && start_in_timeline )
{
ui_info( panel, "World settings" );
f32 new_time = world_current_instance()->time;
- if( ui_slider( panel, "Time of day", 0, 1, &new_time, NULL ) )
+ if( ui_slider( panel, "Time of day", 0, 1, &new_time ) )
{
world_current_instance()->time = new_time;
}