audio_clip audio_ui[] = {
{ .path = "sound/ui_click.ogg" },
{ .path = "sound/ui_ding.ogg" },
- { .path = "sound/teleport.ogg" }
+ { .path = "sound/teleport.ogg" },
+ { .path = "sound/ui_move.ogg" }
};
audio_clip audio_challenge[] = {
*/
static void menu_trigger_item( ent_menuitem *item )
{
- if ( item->type == k_ent_menuitem_type_event_button ){
+ audio_lock();
+ audio_oneshot( &audio_ui[0], 1.0f, 0.0f );
+ audio_unlock();
+
+ if ( item->type == k_ent_menuitem_type_event_button )
+ {
u32 q = item->button.pstr;
- if( MDL_CONST_PSTREQ( &menu.model, q, "quit" ) ){
+ if( MDL_CONST_PSTREQ( &menu.model, q, "quit" ) )
+ {
vg.window_should_close = 1;
}
else if( MDL_CONST_PSTREQ( &menu.model, q, "map" ) ){
menu_back_page();
}
else if( menu.loc ){
- if( ui_click_down( UI_MOUSE_LEFT ) ){
+ if( ui_click_down( UI_MOUSE_LEFT ) )
+ {
menu_trigger_item( menu.loc );
}
}
mh = 0;
}
- if( escape ){
+ if( escape )
+ {
menu_back_page();
+ audio_lock();
+ audio_oneshot( &audio_ui[3], 1.0f, 0.0f );
+ audio_unlock();
}
- else if( enter ){
+ else if( enter )
+ {
menu_trigger_item( menu.loc );
}
else if( mh||mv ){
v3f opt;
v3_zero( opt );
- f32 best = 0.707f;
+ f32 best = 0.5f;
ent_menuitem *nextpos = NULL;
opt[0] += mh;
}
}
- if( nextpos ){
+ if( nextpos )
+ {
menu.loc = nextpos;
+ audio_lock();
+ audio_oneshot( &audio_ui[3], 1.0f, 0.0f );
+ audio_unlock();
}
}
}