Skip to content

Commit

Permalink
Add clickthrough blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav committed Jun 14, 2024
1 parent 9ee6924 commit 8abbafd
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 25 deletions.
5 changes: 3 additions & 2 deletions src/RealAntennasProject/MapUI/NetUIConfigurationWindow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using ClickThroughFix;
using System;
using UnityEngine;

namespace RealAntennas.MapUI
Expand All @@ -10,7 +11,7 @@ public class NetUIConfigurationWindow : MonoBehaviour

public void OnGUI()
{
winPos = GUILayout.Window(GetHashCode(), winPos, WindowGUI, ModTag, GUILayout.MinWidth(200));
winPos = ClickThruBlocker.GUILayoutWindow(GetHashCode(), winPos, WindowGUI, ModTag, GUILayout.MinWidth(200));
}

private void WindowGUI(int ID)
Expand Down
3 changes: 2 additions & 1 deletion src/RealAntennasProject/Network/ConnectionDebugger.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using UnityEngine;
using Unity.Mathematics;
using ClickThroughFix;


namespace RealAntennas.Network
Expand Down Expand Up @@ -34,7 +35,7 @@ public void OnGUI()
if (showUI)
{
GUI.skin = HighLogic.Skin;
Window = GUILayout.Window(GetHashCode(), Window, GUIDisplay, GUIName, HighLogic.Skin.window);
Window = ClickThruBlocker.GUILayoutWindow(GetHashCode(), Window, GUIDisplay, GUIName, HighLogic.Skin.window);
}
}
private void GUIDisplay(int windowID)
Expand Down
5 changes: 3 additions & 2 deletions src/RealAntennasProject/PlannerGUI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using ClickThroughFix;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
Expand Down Expand Up @@ -79,7 +80,7 @@ public void OnDestroy()
public void OnGUI()
{
GUI.skin = HighLogic.Skin;
Window = GUILayout.Window(GetHashCode(), Window, GUIDisplay, "Antenna Planning", windowStyle, GUILayout.Width(GUIWidth), GUILayout.Height(GUIHeight));
Window = ClickThruBlocker.GUILayoutWindow(GetHashCode(), Window, GUIDisplay, "Antenna Planning", windowStyle, GUILayout.Width(GUIWidth), GUILayout.Height(GUIHeight));
}

void GUIDisplay(int windowID)
Expand Down
29 changes: 15 additions & 14 deletions src/RealAntennasProject/RealAntennas.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,21 @@
<Compile Include="RACommNode.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
<Reference Include="Unity.Burst, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="Unity.Collections, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="Unity.Jobs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="Unity.Mathematics, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="UnityEngine.IMGUIModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="UnityEngine.InputLegacyModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="Assembly-CSharp" />
<Reference Include="Assembly-CSharp-firstpass" />
<Reference Include="ClickThroughBlocker" />
<Reference Include="System" />
<Reference Include="Unity.Burst" />
<Reference Include="Unity.Collections" />
<Reference Include="Unity.Jobs" />
<Reference Include="Unity.Mathematics" />
<Reference Include="UnityEngine" />
<Reference Include="UnityEngine.AnimationModule" />
<Reference Include="UnityEngine.CoreModule" />
<Reference Include="UnityEngine.IMGUIModule" />
<Reference Include="UnityEngine.InputLegacyModule" />
<Reference Include="UnityEngine.TextRenderingModule" />
<Reference Include="UnityEngine.UI" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
Expand Down
5 changes: 3 additions & 2 deletions src/RealAntennasProject/RealAntennasUI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using KSP.UI.Screens;
using ClickThroughFix;
using KSP.UI.Screens;
using System;
using System.Collections.Generic;
using UnityEngine;
Expand Down Expand Up @@ -55,7 +56,7 @@ public void OnGUI()
{
if (showUI)
{
winPos = GUILayout.Window(GetHashCode(), winPos, WindowGUI, modName, GUILayout.MinWidth(200));
winPos = ClickThruBlocker.GUILayoutWindow(GetHashCode(), winPos, WindowGUI, modName, GUILayout.MinWidth(200));
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/RealAntennasProject/Targeting/AntennaTargetGUI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using ClickThroughFix;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using static RealAntennas.Targeting.AntennaTarget;
Expand Down Expand Up @@ -30,7 +31,7 @@ public void Start()
public void OnGUI()
{
GUI.skin = HighLogic.Skin;
Window = GUILayout.Window(GetHashCode(), Window, GUIDisplay, GUIName, HighLogic.Skin.window);
Window = ClickThruBlocker.GUILayoutWindow(GetHashCode(), Window, GUIDisplay, GUIName, HighLogic.Skin.window);
}

void GUIDisplay(int windowID)
Expand Down
5 changes: 3 additions & 2 deletions src/RealAntennasProject/Targeting/RemoteAntennaControlUI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using ClickThroughFix;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

Expand All @@ -22,7 +23,7 @@ public void Start()
public void OnGUI()
{
GUI.skin = HighLogic.Skin;
Window = GUILayout.Window(GetHashCode(), Window, GUIDisplay, GUIName, HighLogic.Skin.window);
Window = ClickThruBlocker.GUILayoutWindow(GetHashCode(), Window, GUIDisplay, GUIName, HighLogic.Skin.window);
}

void GUIDisplay(int windowID)
Expand Down

0 comments on commit 8abbafd

Please sign in to comment.