Skip to content

Commit

Permalink
Repsect UI locking
Browse files Browse the repository at this point in the history
  • Loading branch information
ihsoft committed Sep 21, 2016
1 parent 6cc7450 commit 359991c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Source/CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### 1.0.3 dev
- [Enhacement] Don't act if UI or vessel switch input is locked.
7 changes: 5 additions & 2 deletions Source/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,11 @@ void OnGUI() {
/// <summary>Overridden from MonoBehavior.</summary>
/// <remarks>Tracks keys and mouse moveement.</remarks>
void Update() {
// Cancel any selection if game is paused or time warped. Block UI as well.
if (Mathf.Approximately(Time.timeScale, 0f) || Time.timeScale > 1f) {
// Cancel any selection if game is paused or time warped. Also check if vessel swicthing or UI
// in general are locked, this is a sign that some other plugin is being actively interacting
// with input. Cancel all EVS activities if it's the case.
if (Mathf.Approximately(Time.timeScale, 0f) || Time.timeScale > 1f
|| InputLockManager.IsLocked(ControlTypes.UI | ControlTypes.VESSEL_SWITCHING)) {
if (hoveredVessel != null) {
SetHoveredVessel(null);
}
Expand Down

0 comments on commit 359991c

Please sign in to comment.