diff --git a/includes/interface.h b/includes/interface.h index f4acf9e39..7ed4f8c48 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -197,7 +197,7 @@ void ui_richtext_settext(char *text, ui_richtext *ed); void ui_richtext_process(int mx, int my, int mb, int mbq, ui_richtext *ed); -void draw_svf_ui(pixel *vid_buf); +void draw_svf_ui(pixel *vid_buf, int alternate); void error_ui(pixel *vid_buf, int err, char *txt); diff --git a/src/interface.c b/src/interface.c index 9f3414424..8aaa111db 100644 --- a/src/interface.c +++ b/src/interface.c @@ -617,13 +617,19 @@ void ui_richtext_process(int mx, int my, int mb, int mbq, ui_richtext *ed) } } -void draw_svf_ui(pixel *vid_buf)// all the buttons at the bottom +void draw_svf_ui(pixel *vid_buf, int alternate)// all the buttons at the bottom { int c; //the open browser button - drawtext(vid_buf, 4, YRES+(MENUSIZE-14), "\x81", 255, 255, 255, 255); - drawrect(vid_buf, 1, YRES+(MENUSIZE-16), 16, 14, 255, 255, 255, 255); + if(alternate) + { + fillrect(vid_buf, 0, YRES+(MENUSIZE-16)-1, 18, 16, 255, 255, 255, 255); + drawtext(vid_buf, 4, YRES+(MENUSIZE-14), "\x81", 0, 0, 0, 255); + } else { + drawtext(vid_buf, 4, YRES+(MENUSIZE-14), "\x81", 255, 255, 255, 255); + drawrect(vid_buf, 1, YRES+(MENUSIZE-16), 16, 14, 255, 255, 255, 255); + } // the reload button c = svf_open ? 255 : 128; @@ -631,15 +637,22 @@ void draw_svf_ui(pixel *vid_buf)// all the buttons at the bottom drawrect(vid_buf, 19, YRES+(MENUSIZE-16), 16, 14, c, c, c, 255); // the save sim button - c = svf_login ? 255 : 128; - drawtext(vid_buf, 40, YRES+(MENUSIZE-14), "\x82", c, c, c, 255); - if (svf_open) - drawtextmax(vid_buf, 58, YRES+(MENUSIZE-12), 125, svf_name, c, c, c, 255); - else - drawtext(vid_buf, 58, YRES+(MENUSIZE-12), "[untitled simulation]", c, c, c, 255); - drawrect(vid_buf, 37, YRES+(MENUSIZE-16), 150, 14, c, c, c, 255); - if (svf_open && svf_own) - drawdots(vid_buf, 55, YRES+(MENUSIZE-15), 12, c, c, c, 255); + if(alternate) + { + fillrect(vid_buf, 36, YRES+(MENUSIZE-16)-1, 152, 16, 255, 255, 255, 255); + drawtext(vid_buf, 40, YRES+(MENUSIZE-14), "\x82", 0, 0, 0, 255); + drawtext(vid_buf, 58, YRES+(MENUSIZE-12), "[save to disk]", 0, 0, 0, 255); + } else { + c = svf_login ? 255 : 128; + drawtext(vid_buf, 40, YRES+(MENUSIZE-14), "\x82", c, c, c, 255); + if (svf_open) + drawtextmax(vid_buf, 58, YRES+(MENUSIZE-12), 125, svf_name, c, c, c, 255); + else + drawtext(vid_buf, 58, YRES+(MENUSIZE-12), "[untitled simulation]", c, c, c, 255); + drawrect(vid_buf, 37, YRES+(MENUSIZE-16), 150, 14, c, c, c, 255); + if (svf_open && svf_own) + drawdots(vid_buf, 55, YRES+(MENUSIZE-15), 12, c, c, c, 255); + } c = (svf_login && svf_open) ? 255 : 128; @@ -700,7 +713,7 @@ void draw_svf_ui(pixel *vid_buf)// all the buttons at the bottom } else*/ { - drawtext(vid_buf, XRES-154+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xBD", 255, 255, 255, 255); //TODO: More suitable icon + drawtext(vid_buf, XRES-154+BARSIZE/*481*/, YRES+(MENUSIZE-13), "\xCF", 255, 255, 255, 255); drawrect(vid_buf, XRES-159+BARSIZE/*494*/, YRES+(MENUSIZE-16), 14, 14, 255, 255, 255, 255); } diff --git a/src/main.c b/src/main.c index ea32d3ab8..34255ddbe 100644 --- a/src/main.c +++ b/src/main.c @@ -1851,7 +1851,7 @@ int main(int argc, char *argv[]) memset(vid_buf+((XRES+BARSIZE)*YRES), 0, (PIXELSIZE*(XRES+BARSIZE))*MENUSIZE);//clear menu areas clearrect(vid_buf, XRES-1, 0, BARSIZE+1, YRES); - draw_svf_ui(vid_buf); + draw_svf_ui(vid_buf, sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)); if (http_ver_check) { @@ -2663,13 +2663,22 @@ int main(int argc, char *argv[]) if (da < 51) da ++; } - else if (x>=37*sdl_scale && x<=187*sdl_scale && svf_login) + else if (x>=37*sdl_scale && x<=187*sdl_scale) { - db = 259; - if (svf_open && svf_own && x<=55*sdl_scale) - db = 258; - if (da < 51) - da ++; + if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) + { + db = 277; + if (da < 51) + da ++; + } + else if(svf_login) + { + db = 259; + if (svf_open && svf_own && x<=55*sdl_scale) + db = 258; + if (da < 51) + da ++; + } } else if (x>=((XRES+BARSIZE-(510-385))*sdl_scale) && x<=((XRES+BARSIZE-(510-476))*sdl_scale)) { @@ -2687,7 +2696,10 @@ int main(int argc, char *argv[]) } else if (x>=sdl_scale && x<=17*sdl_scale) { - db = 262; + if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) + db = 276; + else + db = 262; if (da < 51) da ++; } @@ -2879,32 +2891,45 @@ int main(int argc, char *argv[]) http_session_check = NULL; } } - if (x>=37 && x<=187 && svf_login) + if(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)) { - if (!svf_open || !svf_own || x>51) + if (x>=37 && x<=187) { - if (save_name_ui(vid_buf)) { - execute_save(vid_buf); - if (svf_id[0]) { - copytext_ui(vid_buf, "Save ID", "Saved successfully!", svf_id); + save_filename_ui(vid_buf); + + } + if (x>=1 && x<=17) + { + catalogue_ui(vid_buf); + } + } else { + if (x>=37 && x<=187 && svf_login) + { + if (!svf_open || !svf_own || x>51) + { + if (save_name_ui(vid_buf)) { + execute_save(vid_buf); + if (svf_id[0]) { + copytext_ui(vid_buf, "Save ID", "Saved successfully!", svf_id); + } } } + else + execute_save(vid_buf); + while (!sdl_poll()) + if (!SDL_GetMouseState(&x, &y)) + break; + b = bq = 0; + } + if (x>=1 && x<=17) + { + search_ui(vid_buf); + memset(fire_bg, 0, XRES*YRES*PIXELSIZE); + memset(pers_bg, 0, (XRES+BARSIZE)*YRES*PIXELSIZE); + memset(fire_r, 0, sizeof(fire_r)); + memset(fire_g, 0, sizeof(fire_g)); + memset(fire_b, 0, sizeof(fire_b)); } - else - execute_save(vid_buf); - while (!sdl_poll()) - if (!SDL_GetMouseState(&x, &y)) - break; - b = bq = 0; - } - if (x>=1 && x<=17) - { - search_ui(vid_buf); - memset(fire_bg, 0, XRES*YRES*PIXELSIZE); - memset(pers_bg, 0, (XRES+BARSIZE)*YRES*PIXELSIZE); - memset(fire_r, 0, sizeof(fire_r)); - memset(fire_g, 0, sizeof(fire_g)); - memset(fire_b, 0, sizeof(fire_b)); } if (x>=19 && x<=35 && svf_last && svf_open && !bq) { //int tpval = sys_pause; @@ -3214,6 +3239,12 @@ int main(int argc, char *argv[]) case 275: drawtext(vid_buf, 16, YRES-24, "You cannot vote on your own save.", 255, 255, 255, da*5); break; + case 276: + drawtext(vid_buf, 16, YRES-24, "Open a simulation from your hard drive.", 255, 255, 255, da*5); + break; + case 277: + drawtext(vid_buf, 16, YRES-24, "Save the simulation to your hard drive.", 255, 255, 255, da*5); + break; default: drawtext(vid_buf, 16, YRES-24, (char *)ptypes[db].descs, 255, 255, 255, da*5); }