How would I go about creating a GUI for a menu that would be like the old-school AGI games (Police Quest, Gold Rush, King's Quest, etc.) whereby pressing Escape would trigger a menu at the top with menu options (in the case of Gold Rush, they were Sierra | File | Action | Special | Speed) and then the arrow keys left-to-right would trigger sub-menus (About Gold Rush! | Help, Save | Restore | Restart | Quit | Inventory | Elapsed Time, etc.), which could be cycled through by pressing the arrow keys up and down?
I feel like this is probably just something that AGS isn't really equipped to do (since the GUI is basically mouse-based), but I thought I would ask. My game doesn't use a mouse at all and suddenly having it come in for those sorts of operations is a bit weird. At the moment I'm just using the text parser for those sorts of commands ("Save game", "Restart game", etc.) and having a list of them displayed when you press ESC or F1, but I find this to be a bit silly.
Any thoughts or suggestions for a mouse-less menu-like GUI, or a mouse-less GUI for these sorts of "game" functions in general?
You know, after I posted this I started playing around and I realized you COULD do it basically how I wanted, using a status-bar-like GUI at the top and a GUI with a list control on it that would steal focus (popup modal) and then use the arrow keys (and hitting left and right would cause it to move and repopulate with list options).
It's a bit more coding than I'm willing to do at this point in the project but it's definitely do-able. In the meantime I created just a little GUI with a listbox on it that pops up in the center of the screen with a few simple options on it when you hit Escape. Easy enough, it turns out. What a doofus I was for thinking that AGS couldn't be made to do this sort of thing!
Easily.
Use the on_key_pressed function, then simply do stuff like
function on_key_pressed (int key) {
if (IsGUIOn (TOPBAR)) {
if (key == 27) GUIOff (TOPBAR); // escape
if (key == UP) {
SetLabelColor (selected, BLACK);
if (selected > 0) selected --;
SetLabelColor (selected, WHITE);
}
if (key == 13) { // enter
if (selected == 1) SaveGameDialog ();
if (selected == 2) RestoreGameDialog ();
// et cetera
}
// et cetera
} else {
if (key == 27) GUIOn (TOPBAR);
}
}
I programmed my game so that every GUI can be operated with the arrow keys, esc and return button. It was done pretty much the way Radiant said, although my "selected" scheme was different. So, it's completely doable. It's just time consuming. I spent about two weeks to get it done.