Update spawn map to new UI
[carveJwlIkooP6JGAAIwe30JlM.git] / gui.h
diff --git a/gui.h b/gui.h
index c60c51be00b975e6f001509b3bb01b8faf4f6f9f..c1ce8d71a41ea81120b6c0767e56664c41a10441 100644 (file)
--- a/gui.h
+++ b/gui.h
@@ -4,6 +4,12 @@
 #include "player.h"
 #include "vg/vg_imgui.h"
 
+#define GUI_COL_DARK   ui_opacity( 0x00000000, 0.7f )
+#define GUI_COL_NORM   ui_opacity( 0x00101010, 0.7f )
+#define GUI_COL_ACTIVE ui_opacity( 0x00444444, 0.7f )
+#define GUI_COL_CLICK  ui_opacity( 0x00858585, 0.7f )
+#define GUI_COL_HI     ui_opacity( 0x00ffffff, 0.8f )
+
 enum gui_icon {
    k_gui_icon_tick    = 0,
    k_gui_icon_tick_2d,
@@ -19,6 +25,8 @@ enum gui_icon {
    k_gui_icon_rift_run_gold,
    k_gui_icon_rift_run_silver,
    k_gui_icon_glider,
+   k_gui_icon_spawn,
+   k_gui_icon_spawn_select,
 
    k_gui_icon_count,
 };
@@ -42,7 +50,7 @@ struct{
       v4f colour;
       int colour_changed;
    }
-   icon_draw_buffer[32];
+   icon_draw_buffer[64];
    u32 icon_draw_count;
    v4f cur_icon_colour;
    int colour_changed;
@@ -147,11 +155,6 @@ static void gui_draw(void)
    ui_px height = vg_ui.font->ch + 16;
    ui_rect lwr = { 0, vg.window_y - height, vg.window_x, height };
 
-   if( gui.factive > 0.01f )
-   {
-      //ui_fill( lwr, ui_opacity( 0xff000000, gui.factive*0.8f ) );
-   }
-
    ui_px x = 0;
    for( u32 i=0; i<gui.helper_count; i++ )
    {
@@ -172,7 +175,7 @@ static void gui_draw(void)
          opacity = 0.1f;
       }
 
-      struct ui_vert *bg = ui_fill( box, ui_opacity( 0x00000000, opacity ) );
+      struct ui_vert *bg = ui_fill( box, ui_opacity( GUI_COL_DARK, opacity ) );
 
       u32 w;
       box[0] += 16;
@@ -183,7 +186,7 @@ static void gui_draw(void)
       x += w + 32;
 
       box[0] = x;
-      bg = ui_fill( box, ui_opacity( 0x00101010, opacity*0.7f ) );
+      bg = ui_fill( box, ui_opacity( GUI_COL_NORM, opacity*0.7f ) );
       box[0] += 8;
       w = ui_text( box, helper->text, 1, k_ui_align_middle_left, fg );
       w *= vg_ui.font->sx;
@@ -204,7 +207,7 @@ static void gui_draw(void)
           o = 1.0f-t*t*(2.0f-t);
 
       ui_rect box = { 0, (vg.window_y*2)/3 - height/2, vg.window_x, height };
-      ui_fill( box, ui_opacity( 0x00101010, 0.5f ) );
+      ui_fill( box, ui_opacity( GUI_COL_NORM, 0.5f ) );
       ui_text( box, gui.location, 1, k_ui_align_middle_center, 0 );
 
       vg_ui.colour[3] = o;
@@ -327,6 +330,8 @@ static void gui_init(void){
    gui.icons[ k_gui_icon_friend ] = gui_find_icon( "icon_friend" );
    gui.icons[ k_gui_icon_player ] = gui_find_icon( "icon_player" );
    gui.icons[ k_gui_icon_glider ] = gui_find_icon( "icon_glider" );
+   gui.icons[ k_gui_icon_spawn ] = gui_find_icon( "icon_spawn" );
+   gui.icons[ k_gui_icon_spawn_select ] = gui_find_icon( "icon_spawn_select" );
    gui.icons[ k_gui_icon_rift_run_gold ] =
       gui_find_icon("icon_rift_run_medal_gold");
    gui.icons[ k_gui_icon_rift_run_silver]=