the pain is gone
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_skateshop.c
index a30fca9b5b343921375195d80423e34fd99818e4..6cf47dc69cd1fb5192d23a291b65a3c301d545bc 100644 (file)
@@ -323,6 +323,7 @@ next_file: tinydir_next( &dir );
 
 VG_STATIC void global_skateshop_exit(void)
 {
+   vg_info( "exit skateshop\n" );
    localplayer.immobile = 0;
    global_skateshop.active = 0;
 }
@@ -437,34 +438,41 @@ VG_STATIC void global_skateshop_preupdate(void)
       return;
    }
 
-   float h = localplayer.input_js1h->axis.value;
-
    if( global_skateshop.interface_loc <= k_skateshop_loc_page__viewing ){
-      if( fabsf(h) > 0.25f ){
-         if( h < 0.0f ){
-            if( global_skateshop.selected_registry_id > 0 )
-               global_skateshop.selected_registry_id --;
+
+      gui_helper_action( axis_display_string( k_sraxis_mbrowse_h ), "browse" );
+      gui_helper_action( button_display_string( k_srbind_maccept ), "pick" );
+      gui_helper_action( button_display_string( k_srbind_mback ), "exit" );
+      
+      int moved = 0;
+
+      if( button_down( k_srbind_mleft ) ){
+         if( global_skateshop.selected_registry_id > 0 ){
+            global_skateshop.selected_registry_id --;
+            moved = 1;
          }
-         else{
-            if( global_skateshop.selected_registry_id < 
-                     global_skateshop.registry_count-1 )
-            {
-               global_skateshop.selected_registry_id ++;
-            }
+      }
+
+      if( button_down( k_srbind_mright ) ){
+         if( global_skateshop.selected_registry_id < 
+                  global_skateshop.registry_count-1 )
+         {
+            global_skateshop.selected_registry_id ++;
+            moved = 1;
          }
+      }
 
+      if( moved ){
          vg_info( "Select registry: %u\n", 
                   global_skateshop.selected_registry_id );
          global_skateshop.interaction_cooldown = 0.125f;
          return;
       }
 
-      if( vg_input_button_down( &input_menu_back ) ){
+      if( button_down( k_srbind_mback ) ){
          global_skateshop_exit();
          return;
       }
-
-      gui_helper_action( localplayer.input_use, "Select" );
    }
 }