diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-25 10:31:21 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-25 10:31:21 (GMT) |
| commit | 07a1f21df484a252d54c82262ade6d4117425694 (patch) | |
| tree | 80df86661553807159f7fda3fbf2506d5df3b5fa /src/interface.c | |
| parent | f01056ee0249ad01ed24824aea39f05083110cd6 (diff) | |
| parent | f8d54e66dba5d8448d30f61f84883b4e7e6e1087 (diff) | |
| download | powder-07a1f21df484a252d54c82262ade6d4117425694.zip powder-07a1f21df484a252d54c82262ade6d4117425694.tar.gz | |
Merge latest with graphicstest
Diffstat (limited to 'src/interface.c')
| -rw-r--r-- | src/interface.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/src/interface.c b/src/interface.c index 6ce057b..229ec88 100644 --- a/src/interface.c +++ b/src/interface.c @@ -2416,6 +2416,53 @@ int color_menu_ui(pixel *vid_buf, int i, int *cr, int *cg, int *cb, int b, int b return 0; } +int quickoptions_tooltip_fade = 0; +char * quickoptions_tooltip; +int quickoptions_tooltip_y = 0; +void quickoptions_menu(pixel *vid_buf, int b, int bq, int x, int y) +{ + int i = 0; + x /= sdl_scale; + y /= sdl_scale; + if(quickoptions_tooltip_fade && quickoptions_tooltip) + { + drawtext_outline(vid_buf, (XRES - 5) - textwidth(quickoptions_tooltip), quickoptions_tooltip_y, quickoptions_tooltip, 255, 255, 255, quickoptions_tooltip_fade*20, 0, 0, 0, quickoptions_tooltip_fade*15); + quickoptions_tooltip_fade--; + } + while(quickmenu[i].icon!=NULL) + { + if(quickmenu[i].type == QM_TOGGLE) + { + drawrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+1, 14, 14, 255, 255, 255, 255); + if(*(quickmenu[i].variable)) + { + fillrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+1, 14, 14, 255, 255, 255, 255); + drawtext(vid_buf, (XRES+BARSIZE)-11, (i*16)+5, quickmenu[i].icon, 0, 0, 0, 255); + } + else + { + fillrect(vid_buf, (XRES+BARSIZE)-16, (i*16)+1, 14, 14, 0, 0, 0, 255); + drawtext(vid_buf, (XRES+BARSIZE)-11, (i*16)+5, quickmenu[i].icon, 255, 255, 255, 255); + } + if(x >= (XRES+BARSIZE)-16 && x <= (XRES+BARSIZE)-2 && y >= (i*16)+1 && y <= (i*16)+15) + { + quickoptions_tooltip_fade+=2; + quickoptions_tooltip = quickmenu[i].name; + quickoptions_tooltip_y = (i*16)+5; + if(b && !bq) + { + *(quickmenu[i].variable) = !(*(quickmenu[i].variable)); + } + } + } + i++; + } + if(quickoptions_tooltip_fade > 12) + quickoptions_tooltip_fade = 12; + if(quickoptions_tooltip_fade < 0) + quickoptions_tooltip_fade = 0; +} + int sdl_poll(void) { SDL_Event event; @@ -2604,7 +2651,6 @@ void set_cmode(int cm) // sets to given view mode } else if (cmode==CM_PERS) { - memset(fire_bg, 0, XRES*YRES*PIXELSIZE); memset(pers_bg, 0, (XRES+BARSIZE)*YRES*PIXELSIZE); strcpy(itc_msg, "Persistent Display"); } |
