Thread Tools Display Modes
07/05/15, 04:04 PM   #1
Glen348
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 11
activate mouse cursor after dialog prompt?

how can i get the dialog window to activate the mouse cursor after confirming delete?
Lua Code:
  1. local confirmDeleteDialog = {
  2.     title = { text = GetString(SI_B1UI_DELETEBUTTON_TITLE)},
  3.     mainText = { text = GetString(SI_B1UI_DELETEBUTTON_MAINTEXT)},
  4.     buttons = {
  5.             [1]={
  6.                 text = GetString(SI_B1UI_YES_LABEL),
  7.                 callback = function()
  8.                     B1UI.DeletePage()
  9.                 end,
  10.                 },
  11.             [2]={
  12.                 text = GetString(SI_B1UI_NO_LABEL)
  13.                 }
  14.             }
  15. }
  Reply With Quote
07/06/15, 04:35 PM   #2
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Glen348 View Post
how can i get the dialog window to activate the mouse cursor after confirming delete?
Lua Code:
  1. local confirmDeleteDialog = {
  2.     title = { text = GetString(SI_B1UI_DELETEBUTTON_TITLE)},
  3.     mainText = { text = GetString(SI_B1UI_DELETEBUTTON_MAINTEXT)},
  4.     buttons = {
  5.             [1]={
  6.                 text = GetString(SI_B1UI_YES_LABEL),
  7.                 callback = function()
  8.                     B1UI.DeletePage()
  9.                 end,
  10.                 },
  11.             [2]={
  12.                 text = GetString(SI_B1UI_NO_LABEL)
  13.                 }
  14.             }
  15. }
I think this is what you mean? Use:
Lua Code:
  1. SetGameCameraUIMode(true)

Lua Code:
  1. local confirmDeleteDialog = {
  2.     title = { text = GetString(SI_B1UI_DELETEBUTTON_TITLE)},
  3.     mainText = { text = GetString(SI_B1UI_DELETEBUTTON_MAINTEXT)},
  4.     buttons = {
  5.             [1]={
  6.                 text = GetString(SI_B1UI_YES_LABEL),
  7.                 callback = function()
  8.                     B1UI.DeletePage()
  9.                     SetGameCameraUIMode(true)
  10.                 end,
  11.                 },
  12.             [2]={
  13.                 text = GetString(SI_B1UI_NO_LABEL)
  14.                 }
  15.             }
  16. }
  Reply With Quote
07/06/15, 04:56 PM   #3
Glen348
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 11
Originally Posted by circonian View Post
I think this is what you mean? Use:
Lua Code:
  1. SetGameCameraUIMode(true)

Lua Code:
  1. local confirmDeleteDialog = {
  2.     title = { text = GetString(SI_B1UI_DELETEBUTTON_TITLE)},
  3.     mainText = { text = GetString(SI_B1UI_DELETEBUTTON_MAINTEXT)},
  4.     buttons = {
  5.             [1]={
  6.                 text = GetString(SI_B1UI_YES_LABEL),
  7.                 callback = function()
  8.                     B1UI.DeletePage()
  9.                     SetGameCameraUIMode(true)
  10.                 end,
  11.                 },
  12.             [2]={
  13.                 text = GetString(SI_B1UI_NO_LABEL)
  14.                 }
  15.             }
  16. }

ive tried this and it does not seam to work

its my notebook addon if you want to help look over the full source.
  Reply With Quote
07/07/15, 12:42 PM   #4
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Glen348 View Post
ive tried this and it does not seam to work

its my notebook addon if you want to help look over the full source.
Oh, the code is running to fast and its setting the GameCameraUIMode to true, before the dialog box sets it to false when it finishes closing. The easiest way would be to just delay the call like this:
Lua Code:
  1. { text = GetString(SI_B1UI_YES_LABEL), callback = function()
  2.         B1UIDeletePage()    
  3.         zo_callLater(function() SetGameCameraUIMode(true) end, 10)    
  4.     end
  5. },

Or if, it looks like you need to do this in several places, you could just create a function to force the game to stay in mouse cursor mode.
Lua Code:
  1. local function CameraChanged()
  2.     if not IsPlayerActivated() then return end
  3.    
  4.     if FREE_MOUSE then
  5.         SetGameCameraUIMode(FREE_MOUSE)
  6.     end
  7. end
  8. EVENT_MANAGER:RegisterForEvent(ADDON_NAME, EVENT_GAME_CAMERA_DEACTIVATED, CameraChanged)
  9. EVENT_MANAGER:RegisterForEvent(ADDON_NAME, EVENT_GAME_CAMERA_UI_MODE_CHANGED, CameraChanged)
Then whenever they open your notebook set FREE_MOUSE = true and when they close it set it back to false. That will force the game to stay in mouse cursor mode although this would also prevent users from being able to hit the "." key to exit mouse cursor mode, so...actually that may not be a good idea.

It looks nice, good work!

Last edited by circonian : 07/07/15 at 12:49 PM.
  Reply With Quote
05/23/16, 03:11 AM   #5
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
I recently got some odd behavior when using SetGameCameraUIMode().

If you click on a control and then immediately call SetGameCameraUIMode(false) the action bar buttons and mouse buttons stop working. Only hiting [ESC] or [Enter] fixes the problem. Did i miss sth. or is it simply bugged?
  Reply With Quote
05/23/16, 05:22 AM   #6
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
I would perosnnaly avoid using this function and use the SCENE_MANAGER, it's a little bit complicated at the begenning but so bugless at the end ..
  Reply With Quote
05/23/16, 08:05 AM   #7
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
Now this thing is really nice! Thx for pointing me at it!

/edit: Ran into another set of problems when using ZO_SceneManager:ShowScene(obj scene)... It properly shows the scene but the .-key is deactivated now... I am afraid the user has to cope with having to activate the curser manually

Last edited by Letho : 05/23/16 at 09:14 AM.
  Reply With Quote
05/23/16, 06:25 PM   #8
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
I got exactly this behaviour after I answer a whsiper message. It's not always there but very often. The edit box still got focus bo no key is accepted anymore to switch back to another focus (even ESC is not working).
Pressing the RETURN key will just send the next messages and using other keys will just write a mesage in the whisper chat.

I have to ALT+TAB out of the game, or use the windows key, and get back into the game to be able to press some key again.

Didn't find out what addon is causing this so far... Maybe several addons in combination.
  Reply With Quote
05/24/16, 08:06 AM   #9
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
Originally Posted by Baertram View Post
I got exactly this behaviour after I answer a whsiper message. It's not always there but very often. The edit box still got focus bo no key is accepted anymore to switch back to another focus (even ESC is not working).
Pressing the RETURN key will just send the next messages and using other keys will just write a mesage in the whisper chat.

I have to ALT+TAB out of the game, or use the windows key, and get back into the game to be able to press some key again.

Didn't find out what addon is causing this so far... Maybe several addons in combination.
This sounds pretty nasty. Is the repro just to reply to a whisper?
  Reply With Quote
05/24/16, 08:31 AM   #10
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
Yep, it only happens if I try to answer to a whisper message.
I'm not using the keybind to answer to a whisper message, but I manually change to my wsiper chat tab (got an own tab for whisper messages) and put the cursor into the text edit box (by pressing the RETURN key or manually clicking with the mouse into it).
After I've pressed RETURN again to send my mesage I'm trapped in that text edit box.

But it might be related to addons so I'll have to check if it happens without addons too!
  Reply With Quote
05/24/16, 09:19 AM   #11
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
had this bug long ago
but i though its gone
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » activate mouse cursor after dialog prompt?


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