diff --git a/ClickableTransparentOverlay/ClickableTransparentOverlay.csproj b/ClickableTransparentOverlay/ClickableTransparentOverlay.csproj index 5155f54..27b0907 100644 --- a/ClickableTransparentOverlay/ClickableTransparentOverlay.csproj +++ b/ClickableTransparentOverlay/ClickableTransparentOverlay.csproj @@ -2,6 +2,7 @@ netstandard2.0 + true 1.0.1 Zaafar @@ -29,7 +30,7 @@ - + diff --git a/ClickableTransparentOverlay/NativeMethods.cs b/ClickableTransparentOverlay/NativeMethods.cs index 7aa3800..ffc3c69 100644 --- a/ClickableTransparentOverlay/NativeMethods.cs +++ b/ClickableTransparentOverlay/NativeMethods.cs @@ -17,7 +17,7 @@ namespace ClickableTransparentOverlay private const int SW_HIDE = 0x00; private const int SW_SHOW = 0x05; - public static bool IsClickable = true; + private static bool isClickable = true; private static IntPtr GWL_EXSTYLE_CLICKABLE = IntPtr.Zero; private static IntPtr GWL_EXSTYLE_NOT_CLICKABLE = IntPtr.Zero; @@ -47,16 +47,16 @@ namespace ClickableTransparentOverlay /// Set to true if you want to make the window clickable otherwise false. internal static void SetOverlayClickable(IntPtr handle, bool WantClickable) { - if (!IsClickable && WantClickable) + if (!isClickable && WantClickable) { SetWindowLongPtr(handle, GWL_EXSTYLE, GWL_EXSTYLE_CLICKABLE); SetFocus(handle); - IsClickable = true; + isClickable = true; } - else if(IsClickable && !WantClickable) + else if(isClickable && !WantClickable) { SetWindowLongPtr(handle, GWL_EXSTYLE, GWL_EXSTYLE_NOT_CLICKABLE); - IsClickable = false; + isClickable = false; } } diff --git a/ClickableTransparentOverlay/Overlay.cs b/ClickableTransparentOverlay/Overlay.cs index 4ad9fc9..e0b4000 100644 --- a/ClickableTransparentOverlay/Overlay.cs +++ b/ClickableTransparentOverlay/Overlay.cs @@ -27,24 +27,6 @@ namespace ClickableTransparentOverlay /// /// Initializes a new instance of the class. /// - /// - /// x position of the overlay. - /// - /// - /// y position of the overlay. - /// - /// - /// width of the overlay. - /// - /// - /// height of the Overlay. - /// - /// - /// fps of the overlay. - /// - /// - /// In this mode, overlay will not hide the Console. - /// static Overlay() { clearColor = new Vector4(0.00f, 0.00f, 0.00f, 0.00f); @@ -78,6 +60,9 @@ namespace ClickableTransparentOverlay NativeMethods.SetOverlayClickable(window.Handle, false); } + /// + /// Infinitely renders the over (and execute co-routines) till it's closed. + /// public static void RunInfiniteLoop() { DateTime previous = DateTime.Now; @@ -129,6 +114,9 @@ namespace ClickableTransparentOverlay /// public static bool Visible { get; set; } = true; + /// + /// Gets or sets a value indicating whether to hide the terminal window. + /// public static bool TerminalWindow { get => terminal; diff --git a/DriverProgram/Program.cs b/DriverProgram/Program.cs index a2830b9..40c4586 100644 --- a/DriverProgram/Program.cs +++ b/DriverProgram/Program.cs @@ -29,11 +29,11 @@ namespace DriverProgram Overlay.RunInfiniteLoop(); } - private static IEnumerator SubmitRenderLogic() + private static IEnumerator SubmitRenderLogic() { while (true) { - yield return new WaitEvent(Overlay.OnRender); + yield return new Wait(Overlay.OnRender); if (NativeMethods.IsKeyPressed(0x7B)) //F12. { @@ -122,7 +122,7 @@ namespace DriverProgram // Time Based Coroutines are executed even when the Overlay is invisible. // So in case there is a reason you want to hide the overlay, u can use timebased // coroutines to bring it back. - CoroutineHandler.InvokeLater(new WaitSeconds(seconds), () => { Overlay.Visible = true; }); + CoroutineHandler.InvokeLater(new Wait(seconds), () => { Overlay.Visible = true; }); } ImGui.NewLine(); @@ -153,11 +153,11 @@ namespace DriverProgram } } - private static IEnumerator UpdateOverlaySample2() + private static IEnumerator UpdateOverlaySample2() { while (true) { - yield return new WaitSeconds(1); + yield return new Wait(1); for (int i = 0; i < circleCenters.Length; i++) { circleCenters[i].X = randomGen.Next(0, 2560);