-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed inputlocks not being cleared when canceling the window
Added mode toggle on new button to allow toggling between different modes during the game Updated settings to make it clear if popup will be shown next time in the space center Added code to disable the ShowPopup flag if the focusFollowsClick is changed in the settings Thanks to github user @SteveBenz for this: Make the configuration file not depend on Environment.CurrentDirectory and instead depend on the deployment location of the DLL
- Loading branch information
1 parent
0d6f96d
commit bf690f9
Showing
22 changed files
with
232 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
"MAJOR": 0, | ||
"MINOR": 1, | ||
"PATCH": 10, | ||
"BUILD": 12 | ||
"BUILD": 13 | ||
}, | ||
"KSP_VERSION_MIN": { | ||
"MAJOR": 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
|
||
using System.Reflection; | ||
|
||
[assembly: AssemblyVersion("0.1.10.11")] | ||
[assembly: AssemblyVersion("0.1.10.12")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
using UnityEngine; | ||
using KSP.UI.Screens; | ||
|
||
#if !DUMMY | ||
namespace ClickThroughFix | ||
{ | ||
//[KSPAddon(KSPAddon.Startup.SpaceCentre, true)] | ||
[KSPAddon(KSPAddon.Startup.EditorAny, false)] | ||
class CBTMonitor : MonoBehaviour | ||
{ | ||
void Start() | ||
{ | ||
//DontDestroyOnLoad(this); | ||
// GameEvents.onGameSceneLoadRequested.Add(onGameSceneLoadRequested); | ||
ClickThruBlocker.CTBWin.activeBlockerCnt = 0; | ||
} | ||
|
||
void onGameSceneLoadRequested(GameScenes gs) | ||
{ | ||
ClickThruBlocker.CTBWin.activeBlockerCnt = 0; | ||
} | ||
|
||
// this whole mess below is to work around a stock bug. | ||
// The bug is that the editor ignores the lock when the Action Group pane is show. | ||
// So we have to each time, clear all locks and then reset those which were active when | ||
// the mouse moved over a protected window | ||
void Update() | ||
{ | ||
if (HighLogic.CurrentGame == null || | ||
HighLogic.CurrentGame.Parameters.CustomParams<CTB>().focusFollowsclick) // || | ||
//(!HighLogic.CurrentGame.Parameters.CustomParams<CTB>().focusFollowsclick && !HighLogic.LoadedSceneIsEditor)) | ||
return; | ||
{ | ||
if (ClickThruBlocker.CTBWin.activeBlockerCnt > 0) | ||
{ | ||
//Log.Info("Setting Mouse.HoveredPart to null & deselecting all parts"); | ||
Mouse.HoveredPart = null; | ||
|
||
if (EditorLogic.fetch == null) | ||
{ | ||
return; | ||
} | ||
|
||
for (int i = EditorLogic.fetch.ship.Parts.Count - 1; i >= 0; i--) | ||
//for (int i = 0; i < EditorLogic.fetch.ship.Parts.Count; i++) | ||
{ | ||
EditorActionPartSelector selector = EditorLogic.fetch.ship.Parts[i].GetComponent<EditorActionPartSelector>(); | ||
if (selector != null) | ||
selector.Deselect(); | ||
} | ||
|
||
if (EditorActionGroups.Instance != null) | ||
{ | ||
EditorActionGroups.Instance.ClearSelection(true); | ||
for (int i = ClickThruBlocker.CTBWin.selectedParts.Count - 1; i >= 0; i--) | ||
//for (int i = 0; i < ClickThruBlocker.CTBWin.selectedParts.Count; i++) | ||
{ | ||
EditorActionPartSelector selector = ClickThruBlocker.CTBWin.selectedParts[i].GetComponent<EditorActionPartSelector>(); | ||
if (selector != null) | ||
EditorActionGroups.Instance.AddToSelection(selector); | ||
} | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
//static internal long timeTics = 0; | ||
int d; | ||
void LateUpdate() | ||
{ | ||
if (HighLogic.CurrentGame == null || | ||
HighLogic.CurrentGame.Parameters.CustomParams<CTB>().focusFollowsclick) // || | ||
//(!HighLogic.CurrentGame.Parameters.CustomParams<CTB>().focusFollowsclick && !HighLogic.LoadedSceneIsEditor)) | ||
return; | ||
|
||
d = 0; | ||
ClickThruBlocker.CTBWin win = null; | ||
{ | ||
foreach (var w in ClickThruBlocker.winList) | ||
{ | ||
if (w.Value.lastUpdated + 4 < CBTGlobalMonitor.globalTimeTics) //+ 0.05 < Planetarium.GetUniversalTime()) | ||
{ | ||
d = w.Key; | ||
win = w.Value; | ||
break; | ||
} | ||
} | ||
if (d != 0) | ||
{ | ||
win.OnDestroy(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.