Skip to content

Commit f4bea46

Browse files
Updated version file to use github for version info
Copied webpage to README.md
1 parent bb1575e commit f4bea46

File tree

7 files changed

+124
-5
lines changed

7 files changed

+124
-5
lines changed

Changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
ChangeLog
22

3+
2.1.20.22
4+
Updated version file to use github for version info
5+
Copied webpage to README.md
6+
37
2.1.20.21
48
Fixed another nullref when starting game
59

ClickThroughBlocker.version

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"NAME": "ClickThroughBlocker",
3-
"URL": "http://ksp.spacetux.net/avc/ClickThroughBlocker",
3+
"URL": "https://raw.githubusercontent.com/linuxgurugamer/ClickThroughBlocker/refs/heads/master/ClickThroughBlocker.version",
44
"DOWNLOAD": "https://github.com/linuxgurugamer/ClickThroughBlocker/releases",
55
"GITHUB": {
66
"USERNAME": "linuxgurugamer",
@@ -10,11 +10,16 @@
1010
"MAJOR": 2,
1111
"MINOR": 1,
1212
"PATCH": 10,
13-
"BUILD": 21
13+
"BUILD": 22
1414
},
1515
"KSP_VERSION_MIN": {
1616
"MAJOR": 1,
1717
"MINOR": 11,
1818
"PATCH": 0
19+
},
20+
"KSP_VERSION_MAX": {
21+
"MAJOR": 1,
22+
"MINOR": 12,
23+
"PATCH": 99
1924
}
2025
}

GameData/000_ClickThroughBlocker/ClickThroughBlocker.version

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"NAME": "ClickThroughBlocker",
3-
"URL": "http://ksp.spacetux.net/avc/ClickThroughBlocker",
3+
"URL": "https://raw.githubusercontent.com/linuxgurugamer/ClickThroughBlocker/refs/heads/master/ClickThroughBlocker.version",
44
"DOWNLOAD": "https://github.com/linuxgurugamer/ClickThroughBlocker/releases",
55
"GITHUB": {
66
"USERNAME": "linuxgurugamer",
@@ -16,5 +16,10 @@
1616
"MAJOR": 1,
1717
"MINOR": 11,
1818
"PATCH": 0
19+
},
20+
"KSP_VERSION_MAX": {
21+
"MAJOR": 1,
22+
"MINOR": 11,
23+
"PATCH": 0
1924
}
2025
}

GameData/000_ClickThroughBlocker/changelog.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ KERBALCHANGELOG
55
license = Lesser GPLv3
66
author = Linuxgurugamer
77

