Looking for advice on how to prevent the Escape key from closing a dialog.
Possible solutions: I'm guessing it would somehow be done via User_Interface_Event_Handlers, which are easy enough, but I still don't know how to prevent the closure.
Perhaps it's controlled via a return value in one of the functions or EH's?
Situation: After having no success from this child dialogs discussion, I have resorted to combining 2 dialogs into 1. I have nested a popup menu dialog into another commander dialog and the instinct is to press Esc to close the menu, but that will close the commander dialog too. Instead I want to close dialogs only via a ["X"] close icon in the window/menu title bar (or some other controlled manner).
Long discussion for a simple question...
You cant avoid the dialog being closed if Esc was pressed I would say. But you can re-create the dialog as soon as the dialog was closed and the user wont notice that. You should use the onUnload eventhandler to save the current selected item in the listbox and to start the dialog again.
i use a simple spawned loop, checking for dialog=true...
as become false, it will throw a "Don't ESC Dialog" Message and fire the startdialog-function again...
as you use a framework, hmmm ... the only way i can suggest is that your framework keeps current state in a global variable, and needs a capability to restore settings from it ... so on close you can restore last saved settings & lbcursel and focuses ...
kind of additional work, but offers a good debugging capability, too.
disableUserInput will block mouseclicks, too.
yes ... disableuserinput won't do it ..
it's kind of tricky in this case.
Disabling the ESC key would suck for a player. How am I supposed to exit the game should I want to? I wouldn't use ANY dialog that didn't let me ESC.
Why do you need to disable it? So you can force them to click many X's? If ESC closes everything, I say let the player learn the hard way NOT to hit ESC if they don't mean to.
Read the entire first post, before replying. Nobody is trying to disable Esc key solely for the purpose of preventing closing dialogs.
Originally Posted by (CrashDome @ Aug. 25 2007,02:18)
When 2 dialogs are nested into 1, you sometimes want to detect that Esc has been pressed in order to close your sub-dialog and leave the pseudo parent dialog open. Is that so unreasonable? You then press Esc again to close the pseudo parent dialog.
agree with dr. eyeball ... esc will you lead through opened dialog layers until you reach the arma hardcoded layer... the simple esc~respawn dialogue...
the whatabout is, what happenz as the "map-engine" dialog was escaped ... that means current dialog 0 (+x)
@Eyeball ... did you find a solution??
@CrashDome ... howto create rounded corners
Why not make the pop-up dialogue part of the main dialogue and use ctrlshow to pop it up when you need it.