Click Through Blocker

License: GPLv3

Game Version: 1.5.1

Downloads: 70,252

Author: linuxgurugamer

Mod Website: Forum Thread

Support this mod: Donate

Followers: 180

Information Changelog Stats

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

Version 0.1.6.9 for Kerbal Space Program 1.5.1

Released on 2018-10-19

Version bump to fix .version file

Download

Version 0.1.6.8 for Kerbal Space Program 1.5.1

Released on 2018-10-19

Version bump for 1.5 rebuild

Download

Version 0.1.6.7 for Kerbal Space Program 1.4.4

Released on 2018-07-22

Fixed ArgumentOutOfRangeException in Update

Download

Version 0.1.6.6 for Kerbal Space Program 1.4.4

Released on 2018-07-20

Some minor runtime optimizations

Download

Version 0.1.6.5 for Kerbal Space Program 1.4.3

Released on 2018-05-23

Renamed directory, if installing by hand, remove the old directory

Download

Version 0.1.6.3 for Kerbal Space Program 1.4.3

Released on 2018-05-06

Added an additional check to the CBTMonitor for null refs
Reversed order of loops in CBTMonitor for efficiency

Download

Version 0.1.6.2 for Kerbal Space Program 1.4.2

Released on 2018-04-14

Added: [assembly: KSPAssembly("ToolbarController", 1, 0)] to assemblyinfo to allow other mods to check the load order

Download

Version 0.1.6.1 for Kerbal Space Program 1.4.1

Released on 2018-03-29

Updated version file to allow all 1.4.*

Download

Version 0.1.6 for Kerbal Space Program 1.4.1

Released on 2018-03-18

Fix for lock not being released when going from editor to flight (ie: KRASH)

Download

Version 0.1.5 for Kerbal Space Program 1.4.1

Released on 2018-03-16

Changed check of UniversalTime to a tick counter in CBTMonitor, since time doesn't flow in the Editors

Download

Version 0.1.4 for Kerbal Space Program 1.4.1

Released on 2018-03-15

Added fix for nullrefs in CBTMonitor.cs

Download

Version 0.1.3 for Kerbal Space Program 1.4.1

Released on 2018-03-14

Updated for 1.4.1

Download

Version 0.1.2 for Kerbal Space Program 1.3.1

Released on 2018-03-02

Added code to work around stock bug where the editor ignores the lock when the ActionGroup pane is shown

Download

Version 0.1.1.1 for Kerbal Space Program 1.3.1

Released on 2018-02-27

Changed Log class to internal, so it won't interfere with other code compiles

Download

Version 0.1.1 for Kerbal Space Program 1.3.1

Released on 2018-02-24

Fixed bug where closing a window while the mouse was over the window would lock the UI; for example, if a window has an X button to close. Thanks to forum user @keldion for finding this and pointing it out

Download

Version 0.1.0 for Kerbal Space Program 1.3.1

Released on 2018-02-10

No changelog provided

Download

Stats for Click Through Blocker

Downloads over time

    New followers per day

    Top Referrers

    1. forum.kerbalspaceprogram.com
    2. spacedock.info
    3. www.google.com
    4. www.spacedock.info
    5. yandex.ru
    6. www.google.co.uk
    7. duckduckgo.com
    8. www.bing.com
    9. www.google.ca
    10. www.google.fr

    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.