In this latest version, opting to restart or quit brings up a "Are you sure?" prompt just as it is in-game. My thinking is that, hey, even though it's the end of the game, we still want to make sure the player really wants to stop the party before we let him.
Of course, some of the appeal is that while the original version of ProcessKey rehashed a lot of the code from DoRestart, DoUndo, and DoQuit (with the exception of the prompt text, of course), the new version is really simple and looks like this:
replace ProcessKey(entry,end_type)
{
local r
if not entry
return -1
select entryThe bonus of this is, if your game does anything special with any of these routines, ProcessKey automatically inherits the (hopefully) wanted behavior.
case "restart", "r" : r = &DoRestart
case "restore", "e" : r = &DoRestore
#ifclear NO_UNDO
case "undo", "u" : r = &DoUndo
#endif
case SpecialKey(end_type) : r = &SpecialRoutine
case "quit", "q" : r = &DoQuit
if not (call r) : return -1 : else : return true
}
Anyhow, for now, I think I'm only going to keep this code in my "undolib.h" library extension because I can see how the new behavior might be controversial. If a couple other people like it (I figure 2 other people is almost a Hugo-users-majority), I'll probably end up adding it to roodylib.