From f4bea466dc4c008b802522a2fdc00e612ed3ec6b Mon Sep 17 00:00:00 2001 From: "linuxgurugamer@gmail.com" Date: Fri, 27 Dec 2024 14:44:10 -0500 Subject: [PATCH] Updated version file to use github for version info Copied webpage to README.md --- Changelog.txt | 4 + ClickThroughBlocker.version | 9 +- .../ClickThroughBlocker.version | 7 +- .../000_ClickThroughBlocker/changelog.cfg | 10 +++ README.md | 83 +++++++++++++++++++ changelog.cfg | 12 +++ jenkins.txt | 4 +- 7 files changed, 124 insertions(+), 5 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 6cb8ab9..3db6eb6 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,9 @@ ChangeLog +2.1.20.22 + Updated version file to use github for version info + Copied webpage to README.md + 2.1.20.21 Fixed another nullref when starting game diff --git a/ClickThroughBlocker.version b/ClickThroughBlocker.version index 364ade6..0bccd2e 100644 --- a/ClickThroughBlocker.version +++ b/ClickThroughBlocker.version @@ -1,6 +1,6 @@ { "NAME": "ClickThroughBlocker", - "URL": "http://ksp.spacetux.net/avc/ClickThroughBlocker", + "URL": "https://raw.githubusercontent.com/linuxgurugamer/ClickThroughBlocker/refs/heads/master/ClickThroughBlocker.version", "DOWNLOAD": "https://github.com/linuxgurugamer/ClickThroughBlocker/releases", "GITHUB": { "USERNAME": "linuxgurugamer", @@ -10,11 +10,16 @@ "MAJOR": 2, "MINOR": 1, "PATCH": 10, - "BUILD": 21 + "BUILD": 22 }, "KSP_VERSION_MIN": { "MAJOR": 1, "MINOR": 11, "PATCH": 0 + }, + "KSP_VERSION_MAX": { + "MAJOR": 1, + "MINOR": 12, + "PATCH": 99 } } diff --git a/GameData/000_ClickThroughBlocker/ClickThroughBlocker.version b/GameData/000_ClickThroughBlocker/ClickThroughBlocker.version index 364ade6..ddc44e0 100644 --- a/GameData/000_ClickThroughBlocker/ClickThroughBlocker.version +++ b/GameData/000_ClickThroughBlocker/ClickThroughBlocker.version @@ -1,6 +1,6 @@ { "NAME": "ClickThroughBlocker", - "URL": "http://ksp.spacetux.net/avc/ClickThroughBlocker", + "URL": "https://raw.githubusercontent.com/linuxgurugamer/ClickThroughBlocker/refs/heads/master/ClickThroughBlocker.version", "DOWNLOAD": "https://github.com/linuxgurugamer/ClickThroughBlocker/releases", "GITHUB": { "USERNAME": "linuxgurugamer", @@ -16,5 +16,10 @@ "MAJOR": 1, "MINOR": 11, "PATCH": 0 + }, + "KSP_VERSION_MAX": { + "MAJOR": 1, + "MINOR": 11, + "PATCH": 0 } } diff --git a/GameData/000_ClickThroughBlocker/changelog.cfg b/GameData/000_ClickThroughBlocker/changelog.cfg index bfcfc2b..17fa3c0 100644 --- a/GameData/000_ClickThroughBlocker/changelog.cfg +++ b/GameData/000_ClickThroughBlocker/changelog.cfg @@ -5,6 +5,16 @@ KERBALCHANGELOG license = Lesser GPLv3 author = Linuxgurugamer + VERSION + { + version = 2.1.10.21 + CHANGE + { + change = Fixed another nullref when entering game + + type = update + } + } VERSION { version = 2.1.10.20 diff --git a/README.md b/README.md index 04ad4e8..cde3988 100644 --- a/README.md +++ b/README.md @@ -39,3 +39,86 @@ Functions - Identical to the GUI and GUILayout versions Additional functions bool MouseIsOverWindow(Rect rect) Returns true if the mouse is over the specified rectangle + + +========================================================================== + +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. + +Major Release Update, 1.10.5 + +Added Settings page +Added new setting to specify Focus follows Click +Added code to have the focus follow the click instead of the mouse, for both editor and flight modes +Added initial window to select mode, shows one time only +Modified the CBTMonitor to not run in any scene other than the editor +Fixed window data not getting cleared properly +Removed need to save window rect +Reorganized code a bit +Removed some unnecessary assignments +Added stock settings page to support the FocusFollowsClick mode +Removed need to save window rect +Reorganized code a bit +Removed some unnecessary assignments +Added stock settings page to support the FocusFollowsClick mode +Added cleanup class to cleanup all input locks after a delay, immediately upon changing scenes +Added cleanup delay to settings page +NEW DEPENDENCY + +ToolbarController +This mod will do nothing by itself, it will need to be used by other mods (see Precise Node for an example) + +Mods which use the Click Through Blocker would need to be modified, and this would become a hard dependency for that mod. + +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 + + + +Most important (for mod authors) +All mods using this should add the following line to the AssemblyInfo.cs file: + +[assembly: KSPAssemblyDependency("ClickThroughBlocker", 1, 0)] +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. + + + +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. + +Usage + +Add the following to the top of the source: +using ClickThroughFix; +Replace calls to GUILayout.Window with ClickThruBlocker.GUILayoutWindow +Replace calls to GUI.Window with ClickThruBlocker.GUIWindow +Functions - Identical to the GUI and GUILayout versions + +Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, GUIStyle style, params GUILayoutOption[] options); +Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, Texture image, GUIStyle style, params GUILayoutOption[] options); +Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, string text, GUIStyle style, params GUILayoutOption[] options); +Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, params GUILayoutOption[] options); +Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, Texture image, params GUILayoutOption[] options); +Rect GUILayoutWindow(int id, Rect screenRect, GUI.WindowFunction func, string text, params GUILayoutOption[] options); + +Rect GUIWindow(int id, Rect clientRect, WindowFunction func, Texture image, GUIStyle style); +Rect GUIWindow(int id, Rect clientRect, WindowFunction func, string text, GUIStyle style); +Rect GUIWindow(int id, Rect clientRect, WindowFunction func, GUIContent content); +Rect GUIWindow(int id, Rect clientRect, WindowFunction func, Texture image); +Rect GUIWindow(int id, Rect clientRect, WindowFunction func, string text); +Rect GUIWindow(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 + +Download + +Source: https://github.com/linuxgurugamer/ClickThroughBlocker +Spacedock: https://spacedock.info/mod/1689 +Github: https://github.com/linuxgurugamer/ClickThroughBlocker/releases +License: GPLv3 +Available via CKAN + diff --git a/changelog.cfg b/changelog.cfg index 17fa3c0..2b2b03a 100644 --- a/changelog.cfg +++ b/changelog.cfg @@ -5,6 +5,18 @@ KERBALCHANGELOG license = Lesser GPLv3 author = Linuxgurugamer + VERSION + { + version = 2.1.10.22 + CHANGE + { + change = Updated version file to use github for version info + change = Copied webpage to README.md + + + type = update + } + } VERSION { version = 2.1.10.21 diff --git a/jenkins.txt b/jenkins.txt index 19d08f1..33642e7 100644 --- a/jenkins.txt +++ b/jenkins.txt @@ -32,8 +32,8 @@ # 3:SOURCEFILE, DESTDIR 3:ClickThroughBlocker.version,GameData/000_ClickThroughBlocker 3:changelog.cfg,GameData/000_ClickThroughBlocker -#3:LICENSE.md,GameData/KerbalHotSeat -#3:README.md,GameData/KerbalHotSeat +3:LICENSE.md,GameData/000_ClickThroughBlocker +3:README.md,GameData/000_ClickThroughBlocker # 4:SOURCDIR, DESTDIR #4:Textures,GameData/ManeuverQueue/Textures