ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Help/Support (https://www.esoui.com/forums/forumdisplay.php?f=164)
-   -   activate mouse cursor after dialog prompt? (https://www.esoui.com/forums/showthread.php?t=4868)

Glen348 07/05/15 04:04 PM

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

circonian 07/06/15 04:35 PM

Quote:

Originally Posted by Glen348 (Post 21876)
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. }

Glen348 07/06/15 04:56 PM

Quote:

Originally Posted by circonian (Post 21886)
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.

circonian 07/07/15 12:42 PM

Quote:

Originally Posted by Glen348 (Post 21888)
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!

Letho 05/23/16 03:11 AM

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?

Ayantir 05/23/16 05:22 AM

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

Letho 05/23/16 08:05 AM

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 :D

Baertram 05/23/16 06:25 PM

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.

ZOS_ChipHilseberg 05/24/16 08:06 AM

Quote:

Originally Posted by Baertram (Post 27070)
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?

Baertram 05/24/16 08:31 AM

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!

QuadroTony 05/24/16 09:19 AM

had this bug long ago
but i though its gone


All times are GMT -6. The time now is 05:28 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI