Skip to content

Commit

Permalink
Fixed issue in editor where a single open window which was closed was…
Browse files Browse the repository at this point in the history
… leaving everything locked.
  • Loading branch information
linuxgurugamer committed Jan 9, 2021
1 parent 86141a6 commit 41265e8
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 21 deletions.
4 changes: 4 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
ChangeLog

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

0.1.10.14
Fixed performance issue in the editor when FocusFollowsMouse was active
Two problems:
GetComponent was being called on every part
EditorActionGroups.Instance.ClearSelection was being called every time through Update()
Added global value for FocusFollowsClick or FocusFollowsMouse for all new saves


0.1.10.13
Fixed inputlocks not being cleared when canceling the window
Added mode toggle on new button to allow toggling between different modes during the game
Expand Down
5 changes: 3 additions & 2 deletions ClickThroughBlocker/CBTMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,20 @@ void LateUpdate()
//(!HighLogic.CurrentGame.Parameters.CustomParams<CTB>().focusFollowsclick && !HighLogic.LoadedSceneIsEditor))
return;

d = 0;
d = -1;
ClickThruBlocker.CTBWin win = null;
{
foreach (var w in ClickThruBlocker.winList)
{
//Log.Info("LateUpdate, w.Value.lastUpdated: " + w.Value.lastUpdated);
if (w.Value.lastUpdated + 4 < CBTGlobalMonitor.globalTimeTics) //+ 0.05 < Planetarium.GetUniversalTime())
{
d = w.Key;
win = w.Value;
break;
}
}
if (d != 0)
if (d != -1)
{
win.OnDestroy();
}
Expand Down
19 changes: 11 additions & 8 deletions ClickThroughBlocker/ClickThroughBlocker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,30 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
set KSPDIR=$(KSPDIR)

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

ECHO Configuration error - KSPDIR not specified in project.

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

PAUSE

if $(ConfigurationName) == Release (
GOTO DONE

)

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

if $(ConfigurationName) == Release (

start /D D:\Users\jbb\github\ClickThroughBlocker /WAIT buildRelease.bat $(TargetDir) $(TargetFileName) $(TargetName)


start /D $(SolutionDir) /WAIT buildRelease.bat $(TargetDir) $(TargetFileName) $(TargetName)

)</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
set textTemplatingPath="%25ProgramFiles(x86)%25\Microsoft Visual Studio\2017\Community\Common7\IDE\texttransform.exe"
%25textTemplatingPath%25 "$(ProjectDir)AssemblyVersion.tt"
</PreBuildEvent>
"$(DevEnvDir)\texttransform.exe" "$(ProjectDir)AssemblyVersion.tt"</PreBuildEvent>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions ClickThroughBlocker/SceneChangeCleanup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ void StopStartCoroutine()
bool isRunning = false;
IEnumerator CleanupInputLocks()
{
Log.Info("CleanUpInputLocks entry");
//Log.Info("CleanUpInputLocks entry");
isRunning = true;
yield return new WaitForSeconds(HighLogic.CurrentGame.Parameters.CustomParams<ClickThroughFix.CTB>().cleanupDelay);
InputLockManager.ClearControlLocks();
yield return null;
isRunning = false;
Log.Info("CleanUpInputLocks exit");
//Log.Info("CleanUpInputLocks exit");
}
}
}
15 changes: 13 additions & 2 deletions GameData/000_ClickThroughBlocker/changelog.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@ KERBALCHANGELOG
license = Lesser GPLv3
author = Linuxgurugamer

VERSION
{
version = 0.1.10.15
CHANGE
{
change = Fixed issue in editor where a single open window which was closed was leaving everything
type = update
}
}

VERSION
{
version = 0.1.10.14
CHANGE
{
change = Fixed performance issue in the editor when FocusFollowsMouse was active
change = Fixed performance issue in the editor when FocusFollowsMouse was active
subchange = Two problems:
subchange = GetComponent was being called on every part
subchange = EditorActionGroups.Instance.ClearSelection was being called every time through Update()
change = Added global value for FocusFollowsClick or FocusFollowsMouse for all new saves

type = update
}
}
Expand Down
9 changes: 9 additions & 0 deletions changelog.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ KERBALCHANGELOG
license = Lesser GPLv3
author = Linuxgurugamer

VERSION
{
version = 0.1.10.15
CHANGE
{
change = Fixed issue in editor where a single open window which was closed was leaving everything
type = update
}
}

VERSION
{
Expand Down
15 changes: 8 additions & 7 deletions deploy.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

rem @echo off
@echo off

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

set H=%KSPDIR%
set H=R:\KSP_1.10.1_dev
set H=R:\dp0\kspdev

set GAMEDIR=000_ClickThroughBlocker
set GAMEDATA="GameData\"
set GAMEDATA=GameData
set VERSIONFILE=ClickThroughBlocker.version

set DP0=r:\dp0\kspdev

copy /Y "%1%2" "%GAMEDATA%\%GAMEDIR%\Plugins"
copy /Y "%1ClickThroughBlocker.pdb" "%GAMEDATA%\%GAMEDIR%\Plugins"
copy /Y "%1%3".pdb "%GAMEDATA%\%GAMEDIR%\Plugins

copy /Y %VERSIONFILE% %GAMEDATA%\%GAMEDIR%
copy /y changelog.cfg %GAMEDATA%\%GAMEDIR%
xcopy /y /s /I %GAMEDATA%\%GAMEDIR% "%H%\GameData\%GAMEDIR%"

pause
xcopy /y /s /I %GAMEDATA%\%GAMEDIR% "%H%\GameData\%GAMEDIR%"
xcopy /y /s /I %GAMEDATA%\%GAMEDIR% "%DP0%\GameData\%GAMEDIR%"

0 comments on commit 41265e8

Please sign in to comment.