(world_static.challenge_target == NULL) ){
world_static.challenge_target = NULL;
world_entity_focus( call->id );
+
+ gui_helper_clear();
+ vg_str text;
+ if( gui_new_helper( input_button_list[k_srbind_maccept], &text ))
+ vg_strcat( &text, "start" );
+ if( gui_new_helper( input_button_list[k_srbind_mback], &text ))
+ vg_strcat( &text, "exit" );
}
}
else {
world_entity_focus_camera( world, challenge->camera );
- gui_helper_action( button_display_string( k_srbind_maccept ), "start" );
- gui_helper_action( button_display_string( k_srbind_mback ), "exit" );
-
if( mdl_entity_id_type( challenge->first ) == k_ent_objective ){
if( button_down( k_srbind_maccept ) ){
u32 index = mdl_entity_id_id( challenge->first );
index );
world_static.challenge_timer = 0.0f;
world_entity_unfocus();
+ gui_helper_clear();
u32 next = challenge->first;
while( mdl_entity_id_type(next) == k_ent_objective ){
if( button_down( k_srbind_mback ) ){
world_static.challenge_target = NULL;
world_entity_unfocus();
+ gui_helper_clear();
audio_oneshot( &audio_challenge[4], 1.0f, 0.0f );
return;
}
if( call->function == 0 ){ /* view() */
if( localplayer.subsystem == k_player_subsystem_walk ){
world_entity_focus( call->id );
+
+ gui_helper_clear();
+ vg_str text;
+
+ if( (global_ent_route.helper_weekly =
+ gui_new_helper( input_button_list[k_srbind_mleft], &text )))
+ vg_strcat( &text, "weekly" );
+
+ if( (global_ent_route.helper_alltime =
+ gui_new_helper( input_button_list[k_srbind_mright], &text )))
+ vg_strcat( &text, "all time" );
+
+ if( gui_new_helper( input_button_list[k_srbind_mback], &text ) )
+ vg_strcat( &text, "exit" );
}
}
else {
world_entity_focus_camera( world, cam_id );
- gui_helper_action( button_display_string( k_srbind_mleft ), "weekly" );
- gui_helper_action( button_display_string( k_srbind_mright ), "all time" );
- gui_helper_action( button_display_string( k_srbind_mback ), "exit" );
-
if( button_down( k_srbind_mleft ) ){
world_sfd.view_weekly = 1;
world_sfd_compile_active_scores();
if( button_down( k_srbind_mback ) ){
world_entity_unfocus();
+ gui_helper_clear();
return;
}
}
#include "entity.h"
+static struct {
+ struct gui_helper *helper_weekly, *helper_alltime;
+}
+global_ent_route;
+
static void ent_route_call( world_instance *world, ent_call *call );
static void ent_route_preupdate( ent_route *route, int active );
if( shop->type == k_skateshop_type_boardshop ){
if( !vg_loader_availible() ) return;
- gui_helper_action( axis_display_string( k_sraxis_mbrowse_h ), "browse" );
- gui_helper_action( button_display_string( k_srbind_mback ), "exit" );
-
u16 cache_id = skateshop_selected_cache_id();
- if( cache_id ){
- gui_helper_action( button_display_string( k_srbind_maccept ), "pick" );
- }
+ global_skateshop.helper_pick->greyed = !cache_id;
/*
* Controls
network_send_item( k_netmsg_playeritem_board );
world_entity_unfocus();
+ gui_helper_clear();
skaterift_autosave(1);
return;
}
else if( shop->type == k_skateshop_type_charshop ){
if( !vg_loader_availible() ) return;
- gui_helper_action( axis_display_string( k_sraxis_mbrowse_h ), "browse" );
- gui_helper_action( button_display_string( k_srbind_mback ), "exit" );
- gui_helper_action( button_display_string( k_srbind_maccept ), "pick" );
-
int changed = 0;
if( button_down( k_srbind_mleft ) ){
if( button_down( k_srbind_maccept ) ){
network_send_item( k_netmsg_playeritem_player );
world_entity_unfocus();
+ gui_helper_clear();
}
}
else if( shop->type == k_skateshop_type_worldshop ){
int browseable = 0,
loadable = 0;
- if( addon_count(k_addon_type_world) && vg_loader_availible() ){
- gui_helper_action( axis_display_string(k_sraxis_mbrowse_h), "browse" );
+ if( addon_count(k_addon_type_world) && vg_loader_availible() )
browseable = 1;
- }
- if( vg_loader_availible() && global_skateshop.selected_world_id > 0 ){
- gui_helper_action( button_display_string(k_srbind_maccept),
- "open rift" );
+ if( vg_loader_availible() && global_skateshop.selected_world_id > 0 )
loadable = 1;
- }
+
+ global_skateshop.helper_browse->greyed = !browseable;
+ global_skateshop.helper_pick->greyed = !loadable;
int change = 0;
network_send_item( k_netmsg_playeritem_player );
world_entity_unfocus();
+ gui_helper_clear();
return;
}
}
vg_fatal_error( "Unknown store (%u)\n", shop->type );
}
+static void ent_skateshop_helpers_pickable( const char *acceptance ){
+ vg_str text;
+
+ if( gui_new_helper( input_button_list[k_srbind_mback], &text ))
+ vg_strcat( &text, "exit" );
+
+ if( (global_skateshop.helper_pick = gui_new_helper(
+ input_button_list[k_srbind_maccept], &text))){
+ vg_strcat( &text, acceptance );
+ }
+
+ if( (global_skateshop.helper_browse = gui_new_helper(
+ input_axis_list[k_sraxis_mbrowse_h], &text ))){
+ vg_strcat( &text, "browse" );
+ }
+}
+
/*
* Entity logic: entrance event
*/
vg_info( "Entering skateshop\n" );
world_entity_focus( call->id );
-#if 0
- localplayer.immobile = 1;
- menu.disable_open = 1;
- skaterift.activity = k_skaterift_skateshop;
-
- v3_zero( localplayer.rb.v );
- v3_zero( localplayer.rb.w );
- localplayer._walk.move_speed = 0.0f;
- global_skateshop.ptr_ent = shop;
-#endif
+ gui_helper_clear();
if( shop->type == k_skateshop_type_boardshop ){
skateshop_update_viewpage();
skateshop_op_board_scan();
+ ent_skateshop_helpers_pickable( "pick" );
}
else if( shop->type == k_skateshop_type_charshop ){
-
+ ent_skateshop_helpers_pickable( "pick" );
}
else if( shop->type == k_skateshop_type_worldshop ){
+ ent_skateshop_helpers_pickable( "open rift" );
pointcloud_animate( k_pointcloud_anim_opening );
skateshop_op_world_scan();
}
struct{
v3f look_target;
-#if 0
- ent_skateshop *ptr_ent; /* TODO */
- float factive; /* TODO */
- camera cam;
-#endif
-
struct shop_view_slot{
u16 cache_id;
float view_blend;
u32 world_reg;
}
render;
+
+ struct gui_helper *helper_pick, *helper_browse;
}
static global_skateshop={.render={.reg_id=0xffffffff,.world_reg=0xffffffff}};
k_gui_icon_count,
};
+#define GUI_HELPER_TEXT_LENGTH 32
+
struct{
struct gui_helper{
- const char *bindstr, *text;
+ vg_input_op *binding;
+ char text[GUI_HELPER_TEXT_LENGTH];
+ int greyed;
}
helpers[4];
u32 helper_count;
+ int active_positional_helper;
+
struct icon_call {
enum gui_icon icon;
v4f location;
font3d font;
v3f trick_co;
- enum guitrick_type{
- k_guitrick_type_none,
- k_guitrick_type_ollie,
- k_guitrick_type_trick,
- k_guitrick_type_backflip,
- k_guitrick_type_pump,
- k_guitrick_type_isc
- }
- trick_type;
mdl_context model_icons;
GLuint icons_texture;
}
static gui = {.cur_icon_colour = {1.0f,1.0f,1.0f,1.0f},.colour_changed=1};
-static
-void gui_helper_action( const char *bindstr, const char *text ){
+static void gui_helper_clear(void){
+ gui.helper_count = 0;
+ gui.active_positional_helper = 0;
+}
+
+static struct gui_helper *gui_new_helper( vg_input_op *bind, vg_str *out_text ){
if( gui.helper_count >= vg_list_size(gui.helpers) ){
vg_error( "Too many helpers\n" );
- return;
+ return NULL;
}
struct gui_helper *helper = &gui.helpers[ gui.helper_count ++ ];
- helper->bindstr = bindstr;
- helper->text = text;
+ helper->greyed = 0;
+ helper->binding = bind;
+ vg_strnull( out_text, helper->text, sizeof(helper->text) );
+ return helper;
}
static void gui_draw(void){
- if( v3_dist2(localplayer.rb.co,gui.trick_co) > 2.0f ){
- gui.trick_type = k_guitrick_type_none;
- }
-
- if( gui.trick_type == k_guitrick_type_pump ){
- gui_helper_action(axis_display_string(k_sraxis_grab),"Crouch");
- }
- else if( gui.trick_type == k_guitrick_type_backflip ){
- gui_helper_action(joystick_display_string(k_srjoystick_steer,1),"Flip");
- }
- else if( gui.trick_type == k_guitrick_type_ollie ){
- gui_helper_action(button_display_string(k_srbind_jump),"Ollie");
- }
- else if( gui.trick_type == k_guitrick_type_trick ){
- gui_helper_action(button_display_string(k_srbind_trick0),"Shuvit");
- gui_helper_action(button_display_string(k_srbind_trick1),"Kickflip");
- gui_helper_action(button_display_string(k_srbind_trick2),"Tre-Flip");
- }
- else if( gui.trick_type == k_guitrick_type_isc ){
- gui_helper_action(button_display_string(k_srbind_camera),"Camera");
- gui_helper_action(button_display_string(k_srbind_use), "Skate/Walk");
- }
+ if( gui.active_positional_helper &&
+ (v3_dist2(localplayer.rb.co,gui.trick_co) > 2.0f) )
+ gui_helper_clear();
camera ortho;
for( u32 i=0; i<gui.helper_count; i++ ){
struct gui_helper *helper = &gui.helpers[i];
- font3d_setcolour( (v4f){1.0f,1.0f,1.0f,1.0f} );
- font3d_simple_draw( 2, helper->bindstr, &ortho, mmdl );
+ char buf[32];
+ vg_str str;
+ vg_strnull( &str, buf, sizeof(buf) );
+ vg_input_string( &str, helper->binding, 1 );
+
+ font3d_setcolour( (v4f){1.0f,1.0f,1.0f, helper->greyed? 0.5f: 1.0f} );
+ font3d_simple_draw( 2, buf, &ortho, mmdl );
const char *make_smaller = "\x02\xaf\x03 ";
font3d_draw( make_smaller );
float w = gui_font3d.offset[0]+1.0f;
mmdl[3][0] += w*scale;
}
-
- gui.helper_count = 0;
}
static int gui_location_print_ccmd( int argc, const char *argv[] ){
static int gui_showtrick_ccmd( int argc, const char *argv[] ){
if( argc == 1 ){
- enum guitrick_type type = k_guitrick_type_none;
- if( !strcmp( argv[0], "pump" ) ) type = k_guitrick_type_pump;
- else if( !strcmp( argv[0], "flip" ) ) type = k_guitrick_type_backflip;
- else if( !strcmp( argv[0], "ollie" ) ) type = k_guitrick_type_ollie;
- else if( !strcmp( argv[0], "trick" ) ) type = k_guitrick_type_trick;
- else if( !strcmp( argv[0], "misc" ) ) type = k_guitrick_type_isc;
+ gui_helper_clear();
+ vg_str text;
+
+ if( !strcmp( argv[0], "pump" ) ){
+ if( gui_new_helper( input_axis_list[k_sraxis_grab], &text ) )
+ vg_strcat( &text, "Pump" );
+ }
+ else if( !strcmp( argv[0], "flip" ) ){
+ if( gui_new_helper( input_joy_list[k_srjoystick_steer], &text ) )
+ vg_strcat( &text, "Flip" );
+ }
+ else if( !strcmp( argv[0], "ollie" ) ){
+ if( gui_new_helper( input_button_list[k_srbind_jump], &text ) )
+ vg_strcat( &text, "Ollie" );
+ }
+ else if( !strcmp( argv[0], "trick" ) ){
+ if( gui_new_helper( input_button_list[k_srbind_trick0], &text ) )
+ vg_strcat( &text, "Shuvit" );
+ if( gui_new_helper( input_button_list[k_srbind_trick1], &text ) )
+ vg_strcat( &text, "Kickflip" );
+ if( gui_new_helper( input_button_list[k_srbind_trick2], &text ) )
+ vg_strcat( &text, "Tre-Flip" );
+ }
+ else if( !strcmp( argv[0], "misc" ) ){
+ if( gui_new_helper( input_button_list[k_srbind_camera], &text ) )
+ vg_strcat( &text, "Camera" );
+ if( gui_new_helper( input_button_list[k_srbind_use], &text ) )
+ vg_strcat( &text, "Skate/Walk" );
+ }
else return 1;
- gui.trick_type = type;
+
v3_copy( localplayer.rb.co, gui.trick_co );
+ gui.active_positional_helper = 1;
return 0;
}
return 1;
k_sraxis_mbrowse_h,
k_sraxis_mbrowse_v,
k_sraxis_replay_h,
- k_sraxis_mworld_h,
-
k_sraxis_max
};
vg_joy_button, SDL_CONTROLLER_BUTTON_B, vg_end
},
[k_srbind_trick2] = (vg_input_op[]){
- vg_mode_mul, vg_mouse, SDL_BUTTON_LEFT, vg_mouse, SDL_BUTTON_RIGHT,
+ vg_mouse, SDL_BUTTON_LEFT, vg_mode_mul, vg_mouse, SDL_BUTTON_RIGHT,
vg_mode_absmax, vg_joy_button, SDL_CONTROLLER_BUTTON_X, vg_end
},
[k_srbind_use] = INPUT_BASIC( SDLK_e, SDL_CONTROLLER_BUTTON_Y ),
[k_srbind_mback] = INPUT_BASIC( SDLK_ESCAPE, SDL_CONTROLLER_BUTTON_B ),
[k_srbind_mopen] = INPUT_BASIC( SDLK_ESCAPE, SDL_CONTROLLER_BUTTON_START ),
[k_srbind_maccept] = (vg_input_op[]){
- vg_keyboard, SDLK_e, vg_keyboard, SDLK_RETURN, vg_keyboard, SDLK_RETURN2,
+ vg_keyboard, SDLK_e, vg_gui_visible, 0,
+ vg_keyboard, SDLK_RETURN, vg_keyboard, SDLK_RETURN2,
+ vg_gui_visible, 1,
vg_joy_button, SDL_CONTROLLER_BUTTON_A, vg_end
},
[k_srbind_replay_play] = INPUT_BASIC( SDLK_g, SDL_CONTROLLER_BUTTON_X ),
vg_joy_axis, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, vg_end
},
[k_sraxis_mbrowse_h] = (vg_input_op[]){
- vg_mode_add, vg_keyboard, SDLK_RIGHT,
vg_mode_sub, vg_keyboard, SDLK_LEFT,
+ vg_mode_add, vg_keyboard, SDLK_RIGHT,
vg_mode_absmax, vg_joy_axis, SDL_CONTROLLER_AXIS_LEFTX,
vg_end
},
[k_srjoystick_steer] = (vg_input_op[]){
vg_index, 0, vg_mode_add, vg_keyboard, SDLK_d,
vg_mode_sub, vg_keyboard, SDLK_a,
- vg_mode_absmax, vg_joy_axis, SDL_CONTROLLER_AXIS_LEFTX,
vg_index, 1, vg_mode_add, vg_keyboard, SDLK_s,
vg_mode_sub, vg_keyboard, SDLK_w,
- vg_mode_absmax, vg_joy_axis, SDL_CONTROLLER_AXIS_LEFTY,
+ vg_mode_absmax, vg_joy_ls,
vg_end
},
[k_srjoystick_grab] = (vg_input_op[]){
- vg_index, 0, vg_mode_absmax, vg_joy_axis, SDL_CONTROLLER_AXIS_RIGHTX,
- vg_index, 1, vg_mode_absmax, vg_joy_axis, SDL_CONTROLLER_AXIS_RIGHTY,
- vg_end
+ vg_joy_rs, vg_end
},
[k_srjoystick_look] = (vg_input_op[]){
- vg_index, 0, vg_mode_absmax, vg_joy_axis, SDL_CONTROLLER_AXIS_RIGHTX,
- vg_index, 1, vg_mode_absmax, vg_joy_axis, SDL_CONTROLLER_AXIS_RIGHTY,
- vg_end
+ vg_joy_rs, vg_end
},
[k_srjoystick_max]=NULL
};
enum input_state {
k_input_state_enabled,
k_input_state_resume,
+ k_input_state_resuming,
k_input_state_pause
}
state;
}
static srinput;
+#if 0
static const char *controller_glyphs[ SDL_CONTROLLER_BUTTON_MAX ][2] =
{ /* xbox/generic playstation */
[ SDL_CONTROLLER_BUTTON_A ] = { "\x1e\x85","\x1e\x82" },
[k_sraxis_mbrowse_h] = "\x88",
[k_sraxis_mbrowse_v] = "\x89",
[k_sraxis_replay_h] = "\x8f\x90",
- [k_sraxis_mworld_h] = "\x93\x95"
};
const char *keyboard_table[ k_sraxis_max ] = {
[k_sraxis_mbrowse_h] = KEYBOARD_GLYPH("\x93")KEYBOARD_GLYPH("\x95"),
[k_sraxis_mbrowse_v] = KEYBOARD_GLYPH("\x96")KEYBOARD_GLYPH("\x94"),
[k_sraxis_replay_h] = KEYBOARD_GLYPH("Q")KEYBOARD_GLYPH("E"),
- [k_sraxis_mworld_h] = KEYBOARD_GLYPH("\x93")KEYBOARD_GLYPH("\x95"),
};
if( vg_input.display_input_method == k_input_method_controller )
return controller_table[ joystick ][axis];
else return keyboard_table[ joystick ][axis];
}
+#endif
static int input_filter_generic(void){
if( srinput.state != k_input_state_enabled ||
return srinput.axis_states[axis][0];
}
-static void setbtn( enum sr_bind button, u8 value )
-{
- srinput.button_states[button][0] |= value;
-}
-
static void skaterift_preupdate_inputs(void){
- if( srinput.state == k_input_state_resume )
+ if( srinput.state == k_input_state_resuming )
srinput.state = k_input_state_enabled;
+ if( srinput.state == k_input_state_resume )
+ srinput.state = k_input_state_resuming;
+
for( u32 i=0; i<k_srbind_max; i++ ){
srinput.button_states[i][1] = srinput.button_states[i][0];
srinput.button_states[i][0] = 0;
srinput.axis_states[i][0] = 0.0f;
}
- u32 mouse = SDL_GetMouseState(NULL,NULL),
- mouse1= (mouse & SDL_BUTTON(SDL_BUTTON_LEFT))? 1: 0,
- mouse2= (mouse & SDL_BUTTON(SDL_BUTTON_RIGHT))? 1: 0;
-
for( int i=0; i<k_srbind_max; i++ ){
vg_input_op *prog = input_button_list[i];
if( prog ){
srinput.joystick_states[i][0] );
}
}
+
+ f32 x = srinput.axis_states[k_sraxis_mbrowse_h][0],
+ y = srinput.axis_states[k_sraxis_mbrowse_v][0],
+ sensitivity = 0.35f;
+
+ if( fabsf(x) > sensitivity ){
+ if( x > 0.0f ) srinput.button_states[k_srbind_mright][0] = 1;
+ else srinput.button_states[k_srbind_mleft][0] = 1;
+ }
+
+ if( fabsf(y) > sensitivity ){
+ if( y > 0.0f ) srinput.button_states[k_srbind_mup][0] = 1;
+ else srinput.button_states[k_srbind_mdown][0] = 1;
+ }
}
#endif /* INPUT_H */
}
static void menu_binding_string( char buf[128], u32 pstr ){
- vg_strncpy( "error", buf, 128, k_strncpy_allow_cutoff );
+ vg_str str;
+ vg_strnull( &str, buf, 128 );
if( MDL_CONST_PSTREQ( &menu.model, pstr, "bind_jump" ) ){
- vg_strncpy( button_display_string(k_srbind_jump), buf, 128,
- k_strncpy_allow_cutoff );
+ vg_input_string( &str, input_button_list[k_srbind_jump], 1 );
}
else if( MDL_CONST_PSTREQ( &menu.model, pstr, "bind_trick0" ) ){
- vg_str str;
- vg_strnull( &str, buf, 128 );
vg_strcat( &str, "SHUVIT " );
- vg_strcat( &str, button_display_string(k_srbind_trick0) );
+ vg_input_string( &str, input_button_list[k_srbind_trick0], 1 );
}
else if( MDL_CONST_PSTREQ( &menu.model, pstr, "bind_trick1" ) ){
- vg_str str;
- vg_strnull( &str, buf, 128 );
vg_strcat( &str, "KICKFLIP " );
- vg_strcat( &str, button_display_string(k_srbind_trick1) );
+ vg_input_string( &str, input_button_list[k_srbind_trick1], 1 );
}
else if( MDL_CONST_PSTREQ( &menu.model, pstr, "bind_trick2" ) ){
- vg_str str;
- vg_strnull( &str, buf, 128 );
vg_strcat( &str, "TREFLIP " );
- vg_strcat( &str, button_display_string(k_srbind_trick2) );
+ vg_input_string( &str, input_button_list[k_srbind_trick2], 1 );
}
else if( MDL_CONST_PSTREQ( &menu.model, pstr, "bind_grab" ) ){
- vg_strncpy( axis_display_string(k_sraxis_grab), buf, 128,
- k_strncpy_allow_cutoff );
+ vg_input_string( &str, input_axis_list[k_sraxis_grab], 1 );
}
else if( MDL_CONST_PSTREQ( &menu.model, pstr, "bind_grab_mod" ) ){
- vg_strncpy( joystick_display_string(k_srjoystick_grab, 2), buf, 128,
- k_strncpy_allow_cutoff );
+ vg_input_string( &str, input_joy_list[k_srjoystick_grab], 1 );
}
+ else
+ vg_strcat( &str, "error" );
}
#endif /* MENU_H */
skaterift.resume_begin = skaterift.replay.cursor;
skaterift.resume_transition = 0.0f;
}
+
+ gui_helper_clear();
}
+static void skaterift_replay_update_helpers(void);
+
static void skaterift_replay_pre_update(void){
if( skaterift.activity != k_skaterift_replay ) return;
if( skaterift.freecam )
replay_get_camera( &skaterift.replay, &skaterift.replay_freecam );
+
+ skaterift_replay_update_helpers();
}
f32 target_speed = axis_state( k_sraxis_replay_h ) * 5.0;
else
skaterift.activity = k_skaterift_default;
srinput.state = k_input_state_resume;
+ gui_helper_clear();
}
- gui_helper_action( button_display_string(k_srbind_replay_play), "play" );
- gui_helper_action( axis_display_string(k_sraxis_replay_h), "scrub" );
if( skaterift.freecam ){
- gui_helper_action( button_display_string(k_srbind_replay_freecam),
- "exit freecam" );
-
camera *cam = &skaterift.replay_freecam;
v3f angles;
v3_copy( cam->angles, angles );
skaterift.freecam_v, vg.time_frame_delta, cam->pos );
}
else {
- gui_helper_action( button_display_string(k_srbind_replay_resume),
- "resume" );
- gui_helper_action( button_display_string(k_srbind_replay_freecam),
- "enter freecam" );
-
if( button_down( k_srbind_replay_resume ) ){
skaterift_replay_resume();
}
}
}
+static void skaterift_replay_update_helpers(void){
+ skaterift.helper_resume->greyed = skaterift.freecam;
+
+ vg_str freecam_text;
+ vg_strnull( &freecam_text, skaterift.helper_freecam->text,
+ GUI_HELPER_TEXT_LENGTH );
+ vg_strcat( &freecam_text, skaterift.freecam? "exit freecam": "freecam" );
+}
+
+static void skaterift_replay_post_render(void){
+ /* capture the current resume frame at the very last point */
+ if( button_down( k_srbind_reset ) ){
+ if( skaterift.activity == k_skaterift_default ){
+ skaterift.activity = k_skaterift_replay;
+ skaterift_record_frame( &skaterift.replay, 1 );
+ if( skaterift.replay.head ){
+ skaterift.replay.cursor = skaterift.replay.head->time;
+ skaterift.replay.cursor_frame = skaterift.replay.head;
+ }
+ skaterift.replay_control = k_replay_control_scrub;
+
+ gui_helper_clear();
+ vg_str text;
+
+ if( gui_new_helper( input_axis_list[k_sraxis_replay_h], &text ) )
+ vg_strcat( &text, "scrub" );
+
+ if( (skaterift.helper_resume = gui_new_helper(
+ input_button_list[k_srbind_replay_resume], &text )) )
+ vg_strcat( &text, "resume" );
+
+ if( gui_new_helper( input_button_list[k_srbind_replay_play], &text ))
+ vg_strcat( &text, "playback" );
+
+ skaterift.helper_freecam = gui_new_helper(
+ input_button_list[k_srbind_replay_freecam], &text );
+
+ skaterift_replay_update_helpers();
+ }
+ }
+}
+
static void skaterift_get_replay_camera( camera *cam ){
if( skaterift.freecam ){
cam->nearz = 0.1f;
snprintf( buffer, 128, "-%.2fs\n", len );
ui_text( bar, buffer, 1, k_ui_align_middle_left, 0 );
ui_text( bar, "0s", 1, k_ui_align_middle_right, 0 );
-
-#if 0
- char buf[256];
- snprintf( buf, 256, "scrub: %s\nresume: %s\nplay: %s\n",
- axis_display_string( k_sraxis_replay_h ),
- button_display_string( k_srbind_replay_resume ),
- button_display_string( k_srbind_replay_play ) );
-
- ui_rect info = { 0, vg.window_y-bar[3]-128, 256, 128 };
- ui_text( info, buf, 2,0,0 );
-#endif
}
#endif /* PLAYER_REPLAY_C */
static void respawn_chooser_pre_update(void){
if( skaterift.activity != k_skaterift_respawning ) return;
- gui_helper_action( joystick_display_string(k_srjoystick_steer,2), "move" );
- if( world_static.instances[0].status == k_world_status_loaded )
- gui_helper_action( axis_display_string(k_sraxis_mworld_h), "world" );
- gui_helper_action( button_display_string(k_srbind_maccept), "spawn" );
- gui_helper_action( button_display_string(k_srbind_home), "home" );
-
if( button_down( k_srbind_mback ) ){
srinput.state = k_input_state_resume;
skaterift.activity = k_skaterift_menu;
respawn_world_to_plane_pos( localplayer.rb.co, respawn_chooser.plane_pos );
respawn_chooser.boom_dist = 400.0f;
respawn_chooser.home_select = 0;
+
+ gui_helper_clear();
+
+ vg_str text;
+ if( gui_new_helper( input_joy_list[k_srjoystick_steer], &text ) )
+ vg_strcat( &text, "move" );
+
+ if( gui_new_helper( input_button_list[k_srbind_mleft], &text ) )
+ vg_strcat( &text, "world" );
+
+ if( gui_new_helper( input_button_list[k_srbind_maccept], &text ) )
+ vg_strcat( &text, "spawn" );
+
+ if( gui_new_helper( input_button_list[k_srbind_home], &text ) )
+ vg_strcat( &text, "home" );
}
static void respawn_chooser_shader_uniforms(void){
/* composite */
present_view_with_post_processing();
- /* --------------------------------------------------------------------- */
-
- /* capture the current resume frame at the very last point */
- if( button_down( k_srbind_reset ) ){
- if( skaterift.activity == k_skaterift_default ){
- skaterift.activity = k_skaterift_replay;
- skaterift_record_frame( &skaterift.replay, 1 );
- if( skaterift.replay.head ){
- skaterift.replay.cursor = skaterift.replay.head->time;
- skaterift.replay.cursor_frame = skaterift.replay.head;
- }
- skaterift.replay_control = k_replay_control_scrub;
- }
- }
+ skaterift_replay_post_render();
}
static void vg_render(void){
}
replay_control;
f32 track_velocity;
+ struct gui_helper *helper_resume, *helper_freecam;
camera replay_freecam;
int freecam;