8+
VERSION
9+
{
10+
version = 2.1.10.21
11+
CHANGE
12+
{
13+
change = Fixed another nullref when entering game
14+
15+
type = update
16+
}
17+
}
818
VERSION
919
{
1020
version = 2.1.10.20

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,86 @@ Functions - Identical to the GUI and GUILayout versions
3939
Additional functions
4040

4141
bool MouseIsOverWindow(Rect rect) Returns true if the mouse is over the specified rectangle
42+
43+
44+
==========================================================================
45+
46+
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.
47+
48+
Major Release Update, 1.10.5
49+
50+
Added Settings page
51+
Added new setting to specify Focus follows Click
52+
Added code to have the focus follow the click instead of the mouse, for both editor and flight modes
53+
Added initial window to select mode, shows one time only
54+
Modified the CBTMonitor to not run in any scene other than the editor
55+
Fixed window data not getting cleared properly
56+
Removed need to save window rect
57+
Reorganized code a bit
58+
Removed some unnecessary assignments
59+
Added stock settings page to support the FocusFollowsClick mode
60+
Removed need to save window rect
61+
Reorganized code a bit
62+
Removed some unnecessary assignments
63+
Added stock settings page to support the FocusFollowsClick mode
64+
Added cleanup class to cleanup all input locks after a delay, immediately upon changing scenes
65+
Added cleanup delay to settings page
66+
NEW DEPENDENCY
67+
68+
ToolbarController
69+
This mod will do nothing by itself, it will need to be used by other mods (see Precise Node for an example)
70+
71+
Mods which use the Click Through Blocker would need to be modified, and this would become a hard dependency for that mod.
72+
73+
The changes are very simple:
74+
75+
Replace all calls to GUILayout.Window with ClickThruBlocker.GUILayoutWindow, the parameters are identical
76+
Replace all calls to GUI.Window with ClickThruBlocker.GUIWindow, the parameters are identical
77+
78+
79+
80+
Most important (for mod authors)
81+
All mods using this should add the following line to the AssemblyInfo.cs file:
82+
83+
[assembly: KSPAssemblyDependency("ClickThroughBlocker", 1, 0)]
84+
This will guarantee the load order. One benefit is that KSP will output a warning and won't load an assembly if it's dependencies aren't met (which may be better than puking out a bunch of exceptions). The only other real problem with the forced to the top of the sort list method is that technically there's a couple characters before zero ('~', '!', '@', etc.) and dlls directly in GameData come first too. Of course someone pretty much has to be trying to break things if you have to worry about this particular case.
85+
86+
87+
88+
How it works
89+
90+
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.
91+
92+
Usage
93+
94+
Add the following to the top of the source:
95+
using ClickThroughFix;
96+
Replace calls to GUILayout.Window with ClickThruBlocker.GUILayoutWindow
97+
Replace calls to GUI.Window with ClickThruBlocker.GUIWindow
98+
Functions - Identical to the GUI and GUILayout versions
99+
100+
Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, GUIStyle style, params GUILayoutOption[] options);
101+
Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, Texture image, GUIStyle style, params GUILayoutOption[] options);
102+
Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, string text, GUIStyle style, params GUILayoutOption[] options);
103+
Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, params GUILayoutOption[] options);
104+
Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, Texture image, params GUILayoutOption[] options);
105+
Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, string text, params GUILayoutOption[] options);
106+
107+
Rect GUIWindow(int id, Rect clientRect, WindowFunction func, Texture image, GUIStyle style);
108+
Rect GUIWindow(int id, Rect clientRect, WindowFunction func, string text, GUIStyle style);
109+
Rect GUIWindow(int id, Rect clientRect, WindowFunction func, GUIContent content);
110+
Rect GUIWindow(int id, Rect clientRect, WindowFunction func, Texture image);
111+
Rect GUIWindow(int id, Rect clientRect, WindowFunction func, string text);
112+
Rect GUIWindow(int id, Rect clientRect, WindowFunction func, GUIContent title, GUIStyle style);
113+
Additional functions
114+
115+
bool MouseIsOverWindow(Rect rect) Returns true if the mouse is over the specified rectangle
116+
117+
Download
118+
119+
Source: https://github.com/linuxgurugamer/ClickThroughBlocker
120+
Spacedock: https://spacedock.info/mod/1689
121+
Github: https://github.com/linuxgurugamer/ClickThroughBlocker/releases
122+
License: GPLv3
123+
Available via CKAN
124+

changelog.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ KERBALCHANGELOG
55
license = Lesser GPLv3
66
author = Linuxgurugamer
77

8+
VERSION
9+
{
10+
version = 2.1.10.22
11+
CHANGE
12+
{
13+
change = Updated version file to use github for version info
14+
change = Copied webpage to README.md
15+
16+
17+
type = update
18+
}
19+
}
820
VERSION
921
{
1022
version = 2.1.10.21

jenkins.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
# 3:SOURCEFILE, DESTDIR
3333
3:ClickThroughBlocker.version,GameData/000_ClickThroughBlocker
3434
3:changelog.cfg,GameData/000_ClickThroughBlocker
35-
#3:LICENSE.md,GameData/KerbalHotSeat
36-
#3:README.md,GameData/KerbalHotSeat
35+
3:LICENSE.md,GameData/000_ClickThroughBlocker
36+
3:README.md,GameData/000_ClickThroughBlocker
3737

3838
# 4:SOURCDIR, DESTDIR
3939
#4:Textures,GameData/ManeuverQueue/Textures

0 commit comments

Comments
 (0)