diff options
| author | Cracker64 <cracker642@gmail.com> | 2010-11-28 21:58:57 (GMT) |
|---|---|---|
| committer | Cracker64 <cracker642@gmail.com> | 2010-11-28 21:58:57 (GMT) |
| commit | 77a17ecaeedb2e7e505527848e8bf4d1465ac529 (patch) | |
| tree | e56137a0ce7518c41b7188c532ec92a86e55c3ad /src/interface.c | |
| parent | 3b4caf409dd6894650de0c4e2c806bcf59a806e1 (diff) | |
| download | powder-77a17ecaeedb2e7e505527848e8bf4d1465ac529.zip powder-77a17ecaeedb2e7e505527848e8bf4d1465ac529.tar.gz | |
VINE, plant grows up the side of WOOD. INST wire is now also a battery and will charge if it doesn't give off a spark right away. Will give spark to NSCN or SWCH that is on. found some more wall defines i missed. moved wall code up 100 numbers. INVS, solid that turns invisible to elements when under pressure.
Diffstat (limited to 'src/interface.c')
| -rw-r--r-- | src/interface.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/interface.c b/src/interface.c index 6df2ae5..a4ecc8f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1646,9 +1646,9 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { drawtext(vid_buf, XRES-textwidth((char *)msections[i].name)-BARSIZE, sy-10, (char *)msections[i].name, 255, 255, 255, 255); } - else if(i==SC_WALL||(i==SC_SPECIAL&&h>=122)) + else if(i==SC_WALL||(i==SC_SPECIAL&&h>=UI_WALLSTART)) { - drawtext(vid_buf, XRES-textwidth((char *)mwalls[h-122].descs)-BARSIZE, sy-10, (char *)mwalls[h-122].descs, 255, 255, 255, 255); + drawtext(vid_buf, XRES-textwidth((char *)mwalls[h-UI_WALLSTART].descs)-BARSIZE, sy-10, (char *)mwalls[h-UI_WALLSTART].descs, 255, 255, 255, 255); } else { @@ -2756,15 +2756,16 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) //Draw the score bars if(info->voteup>0||info->votedown>0) { - lv = (info->voteup>info->votedown?info->voteup:info->votedown); - + lv = (info->voteup>info->votedown)?info->voteup:info->votedown; + lv = (lv>10)?lv:10; + if(50>lv) { ry = ((float)(50)/(float)lv); - if(lv<8) - { - ry = ry/(8-lv); - } + //if(lv<8) + //{ + // ry = ry/(8-lv); + //} nyu = info->voteup*ry; nyd = info->votedown*ry; } @@ -2774,11 +2775,13 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) nyu = info->voteup/ry; nyd = info->votedown/ry; } + nyu = nyu>50?50:nyu; + nyd = nyd>50?50:nyd; - fillrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+53, 54, 6, 0, 107, 10, 255); - fillrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+59, 54, 6, 107, 10, 0, 255); - drawrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+53, 54, 6, 128, 128, 128, 255); - drawrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+59, 54, 6, 128, 128, 128, 255); + fillrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+53, 52, 6, 0, 107, 10, 255); + fillrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+59, 52, 6, 107, 10, 0, 255); + drawrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+53, 52, 6, 128, 128, 128, 255); + drawrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+59, 52, 6, 128, 128, 128, 255); fillrect(vid_buf, 48+(XRES/2)-nyu, (YRES/2)+54, nyu, 4, 57, 187, 57, 255); fillrect(vid_buf, 48+(XRES/2)-nyd, (YRES/2)+60, nyd, 4, 187, 57, 57, 255); @@ -2790,7 +2793,9 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) ccy += 12; ccy += drawtextwrap(vid_buf, 60+(XRES/2)+1, ccy+60, XRES+BARSIZE-100-((XRES/2)+1)-20, info->comments[cc], 255, 255, 255, 185); ccy += 10; - draw_line(vid_buf, 50+(XRES/2)+2, ccy+52, XRES+BARSIZE-50, ccy+52, 100, 100, 100, XRES+BARSIZE); + if(ccy+52<YRES+MENUSIZE){ //Try not to draw off the screen. + draw_line(vid_buf, 50+(XRES/2)+2, ccy+52, XRES+BARSIZE-50, ccy+52, 100, 100, 100, XRES+BARSIZE); + } } hasdrawninfo = 1; myown = svf_login && !strcmp(info->author, svf_user); @@ -2917,8 +2922,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) execute_submit(vid_buf, save_id, ed.str); } } - - if(!(mx>50 && my>50 && mx<XRES+BARSIZE-50 && my<XRES+MENUSIZE-50) && b && !queue_open){ + if(!(mx>50 && my>50 && mx<XRES+BARSIZE-100 && my<YRES+MENUSIZE-100) && b && !queue_open){ retval = 0; break; } @@ -2971,7 +2975,9 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) drawtext(vid_buf, 50+(XRES/4)-textwidth("Loading...")/2, 50+(YRES/4), "Loading...", 255, 255, 255, 128); } } - + if(!info_ready || !data_ready){ + info_box(vid_buf, "Loading"); + } sdl_blit(0, 0, (XRES+BARSIZE), YRES+MENUSIZE, vid_buf, (XRES+BARSIZE)); memcpy(vid_buf, old_vid, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); if(info_ready && svf_login){ |
