Click Through Blocker

Blocks mouse clicks from going through windows to underlying objects

License: GPLv3

Game Version: 1.12.5

Downloads: 952,276

Author: linuxgurugamer

Mod Website: Forum Thread

Support this mod: Donate

Followers: 408

Having clicked one too many times on one window, only to have it click on the parts underneath (in the Editor), or click on an unwanted item in flight, I decided to solve the problem with yet another mod

Mods which use the Click Through Blocker would need to be modified, and this would become a hard dependency for that mod.

This mod will do NOTHING by itself, it needs to be used by other mods

The changes are very simple:

Replace all calls to GUILayout.Window with ClickThruBlocker.GUILayoutWindow, the parameters are identical Replace all calls to GUI.Window with ClickThruBlocker.GUIWindow, the parameters are identical

How it works

Each call first calls the original method (ie: ClickThruBlocker.GUILayoutWindow will call GUILayout.Window). After the call, the position of the mouse is checked to see if it was on top of the window Rect, if it is, it then locks the controls so that clicks don't pass through to any other window.

Functions - Identical to the GUI and GUILayout versions Rect Window(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, GUIStyle style, params GUILayoutOption[] options); Rect Window(int id, Rect screenRect, GUI.WindowFunction func, Texture image, GUIStyle style, params GUILayoutOption[] options); Rect Window(int id, Rect screenRect, GUI.WindowFunction func, string text, GUIStyle style, params GUILayoutOption[] options); Rect Window(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, params GUILayoutOption[] options); Rect Window(int id, Rect screenRect, GUI.WindowFunction func, Texture image, params GUILayoutOption[] options); Rect Window(int id, Rect screenRect, GUI.WindowFunction func, string text, params GUILayoutOption[] options);

Rect Window(int id, Rect clientRect, WindowFunction func, Texture image, GUIStyle style);
Rect Window(int id, Rect clientRect, WindowFunction func, string text, GUIStyle style);
Rect Window(int id, Rect clientRect, WindowFunction func, GUIContent content);
Rect Window(int id, Rect clientRect, WindowFunction func, Texture image);
Rect Window(int id, Rect clientRect, WindowFunction func, string text);
Rect Window(int id, Rect clientRect, WindowFunction func, GUIContent title, GUIStyle style);

Additional functions

bool MouseIsOverWindow(Rect rect) Returns true if the mouse is over the specified rectangle

Loading changelog...

Stats for Click Through Blocker

Downloads over time

Downloads per version

New followers per day

Top Referrers

  1. forum.kerbalspaceprogram.com
  2. spacedock.info
  3. www.youtube.com
  4. www.google.com
  5. www.reddit.com
  6. duckduckgo.com
  7. yandex.ru
  8. www.bing.com
  9. kerbalx.com
  10. www.spacedock.info

Export Raw Stats

Export Downloads

Export Followers

Export Referrals

Raw stats are from the beginning of time until now. Each follower and download entry represents one hour of data. Uneventful hours are omitted.