Jump to content

How do I close the right click "window", stop cam mode switching?


Recommended Posts

Working on a plugin that moves you viewpoint to a docking port.  It activates when you click a custom button in the right click window (button is labeled "view from here").

Once in my camera virw, that right click box remains unless you right click somewhere outside of it to close it.  Is there a way I can force it closed?

Also, when in my camera view, hitting "v" does not change the view on he screen, but you do get those "camera mode" messages on the screen and I'd like to supreme them, or lock out the "v" key.  Any thoughts on how?

Link to comment
Share on other sites

Force it closed or remove/change the event button sounds like a better solution?

 

depends on how you are changing the cameras. Which camera are you changing and do you update or use the CameraManager instance? Do you really need to lock it out or ensure you don't break the std camera modes and options (which at the moment it sounds like you are breaking it)

Link to comment
Share on other sites

Nothing gets broken afaik, the camera transform gets set to the docking port, the restored when you exit the view. The camera mode in question is flight. 

Using an update function I keep enforcing my intended view and it's settings. 

Suppressing the Auto, Chase, Locked etc. Messages isn't super important, but I would like that right click window or dialog box might be a better term, to close when my button is clicked.  Not just my button go, but the whole box.

Link to comment
Share on other sites

Removing messages can be done. See this code snippit. but even better for you would be:-

You can lock the camera buttons out by adding and removing a control lock.

InputLockManager.SetControlLock(ControlTypes.CAMERAMODES, "YourModorSomething");

InputLockManager.RemoveControlLock("YourModorSomething");

You can see the control Locks in the alt-F12 debug menu.

As far as removing the PArt right click menu, depends on whether you are doing it in 1.0.5 or 1.1 as it has changed.
EDIT: let me know what version you are trying to do this for?

Edited by JPLRepo
Link to comment
Share on other sites

@JPLRepo You've been very helpful so I hope I can trouble you for one more thing.  Neither CAMERAMODES nor CAMERA CONTROLS kills the actual camera switching key (default c).  To be seamless I really want that key to exit my cam mode and set things back to normal, but it also flips to the iva view.  I tried various commands in my code to switch the cam mode back, but it seems to be occasionally glitchy....

So I'm thinking if there's a way to lockout the games response to that key, it might solve the odd occasion were the view gets locked in external looking straight down...

Link to comment
Share on other sites

I don't understand.

InputLockManager.SetControlLock(ControlTypes.CAMERAMODES, "Modname");
Definitely locks the 'C' camera switch key for me.
Are you saying you still want it to function but only for your mod?
If you put the control lock on as above it should block the stock game.
In your mod code you can check for:
if GameSettings.CAMERA_MODE.GetKeyDown(true)
To still intercept the 'C' key or whatever the user has set the camera mode key to in their settings. 
the true bool tells it to ignore the control lock I believe. 

 

Edited by JPLRepo
Link to comment
Share on other sites

So, what I did do was coded it to store and unbind the CAMERA_MODE keybind, then do my thing.  Then when I hit the camera key I exit my cam and return to normal but it's the IVA view.  So I have 

CameraManager.Instance.NextCameraMode ();

Which flips it back to External view.

I can't be sure, but I think it was still activating a cam switch and fighting with my code and occasionally getting locked up so you couldn't move the cam.

Link to comment
Share on other sites

@JPLRepo - Ok, wow... I would have bet precious body parts that I had tested it and found that the C key still swapped cameras between IVA and External.  But I just did a die hard test by commenting out my "unlock" line and sure enough, I can pan, zoom, etc but I can NOT change type (Orbital, Locked, etc.) nor can I switch between External and IVA... so what I think I need to do now is set up another conditional statement that looks for GetKeyUp before unlocking the controls.  Right now I'm unlocking them as soon as I see a key down, and I think the game is then catching the key being pressed when the unlock happens.

I'll test that out Sunday.  

Thanks for the help!

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...