Jump to content

Stop GUI click through


Recommended Posts

Alright, while searching, I did not see an answer but I did see a few other people asking this also so fresh thread to catch future searches.

I'm using the built-in GUI to KSP for this. However, I'm ending up taking up a lot of screen real estate and the default behavior allows clicking through the gui to select parts of the vessel below.

As this click then changes the active part, at the same time as my mod is trying to edit the action groups of the active part, it then proceeds to throw a fit. (Well, it resets and the player has to try and set the same action over again from scratch.)

So, how do I stop this click through behavior?

I've tried sticking a GUI.Box in the way, a GUI.Texture in the way, I poked at HighLogic.skin.window a bit and got nowhere.

At this point I am totally stumped. Unless someone has an idea of how to do this, the click-through behavior is going to be present in the initial release of my mod.

D.

Link to comment
Share on other sites

Is this in the VAB/SPH or during flight? I don't know of any way during flight but KER does this during editing so you could take a look at the CheckEditorLock method in BuildEngineer.cs. Basically it calls this every time it is asked to redraw its window. It tests to see if the mouse is inside the window. If it is and the editor is not currently locked then it locks it. If it isn't and the editor is currently locked then it unlocks it...

Link to comment
Share on other sites

@Padishar: Thank you for the tip on the editor part, that does work. I'm not as worried about flight mode, zoom is easier there so getting parts stuck under my window is more unlikely.

Progress continues....

D.

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