Skip to content

Commit 41265e8

Browse files
Fixed issue in editor where a single open window which was closed was leaving everything locked.
1 parent 86141a6 commit 41265e8

File tree

7 files changed

+50
-21
lines changed

7 files changed

+50
-21
lines changed

Changelog.txt

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

3+
0.1.10.15
4+
Fixed issue in editor where a single open window which was closed was leaving everything locked.
5+
36
0.1.10.14
47
Fixed performance issue in the editor when FocusFollowsMouse was active
58
Two problems:
69
GetComponent was being called on every part
710
EditorActionGroups.Instance.ClearSelection was being called every time through Update()
811
Added global value for FocusFollowsClick or FocusFollowsMouse for all new saves
912

13+
1014
0.1.10.13
1115
Fixed inputlocks not being cleared when canceling the window
1216
Added mode toggle on new button to allow toggling between different modes during the game

ClickThroughBlocker/CBTMonitor.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,20 @@ void LateUpdate()
119119
//(!HighLogic.CurrentGame.Parameters.CustomParams<CTB>().focusFollowsclick && !HighLogic.LoadedSceneIsEditor))
120120
return;
121121

122-
d = 0;
122+
d = -1;
123123
ClickThruBlocker.CTBWin win = null;
124124
{
125125
foreach (var w in ClickThruBlocker.winList)
126126
{
127+
//Log.Info("LateUpdate, w.Value.lastUpdated: " + w.Value.lastUpdated);
127128
if (w.Value.lastUpdated + 4 < CBTGlobalMonitor.globalTimeTics) //+ 0.05 < Planetarium.GetUniversalTime())
128129
{
129130
d = w.Key;
130131
win = w.Value;
131132
break;
132133
}
133134
}
134-
if (d != 0)
135+
if (d != -1)
135136
{
136137
win.OnDestroy();
137138
}

ClickThroughBlocker/ClickThroughBlocker.csproj

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,27 +89,30 @@
8989
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
9090
<PropertyGroup>
9191
<PostBuildEvent>
92+
set KSPDIR=$(KSPDIR)
9293

93-
start /D D:\Users\jbb\github\ClickThroughBlocker /WAIT deploy.bat $(TargetDir) $(TargetFileName)
94+
IF "%25KSPDIR%25"=="" (
9495

96+
ECHO Configuration error - KSPDIR not specified in project.
9597

98+
ECHO Either set KSPDIR environment variable or edit BetterLoadSaveGame.Common.props
9699

100+
PAUSE
97101

98-
if $(ConfigurationName) == Release (
102+
GOTO DONE
99103

104+
)
100105

106+
start /D $(SolutionDir) /WAIT deploy.bat $(TargetDir) $(TargetFileName) $(TargetName)
101107

108+
if $(ConfigurationName) == Release (
102109

103-
start /D D:\Users\jbb\github\ClickThroughBlocker /WAIT buildRelease.bat $(TargetDir) $(TargetFileName) $(TargetName)
104-
105-
110+
start /D $(SolutionDir) /WAIT buildRelease.bat $(TargetDir) $(TargetFileName) $(TargetName)
106111

107112
)</PostBuildEvent>
108113
</PropertyGroup>
109114
<PropertyGroup>
110115
<PreBuildEvent>
111-
set textTemplatingPath="%25ProgramFiles(x86)%25\Microsoft Visual Studio\2017\Community\Common7\IDE\texttransform.exe"
112-
%25textTemplatingPath%25 "$(ProjectDir)AssemblyVersion.tt"
113-
</PreBuildEvent>
116+
"$(DevEnvDir)\texttransform.exe" "$(ProjectDir)AssemblyVersion.tt"</PreBuildEvent>
114117
</PropertyGroup>
115118
</Project>

ClickThroughBlocker/SceneChangeCleanup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ void StopStartCoroutine()
6262
bool isRunning = false;
6363
IEnumerator CleanupInputLocks()
6464
{
65-
Log.Info("CleanUpInputLocks entry");
65+
//Log.Info("CleanUpInputLocks entry");
6666
isRunning = true;
6767
yield return new WaitForSeconds(HighLogic.CurrentGame.Parameters.CustomParams<ClickThroughFix.CTB>().cleanupDelay);
6868
InputLockManager.ClearControlLocks();
6969
yield return null;
7070
isRunning = false;
71-
Log.Info("CleanUpInputLocks exit");
71+
//Log.Info("CleanUpInputLocks exit");
7272
}
7373
}
7474
}

GameData/000_ClickThroughBlocker/changelog.cfg

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,26 @@ KERBALCHANGELOG
55
license = Lesser GPLv3
66
author = Linuxgurugamer
77

8+
VERSION
9+
{
10+
version = 0.1.10.15
11+
CHANGE
12+
{
13+
change = Fixed issue in editor where a single open window which was closed was leaving everything
14+
type = update
15+
}
16+
}
817

918
VERSION
1019
{
1120
version = 0.1.10.14
1221
CHANGE
1322
{
14-
change = Fixed performance issue in the editor when FocusFollowsMouse was active
23+
change = Fixed performance issue in the editor when FocusFollowsMouse was active
24+
subchange = Two problems:
25+
subchange = GetComponent was being called on every part
26+
subchange = EditorActionGroups.Instance.ClearSelection was being called every time through Update()
1527
change = Added global value for FocusFollowsClick or FocusFollowsMouse for all new saves
16-
1728
type = update
1829
}
1930
}

changelog.cfg

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

8+
VERSION
9+
{
10+
version = 0.1.10.15
11+
CHANGE
12+
{
13+
change = Fixed issue in editor where a single open window which was closed was leaving everything
14+
type = update
15+
}
16+
}
817

918
VERSION
1019
{

deploy.bat

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
rem @echo off
2+
@echo off
33

44
rem H is the destination game folder
55
rem GAMEDIR is the name of the mod folder (usually the mod name)
@@ -8,17 +8,18 @@ rem VERSIONFILE is the name of the version file, usually the same as GAMEDATA,
88
rem but not always
99

1010
set H=%KSPDIR%
11-
set H=R:\KSP_1.10.1_dev
12-
set H=R:\dp0\kspdev
11+
1312
set GAMEDIR=000_ClickThroughBlocker
14-
set GAMEDATA="GameData\"
13+
set GAMEDATA=GameData
1514
set VERSIONFILE=ClickThroughBlocker.version
1615

16+
set DP0=r:\dp0\kspdev
17+
1718
copy /Y "%1%2" "%GAMEDATA%\%GAMEDIR%\Plugins"
18-
copy /Y "%1ClickThroughBlocker.pdb" "%GAMEDATA%\%GAMEDIR%\Plugins"
19+
copy /Y "%1%3".pdb "%GAMEDATA%\%GAMEDIR%\Plugins
1920

2021
copy /Y %VERSIONFILE% %GAMEDATA%\%GAMEDIR%
2122
copy /y changelog.cfg %GAMEDATA%\%GAMEDIR%
22-
xcopy /y /s /I %GAMEDATA%\%GAMEDIR% "%H%\GameData\%GAMEDIR%"
2323

24-
pause
24+
xcopy /y /s /I %GAMEDATA%\%GAMEDIR% "%H%\GameData\%GAMEDIR%"
25+
xcopy /y /s /I %GAMEDATA%\%GAMEDIR% "%DP0%\GameData\%GAMEDIR%"

0 commit comments

Comments
 (0)