Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Prevent Esc key closing dialog

  1. #1
    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).

    Example: Screenshot


    Long discussion for a simple question...

  2. #2
    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.

  3. #3
    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.

    Regards,
    zap

  4. #4
    disableuserinput
    --Ben

  5. #5
    disableUserInput will block mouseclicks, too.

  6. #6
    yes ... disableuserinput won't do it ..

    it's kind of tricky in this case.

  7. #7
    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.




  8. #8
    Gunnery Sergeant Dr_Eyeball's Avatar
    Join Date
    Dec 17 2005
    Location
    Australia
    Posts
    594
    Author of the Thread
    Quote Originally Posted by (CrashDome @ Aug. 25 2007,02:18)
    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.

    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.

  9. #9
    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

    regards,
    zap




  10. #10
    Why not make the pop-up dialogue part of the main dialogue and use ctrlshow to pop it up when you need it.
    --Ben

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •