summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-07-09 17:22:25 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-07-09 17:22:25 (GMT)
commitd42e06f37a93475a09cd2908849b2f33a50513ac (patch)
tree3bb435ec3648d897a821cf99ff2469277da51791 /src/interface.c
parentd2eb6f1cb31f2d746d5897e775424ed0d1448703 (diff)
downloadpowder-d42e06f37a93475a09cd2908849b2f33a50513ac.zip
powder-d42e06f37a93475a09cd2908849b2f33a50513ac.tar.gz
Merge all GOL types into PT_LIFE, behaviour is determined by ctype
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/interface.c b/src/interface.c
index 002d4c5..923a8d0 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -87,6 +87,7 @@ int drawgrav_enable = 0;
void menu_count(void)//puts the number of elements in each section into .itemcount
{
int i=0;
+ msections[SC_LIFE].itemcount = NGOLALT;
msections[SC_WALL].itemcount = UI_WALLCOUNT-4;
msections[SC_SPECIAL].itemcount = 4;
for (i=0; i<PT_NUM; i++)
@@ -2013,6 +2014,41 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq
}
}
}
+ else if(i==SC_LIFE)
+ {
+ int n2;
+ if (fwidth > XRES-BARSIZE) { //fancy scrolling
+ float overflow = fwidth-(XRES-BARSIZE), location = ((float)XRES-BARSIZE)/((float)(mx-(XRES-BARSIZE)));
+ xoff = (int)(overflow / location);
+ }
+ for (n2 = 0; n2<NGOLALT; n2++)
+ {
+ n = PT_LIFE | (n2<<8);
+ x -= draw_tool_xy(vid_buf, x-xoff, y, n, gmenu[n2].colour)+5;
+ if (!bq && mx>=x+32-xoff && mx<x+58-xoff && my>=y && my< y+15)
+ {
+ drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 255, 55, 55, 255);
+ h = n;
+ }
+ if (!bq && mx>=x+32-xoff && mx<x+58-xoff && my>=y && my< y+15&&(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT)))
+ {
+ drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 0, 255, 255, 255);
+ h = n;
+ }
+ else if (n==SLALT)
+ {
+ drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 0, 255, 255, 255);
+ }
+ else if (n==*sl)
+ {
+ drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 255, 55, 55, 255);
+ }
+ else if (n==*sr)
+ {
+ drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 55, 55, 255, 255);
+ }
+ }
+ }
else //all other menus
{
if (fwidth > XRES-BARSIZE) { //fancy scrolling
@@ -2062,6 +2098,10 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq
{
drawtext(vid_buf, XRES-textwidth((char *)wtypes[h-UI_WALLSTART].descs)-BARSIZE, sy-10, (char *)wtypes[h-UI_WALLSTART].descs, 255, 255, 255, 255);
}
+ else if (i==SC_LIFE)
+ {
+ drawtext(vid_buf, XRES-textwidth((char *)gmenu[(h>>8)&0xFF].description)-BARSIZE, sy-10, (char *)gmenu[(h>>8)&0xFF].description, 255, 255, 255, 255);
+ }
else
{
drawtext(vid_buf, XRES-textwidth((char *)ptypes[h].descs)-BARSIZE, sy-10, (char *)ptypes[h].descs, 255, 255, 255, 255);