Skip to content

Commit

Permalink
Fixed issue on 1.11 where a uncontrolled ship would be controllable w…
Browse files Browse the repository at this point in the history
…hen changing scenes to it
  • Loading branch information
linuxgurugamer committed Jun 16, 2021
1 parent 779b2d9 commit 8333fed
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ChangeLog

0.1.10.16
Fixed issue on 1.11 where a uncontrolled ship would be controllable when changing scenes to it

0.1.10.15
Fixed issue in editor where a single open window which was closed was leaving everything locked.

Expand Down
4 changes: 2 additions & 2 deletions ClickThroughBlocker.version
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"MAJOR": 0,
"MINOR": 1,
"PATCH": 10,
"BUILD": 15
"BUILD": 16
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
"MINOR": 8,
"MINOR": 11,
"PATCH": 0
}
}
2 changes: 1 addition & 1 deletion ClickThroughBlocker/AssemblyVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

using System.Reflection;

[assembly: AssemblyVersion("0.1.10.14")]
[assembly: AssemblyVersion("0.1.10.16")]
11 changes: 7 additions & 4 deletions ClickThroughBlocker/SceneChangeCleanup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace ClearAllInputLocks
{
[KSPAddon(KSPAddon.Startup.AllGameScenes, false)]
class SceneChangeCleanup : MonoBehaviour
class SceneChangeCleanup : MonoBehaviour
{
void Start()
{
Expand Down Expand Up @@ -60,13 +60,16 @@ void StopStartCoroutine()
}

bool isRunning = false;
IEnumerator CleanupInputLocks()
IEnumerator CleanupInputLocks()
{
//Log.Info("CleanUpInputLocks entry");
isRunning = true;
yield return new WaitForSeconds(HighLogic.CurrentGame.Parameters.CustomParams<ClickThroughFix.CTB>().cleanupDelay);
InputLockManager.ClearControlLocks();
yield return null;
if (Versioning.version_major == 1 && Versioning.version_minor < 11)
{
InputLockManager.ClearControlLocks();
yield return null;
}
isRunning = false;
//Log.Info("CleanUpInputLocks exit");
}
Expand Down
9 changes: 8 additions & 1 deletion ClickThroughBlocker/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ public class CTB : GameParameters.CustomParameterNode
toolTip = "Time to wait after scene change before clearing all the input locks")]
public float cleanupDelay = 0.5f;

public override bool Enabled(MemberInfo member, GameParameters parameters) { return true; }
public override bool Enabled(MemberInfo member, GameParameters parameters)
{
if (Versioning.version_major == 1 && Versioning.version_minor >= 11)
{
return member.Name != "cleanupDelay";
}
return true;
}

bool? oldFocusFollowsClick;

Expand Down
4 changes: 2 additions & 2 deletions GameData/000_ClickThroughBlocker/ClickThroughBlocker.version
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"MAJOR": 0,
"MINOR": 1,
"PATCH": 10,
"BUILD": 14
"BUILD": 16
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
"MINOR": 8,
"MINOR": 11,
"PATCH": 0
}
}
10 changes: 10 additions & 0 deletions GameData/000_ClickThroughBlocker/changelog.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ KERBALCHANGELOG
license = Lesser GPLv3
author = Linuxgurugamer


VERSION
{
version = 0.1.10.16
CHANGE
{
change = Fixed issue on 1.11 where a uncontrolled ship would be controllable when changing scenes to it
type = update
}
}
VERSION
{
version = 0.1.10.15
Expand Down
10 changes: 10 additions & 0 deletions changelog.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ KERBALCHANGELOG
license = Lesser GPLv3
author = Linuxgurugamer


VERSION
{
version = 0.1.10.16
CHANGE
{
change = Fixed issue on 1.11 where a uncontrolled ship would be controllable when changing scenes to it
type = update
}
}
VERSION
{
version = 0.1.10.15
Expand Down

0 comments on commit 8333fed

Please sign in to comment.