Jump to content

Click-thru GUI


Recommended Posts

I have a problem with the GUI for my mod. When I click on a button the click also interferes with whatever is behind the button. This is very annoying. How can I stop this. I imagine it might have something to do with event.current.use() but I am not sure I understand the event model well enough to know what to do with it.

Can someone please explain?

Link to comment
Share on other sites

Link to comment
Share on other sites

Are you talking about clicking through a Unity GUI into the KSP UI, or clicking through different layers of Unity GUI?

The EditorLogic stuff works for clicking through to the KSP UI, though there can be some issues with that; in the spacecenter and tracking station it can make timewarp wonky when you try to lock the KSP UI.

I'm not sure if there's an easy way to lock out different layers of your own UI, other than just disabling them when one window overlaps another (turn a button into a label with the same GUIStyle as the button).

Also, is there a simple way to lock out things like right-click buttons? The only method I'm aware of is to go through each PartActionWindow and disable it: https://github.com/DMagic1/KSP_Contract_Window/blob/master/contractsWindow.cs#L169-L182

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 3 years later...
On 2/24/2015 at 6:10 PM, sarbian said:

@sarbian

Just came across something as part of debugging my ClickThroughBlocker.

This code:

https://github.com/MuMech/MechJeb2/blob/29d9b1ba7e75a325476b9a4f5712d1970c09b840/MechJeb2/MechJebCore.cs#L1136-L1147

works in the Editor, EXCEPT when Action Groups are selected.  When Action Groups are selected, the mechjeb window doesn't block clicks from falling through to the parts underneath.

Would you have any ideas how to fix this?

I'll open an issue on Github, would really like to get this figured out

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