Change cursor key up and down behaviour in watching-menu.
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@566 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
69ae1ebaeb
commit
3f50414639
|
@ -671,6 +671,7 @@ inprogressmenu (int gameid)
|
||||||
drawbanner (&banner, 1, 1);
|
drawbanner (&banner, 1, 1);
|
||||||
|
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
|
if (offset < 0) offset = 0;
|
||||||
mvaddstr (3, 1, "The following games are in progress:");
|
mvaddstr (3, 1, "The following games are in progress:");
|
||||||
|
|
||||||
for (di = 0; di < ARRAY_SIZE(watchcols); di++) {
|
for (di = 0; di < ARRAY_SIZE(watchcols); di++) {
|
||||||
|
@ -762,16 +763,18 @@ inprogressmenu (int gameid)
|
||||||
switch ((menuchoice = dgl_getch ()))
|
switch ((menuchoice = dgl_getch ()))
|
||||||
{
|
{
|
||||||
case KEY_DOWN:
|
case KEY_DOWN:
|
||||||
if (selected != -1) {
|
|
||||||
selected++;
|
selected++;
|
||||||
if (selected >= len) selected = 0;
|
if (selected >= len) selected = 0;
|
||||||
}
|
while (selected < offset) offset -= max_height;
|
||||||
|
while (selected >= offset+max_height) offset += max_height;
|
||||||
break;
|
break;
|
||||||
case KEY_UP:
|
case KEY_UP:
|
||||||
if (selected != -1) {
|
if (selected != -1) {
|
||||||
if (selected == 0) selected = len;
|
if (selected == 0) selected = len;
|
||||||
selected--;
|
selected--;
|
||||||
}
|
} else selected = len-1;
|
||||||
|
while (selected < offset) offset -= max_height;
|
||||||
|
while (selected >= offset+max_height) offset += max_height;
|
||||||
break;
|
break;
|
||||||
case '*':
|
case '*':
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
|
|
Loading…
Reference in New Issue