review: rigidbody.h
[carveJwlIkooP6JGAAIwe30JlM.git] / menu.h
diff --git a/menu.h b/menu.h
index 30c025d17f085c61ed3961a6ed28490dc7223d61..fcf2da4c28a6abb47855a82f212f9962b9abccf9 100644 (file)
--- a/menu.h
+++ b/menu.h
@@ -5,7 +5,6 @@
 #include "model.h"
 #include "world_render.h"
 #include "player.h"
-#include "conf.h"
 #include "shaders/model_menu.h"
 #include "audio.h"
 #include "input.h"
@@ -22,8 +21,8 @@ struct {
        page_depth;
 
    enum menu_input_mode{
-      k_menu_input_mode_mouse,
-      k_menu_input_mode_keys
+      k_menu_input_mode_keys,
+      k_menu_input_mode_mouse
    }
    input_mode;
    f32 mouse_track, mouse_dist;  /* used for waking up mouse */
@@ -207,13 +206,23 @@ static void menu_trigger_item( ent_menuitem *item )
       if( MDL_CONST_PSTREQ( &menu.model, q, "quit" ) ){
          vg.window_should_close = 1;
       }
-      else if( MDL_CONST_PSTREQ( &menu.model, q, "reset" ) ){
+      else if( MDL_CONST_PSTREQ( &menu.model, q, "reset_nearest" ) ){
          localplayer_cmd_respawn( 0, NULL );
          
          menu.page_depth = 0;
          menu.active = 0;
          menu.page = 0xffffffff;
       }
+      else if( MDL_CONST_PSTREQ( &menu.model, q, "reset_home" ) ){
+         world_static.active_world = 0;
+         world_static.active_trigger_volume_count = 0;
+         localplayer.viewable_world = world_current_instance();
+         localplayer_cmd_respawn( 1, (const char *[]){"start"} );
+
+         menu.page_depth = 0;
+         menu.active = 0;
+         menu.page = 0xffffffff;
+      }
       else if( MDL_CONST_PSTREQ( &menu.model, q, "credits" ) ){
          menu.credits_open = 1;
       }
@@ -521,7 +530,8 @@ VG_STATIC void menu_render(void)
    shader_blitcolour_uColour( colour );
    render_fsquad();
 
-   if( workshop_form.page != k_workshop_form_hidden ){
+   if( (workshop_form.page != k_workshop_form_hidden) ||
+       (vg_ui.focused_control_type != k_ui_control_none) ){
       return;
    }