Thread Tools Display Modes
12-28-06, 08:37 PM   #1
Wintry
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 28
Full-screen dialogs

I'm making a mod which makes use of a full-screen dialog - but there's a slight problem. It seems that any button presses still flow down in to the rest of the game, for example the return key will still open the chat message box, despite a full screen frame on top of it (although it's overlapped, but keyboard focus still goes there).

Is there a way to temporarily disable all key bindings? Also, is there a way to make the escape key close the dialog? (The overall behaviour I'm after is as if you'd opened the world map, for example).

Thanks in advance,
Wintry.
  Reply With Quote
12-28-06, 09:09 PM   #2
tenmiles
A Deviate Faerie Dragon
Join Date: Sep 2006
Posts: 16
Originally Posted by Wintry
Also, is there a way to make the escape key close the dialog?
I'm a complete idiot when it comes to writing mods and what I say now may be complete jibberish, but I seem to recall something about inheriting something from the parent frame and adopting traits or something. Since the mother of all frames does what you want already you might be able to make your frame a child of that, or something, maybe nothing. If you're confused ignore this post.
  Reply With Quote
12-28-06, 09:39 PM   #3
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
No easy way to disable all keybindings, could try something like: (psuedocode)
Code:
function saveBindings()
for k,button in pairs(table of all usable buttons including modifiers) do
    action = GetBindingAction(button)
    if (action) then myTableHoldingAllActions[button] = action end
end
function restoreBindings()
for button,action in pairs(myTableHoldingAllActions) do
    SetBinding(button,action)
end
http://www.wowwiki.com/World_of_Warc...ding_Functions might be useful

Make frame closable with escape key: http://www.wowwiki.com/HOWTO:_Make_F...the_ESCape_Key
  Reply With Quote
12-28-06, 11:44 PM   #4
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
No need to change keybindings or anything... just make your frame grab the keyboard input... when it gets hidden, it'll automatically release it. I think in XML you set its enableKeyboard attribute to true. In lua, you'd do myFrame:EnableKeyboard(true).
  Reply With Quote
12-29-06, 04:22 AM   #5
Wintry
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 28
Originally Posted by Cogwheel
No need to change keybindings or anything... just make your frame grab the keyboard input... when it gets hidden, it'll automatically release it. I think in XML you set its enableKeyboard attribute to true. In lua, you'd do myFrame:EnableKeyboard(true).
I've tried setting that in XML, but it seemed to have no effect at all. I'll try it in LUA and see how it turns out.
  Reply With Quote
12-29-06, 07:30 AM   #6
Wintry
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 28
Nope, still no luck.
  Reply With Quote
12-29-06, 09:55 AM   #7
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
maybe setfocus to the frame?
  Reply With Quote
12-29-06, 12:39 PM   #8
Cogwheel
Sans Poisson
 
Cogwheel's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 237
You may also need to define an OnChar and/or an OnKeyDown handler...
  Reply With Quote
12-31-06, 01:05 PM   #9
Wintry
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 28
Originally Posted by Cogwheel
You may also need to define an OnChar and/or an OnKeyDown handler...
Hmm... that's a good point, I'll try that also. Thanks for the help
  Reply With Quote
12-31-06, 01:11 PM   #10
Wintry
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 28
Yup, adding a blank OnKeyDown handler worked, thanks loads!
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Full-screen dialogs


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off