From 0b56b1ab1c44e61abc9caaa0963b0d889330b06b Mon Sep 17 00:00:00 2001 From: JacobTech Date: Mon, 18 Nov 2024 11:17:34 -0500 Subject: [PATCH] New Toggle --- .../Pages/Server/Roles/ServerRoleOptions.cs | 6 +++--- Luski/GUI/MainScreenWindow.cs | 11 +++++++++++ Luski/Luski.csproj | 2 +- Luski/LuskiExperiments.cs | 16 +++++++++++++++- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Luski/GUI/MainScreen/UI/PublicServers/ServerSettings/Pages/Server/Roles/ServerRoleOptions.cs b/Luski/GUI/MainScreen/UI/PublicServers/ServerSettings/Pages/Server/Roles/ServerRoleOptions.cs index 566a4ba..a9f3da0 100644 --- a/Luski/GUI/MainScreen/UI/PublicServers/ServerSettings/Pages/Server/Roles/ServerRoleOptions.cs +++ b/Luski/GUI/MainScreen/UI/PublicServers/ServerSettings/Pages/Server/Roles/ServerRoleOptions.cs @@ -118,7 +118,7 @@ public class ServerRoleOptions : UserControl SelectedLine.Size = new(Display.Size.X, Line.Size.Y); SelectedLine.Location = new(Display.Location.X, Line.Location.Y); Page.Controls.Clear(); - Window!.TryDraw(); + TryDraw(); } private ServerPermission TempPermissions = ServerPermission.None; @@ -197,7 +197,7 @@ public class ServerRoleOptions : UserControl Page.ScrollValue = scrval.Value; } BlockDraw = false; - Window!.TryDraw(); + TryDraw(); } private async Task PermissionSave() @@ -239,7 +239,7 @@ public class ServerRoleOptions : UserControl }); } BlockDraw = false; - Window!.TryDraw(); + TryDraw(); } private Role r; diff --git a/Luski/GUI/MainScreenWindow.cs b/Luski/GUI/MainScreenWindow.cs index b9b6fd9..9673733 100644 --- a/Luski/GUI/MainScreenWindow.cs +++ b/Luski/GUI/MainScreenWindow.cs @@ -121,6 +121,17 @@ public class MainScreenWindow : Window UseSubFrames = b; return Task.CompletedTask; }; + + if (LuskiExperiments.GUI.LiveViews.IsEnabled()) + { + UseLiveView = true; + } + + LuskiExperiments.GUI.LiveViews.EventToggled += b => + { + UseLiveView = b; + return Task.CompletedTask; + }; Globals.ms = this; SetWindowSize(new(1332.ScaleInt(), 866.ScaleInt())); Shader s = new Shader("Luski.Resources.Shaders.LeftToRightLabel", Embeded: true, Assembly: Assembly.GetExecutingAssembly()); diff --git a/Luski/Luski.csproj b/Luski/Luski.csproj index 4d8e3b8..ccc46b5 100644 --- a/Luski/Luski.csproj +++ b/Luski/Luski.csproj @@ -22,7 +22,7 @@ - + diff --git a/Luski/LuskiExperiments.cs b/Luski/LuskiExperiments.cs index 85c9f76..38c32a7 100644 --- a/Luski/LuskiExperiments.cs +++ b/Luski/LuskiExperiments.cs @@ -34,6 +34,15 @@ public static class LuskiExperiments { GUI.BufferCopy } + }, + new() + { + DisplayName = "Live View", + Name = "2024_11_live_view", + Options = new() + { + GUI.LiveViews + } } }; @@ -95,12 +104,17 @@ public static class LuskiExperiments public static readonly ExperimentSelectorInfo SubFrames = new() { Name = "Sub Frames", - Description = "Speeds up rendering controls by smaller area.", RequiresRestart = false + Description = "Speeds up rendering controls by drawing to smaller area.", RequiresRestart = false }; public static readonly ExperimentSelectorInfo BufferCopy = new() { Name = "Buffer Copy", Description = "Speeds up rendering controls during resize by copying from the GPU", RequiresRestart = false }; + public static readonly ExperimentSelectorInfo LiveViews = new() + { + Name = "Live Views", + Description = "Speeds up rendering controls by checking in on GPU", RequiresRestart = false + }; } } \ No newline at end of file