mirror of
https://github.com/paxed/dgamelaunch.git
synced 2025-07-29 08:35:00 +02:00
Selecting a game to watch with an uppercase letter attempts to change the
window size to the game's via the \033[8;<r>;<c>t sequence. Block SIGWINCH before sending this sequence and unblock it after calling initcurses() again. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@267 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
0f2d2bf60f
commit
9beae9e40d
@ -5,6 +5,9 @@
|
|||||||
clients and force them to 80x24.
|
clients and force them to 80x24.
|
||||||
* Pass window size to watchers via inprogress file; show it on the
|
* Pass window size to watchers via inprogress file; show it on the
|
||||||
list.
|
list.
|
||||||
|
* Selecting a game to watch with an uppercase letter attempts to
|
||||||
|
change the window size to the game's via the \033[8;<r>;<c>t
|
||||||
|
sequence.
|
||||||
|
|
||||||
1.4.3 (2004/02/28)
|
1.4.3 (2004/02/28)
|
||||||
* Make ttyplay use the 'strip' value it remembered from last view.
|
* Make ttyplay use the 'strip' value it remembered from last view.
|
||||||
|
@ -306,10 +306,11 @@ drawbanner (unsigned int start_line, unsigned int howmany)
|
|||||||
void
|
void
|
||||||
inprogressmenu ()
|
inprogressmenu ()
|
||||||
{
|
{
|
||||||
int i, menuchoice, len = 20, offset = 0;
|
int i, menuchoice, len = 20, offset = 0, doresizewin = 0;
|
||||||
time_t ctime;
|
time_t ctime;
|
||||||
struct dg_game **games;
|
struct dg_game **games;
|
||||||
char ttyrecname[130], *replacestr = NULL;
|
char ttyrecname[130], *replacestr = NULL;
|
||||||
|
sigset_t oldmask, toblock;
|
||||||
|
|
||||||
games = populate_games (&len);
|
games = populate_games (&len);
|
||||||
|
|
||||||
@ -321,7 +322,7 @@ inprogressmenu ()
|
|||||||
"During playback, hit 'q' to return here, 'm' to send mail (requires login),");
|
"During playback, hit 'q' to return here, 'm' to send mail (requires login),");
|
||||||
mvaddstr (4, 1,
|
mvaddstr (4, 1,
|
||||||
"'s' to toggle graphic-set stripping for DEC, IBM, and none.");
|
"'s' to toggle graphic-set stripping for DEC, IBM, and none.");
|
||||||
mvaddstr (5, 1, "The following games are in progress:");
|
mvaddstr (5, 1, "The following games are in progress: (use uppercase to try to change size)");
|
||||||
|
|
||||||
/* clean old games and list good ones */
|
/* clean old games and list good ones */
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -345,7 +346,7 @@ inprogressmenu ()
|
|||||||
"Watch which game? (any key refreshes, 'q' quits, '>'/'<' for more/less) => ");
|
"Watch which game? (any key refreshes, 'q' quits, '>'/'<' for more/less) => ");
|
||||||
refresh ();
|
refresh ();
|
||||||
|
|
||||||
switch ((menuchoice = tolower (getch ())))
|
switch ((menuchoice = getch ()))
|
||||||
{
|
{
|
||||||
case '>':
|
case '>':
|
||||||
if ((offset + 14) >= len)
|
if ((offset + 14) >= len)
|
||||||
@ -361,11 +362,17 @@ inprogressmenu ()
|
|||||||
offset -= 14;
|
offset -= 14;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'q':
|
case 'q': case 'Q':
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ((menuchoice - 97) >= 0 && (menuchoice - 97) < i)
|
doresizewin = 0;
|
||||||
|
if (isupper (menuchoice))
|
||||||
|
{
|
||||||
|
doresizewin = 1;
|
||||||
|
menuchoice = tolower (menuchoice);
|
||||||
|
}
|
||||||
|
if ((menuchoice - 'a') >= 0 && (menuchoice - 'a') < i)
|
||||||
{
|
{
|
||||||
/* valid choice has been made */
|
/* valid choice has been made */
|
||||||
snprintf (ttyrecname, 130, "%sttyrec/%s", myconfig->dglroot,
|
snprintf (ttyrecname, 130, "%sttyrec/%s", myconfig->dglroot,
|
||||||
@ -383,8 +390,24 @@ inprogressmenu ()
|
|||||||
clear ();
|
clear ();
|
||||||
refresh ();
|
refresh ();
|
||||||
endwin ();
|
endwin ();
|
||||||
|
if (doresizewin)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Let curses deal with the resize later. Perhaps this is
|
||||||
|
* not the best way.
|
||||||
|
*/
|
||||||
|
sigemptyset (&toblock);
|
||||||
|
sigaddset (&toblock, SIGWINCH);
|
||||||
|
sigprocmask (SIG_BLOCK, &toblock, &oldmask);
|
||||||
|
printf ("\033[8;%d;%dt",
|
||||||
|
games[menuchoice - 97 + offset]->ws_row,
|
||||||
|
games[menuchoice - 97 + offset]->ws_col);
|
||||||
|
fflush (stdout);
|
||||||
|
}
|
||||||
ttyplay_main (ttyrecname, 1);
|
ttyplay_main (ttyrecname, 1);
|
||||||
initcurses ();
|
initcurses ();
|
||||||
|
if (doresizewin)
|
||||||
|
sigprocmask (SIG_SETMASK, &oldmask, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user