- "Create map link" screen is now scrollable with ,/./q/w keys
- Changed version to 1.7g
This commit is contained in:
parent
83b63fe1c7
commit
1325f8c3f7
|
@ -1,4 +1,4 @@
|
|||
#define VERSION "1.7f"
|
||||
#define VERSION "1.7g"
|
||||
|
||||
/* variable sizes */
|
||||
#define SMALLBUFLEN 64 /* small text buffer */
|
||||
|
|
40
netmapr.c
40
netmapr.c
|
@ -79,6 +79,8 @@ Uint8 defarrow = 0;
|
|||
int modified = FALSE;
|
||||
int readonly = FALSE;
|
||||
|
||||
int maplistpos = 0; /* scroll position in map list */
|
||||
|
||||
int copyfrom = -1;
|
||||
int copymap = -1;
|
||||
int copytype = T_MAP;
|
||||
|
@ -754,10 +756,10 @@ int main (int argc, char **argv) {
|
|||
setmod(TRUE);
|
||||
changestate(S_NONE);
|
||||
drawmap();
|
||||
} else if (pos <= (nummaps-1)) {
|
||||
} else if ((pos+maplistpos) <= (nummaps-1)) {
|
||||
if ((map[curmap].selecteditem != -1) && (map[curmap].selecteditemtype == T_OBJECT)) {
|
||||
if (pos != curmap) {
|
||||
map[curmap].obj[map[curmap].selecteditem].child = pos;
|
||||
if ((pos+maplistpos) != curmap) {
|
||||
map[curmap].obj[map[curmap].selecteditem].child = pos + maplistpos;
|
||||
sprintf(statustext, "Map link created.");
|
||||
strcpy(oldstatustext, statustext);
|
||||
setmod(TRUE);
|
||||
|
@ -1687,17 +1689,33 @@ int main (int argc, char **argv) {
|
|||
drawmap();
|
||||
}
|
||||
if ((c == ',') || (c == 'q')) { /* scroll object box up */
|
||||
if (state == S_CREATETELE) {
|
||||
scrollmaplist(-1);
|
||||
} else {
|
||||
scrollobox(-1);
|
||||
}
|
||||
}
|
||||
if ((c == '.') || (c == 'w')) { /* scroll object box down */
|
||||
if (state == S_CREATETELE) {
|
||||
scrollmaplist(1);
|
||||
} else {
|
||||
scrollobox(1);
|
||||
}
|
||||
}
|
||||
if ((c == '<') || (c == 'Q')) { /* scroll object box up */
|
||||
if (state == S_CREATETELE) {
|
||||
scrollmaplist(-20);
|
||||
} else {
|
||||
scrollobox(-OBOXPAGESIZE);
|
||||
}
|
||||
}
|
||||
if ((c == '>') || (c == 'W')) { /* scroll object box down */
|
||||
if (state == S_CREATETELE) {
|
||||
scrollmaplist(20);
|
||||
} else {
|
||||
scrollobox(OBOXPAGESIZE);
|
||||
}
|
||||
}
|
||||
if (c == 'x') {
|
||||
if (map[curmap].selecteditem != -1) {
|
||||
switch (map[curmap].selecteditemtype) {
|
||||
|
@ -4296,7 +4314,7 @@ void drawmaplist(SDL_Surface *dest) {
|
|||
|
||||
y += (DEFTEXTH*2);
|
||||
|
||||
for (i = 0; i < nummaps; i++) {
|
||||
for (i = maplistpos; i < nummaps; i++) {
|
||||
drawbox(dest, x, y, map[curmap].width-1,y+(DEFTEXTH*2),blue, NULL);
|
||||
drawtextat(dest, x+1, y+1, map[i].name, (DEFTEXTH*2)-2, blue);
|
||||
|
||||
|
@ -7343,6 +7361,20 @@ int savemap(void) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void scrollmaplist(int amt) {
|
||||
maplistpos += amt;
|
||||
|
||||
if (amt < 0) {
|
||||
if (maplistpos < 0) maplistpos = 0;
|
||||
} else if (amt > 0) {
|
||||
if (maplistpos >= nummaps) {
|
||||
maplistpos = nummaps - 1;
|
||||
}
|
||||
}
|
||||
|
||||
drawmaplist(screen);
|
||||
}
|
||||
|
||||
void scrollobox(int amt) {
|
||||
int fitx,fity,fit;
|
||||
|
||||
|
|
Loading…
Reference in New Issue