• "Undo" PANEL:MakePopup()
    2 replies, posted
I'm trying to make a thing that releases and unreleases the mouse from the camera aim for something similar to how roblox does it's camera setup when you go to rotate the camera. Only problem is that in order to get a derma panel that I have to release the mouse from the camera aim so you can click on the world and what not I have to use (theframe):MakePopup(). Doesn't sound bad at first until it comes to going back to regular camera rotation because even when hiding the frame with setvisible and running SetMouseInputEnabled(false) as well as running closedermamenus it refuses to start aiming again unless I click into the now non-panel-covered screen. I've also tried KillFocus() without much success although I read somewhere that it supposedly helps. My horrid code in a link to pastebin since garry's parser on here is garbage. Specifically this section right here closes the big magic invisible panel and makes it go away: function mousePanel2:Close( bSkipAnim ) RememberCursorPosition() self:SetKeyboardInputEnabled( false ) self:SetMouseInputEnabled( false )     self:KillFocus() self:SetAlpha( 255 ) self:SetVisible( false )     CloseDermaMenus() end NOTE: I did not use code tags intentionally as it hardcore fucks it up. Heres a video to clarify: https://www.youtube.com/watch?v=wSKX0fzyXYk&feature=youtu.be Initially all is well, it's doing as intended. Then at 0:05 I attempt to go back to regular aim using the right mouse button. Panel is hidden and my swep stops being dragged around by the now on screen mouse but until I left click at 0:08, it doesn't actually give me aim/camera control back.
The context menu does something similar to this. Try holding down C and moving your mouse, and you will notice the gun moves around in a similar fashion. I think that it does something similar to what you're doing in Panel:Open. Maybe try copying bits of the code?
Yeah I have a near identical setup for my build mode that's actually more or less straight ripped from the context menu. Only problem is despite the build mode version working fine that I have, this for some reason doesn't wanna play nice. (It's nearly the same code)
Sorry, you need to Log In to post a reply to this thread.