View Single Post
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