menu polish sound / interactions
authorhgn <hgodden00@gmail.com>
Wed, 10 Apr 2024 15:34:50 +0000 (16:34 +0100)
committerhgn <hgodden00@gmail.com>
Wed, 10 Apr 2024 15:34:50 +0000 (16:34 +0100)
menu.c
models_src/rs_menu.mdl

diff --git a/menu.c b/menu.c
index d3e97a77099d7d3f90ac6d3bf112cbc33d5e0450..ed69945eaebd64cb9ba8b8f85122fcec967a043e 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -304,20 +304,32 @@ static void menu_setitem_type( ent_menuitem *item,
  */
 void menu_update(void)
 {
  */
 void menu_update(void)
 {
+   static f32 repeater = 0.0f;
+   if( repeater > 0.0f )
+      repeater -= vg.time_frame_delta;
+
    if( workshop_form.page != k_workshop_form_hidden ){
       return;
    }
 
    if( workshop_form.page != k_workshop_form_hidden ){
       return;
    }
 
-   int escape = button_down( k_srbind_mback );
-   if( menu.credits_open || vg.settings_open ){
-      if( escape ){
+   bool escape = 0;
+                          
+   if( menu.credits_open || vg.settings_open )
+   {
+      vg_exec_input_program( k_vg_input_type_button_u8, 
+                             input_button_list[k_srbind_mback], &escape );
+      if( escape )
+      {
          menu.credits_open = 0;
 
          if( vg.settings_open )
             vg_settings_close();
          menu.credits_open = 0;
 
          if( vg.settings_open )
             vg_settings_close();
+
+         srinput.state = k_input_state_resume;
       }
       return;
    }
       }
       return;
    }
+   escape = button_down( k_srbind_mback );
 
    if( button_down( k_srbind_mopen ) ){
       if( skaterift.activity == k_skaterift_default ){
 
    if( button_down( k_srbind_mopen ) ){
       if( skaterift.activity == k_skaterift_default ){
@@ -555,12 +567,13 @@ void menu_update(void)
             }
          }
 
             }
          }
 
-         if( nextpos )
+         if( nextpos && (repeater <= 0.0f) )
          {
             menu.loc = nextpos;
             audio_lock();
             audio_oneshot( &audio_ui[3], 1.0f, 0.0f );
             audio_unlock();
          {
             menu.loc = nextpos;
             audio_lock();
             audio_oneshot( &audio_ui[3], 1.0f, 0.0f );
             audio_unlock();
+            repeater += 0.1f;
          }
       }
    }
          }
       }
    }
index 0c85cc9aa8a583c3277e7fb145f472c28a5664fd..fe41c2038cf1af1bc147f89a5c59f1df880b2167 100644 (file)
Binary files a/models_src/rs_menu.mdl and b/models_src/rs_menu.mdl differ