From 96116e6a536b04168c099fec62093b4149880e31 Mon Sep 17 00:00:00 2001 From: xXBeefyDjXx Date: Tue, 5 Nov 2024 23:32:48 +0000 Subject: [PATCH] Vuln Patching + UI Improvement --- Pandora/Pandora.csproj | 8 +++---- Pandora/UI/ApplicationUI.cs | 40 ++++++++++++++++++++++++----------- Pandora/UI/ImGuiController.cs | 1 + 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/Pandora/Pandora.csproj b/Pandora/Pandora.csproj index 5ce2af7..c544ca1 100644 --- a/Pandora/Pandora.csproj +++ b/Pandora/Pandora.csproj @@ -57,11 +57,11 @@ - - + + - - + + diff --git a/Pandora/UI/ApplicationUI.cs b/Pandora/UI/ApplicationUI.cs index ae3a827..02ea4a8 100644 --- a/Pandora/UI/ApplicationUI.cs +++ b/Pandora/UI/ApplicationUI.cs @@ -8,6 +8,7 @@ using System.Runtime.InteropServices; using OpenTK.Windowing.GraphicsLibraryFramework; using System; +using SixLabors.ImageSharp.PixelFormats; namespace Pandora { @@ -41,6 +42,7 @@ public LogDetail(string logType, string message) private int m_dialupHandle; private int m_disconnectHandle; private string m_version; + private string connect_ButtonStatus = "Connect"; public string LocalSelectedFolder { get; set; } = Utility.GetApplicationPath() ?? string.Empty; @@ -247,9 +249,11 @@ private void RenderUI() ImGui.SetWindowSize(GetScaledWindowSize()); ImGui.SetWindowPos(new Vector2(0, 0), ImGuiCond.Always); - ImGui.Text("Log:"); - var windowSize = ImGui.GetWindowSize(); + var halfWidth = (int)(windowSize.X / 2); + + ImGui.SetCursorPos(new Vector2(halfWidth - 15, 5)); + ImGui.Text("Log"); ImGuiTableFlags flags = ImGuiTableFlags.Resizable | ImGuiTableFlags.ScrollX | ImGuiTableFlags.ScrollY | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.RowBg; if (ImGui.BeginTable("tableLog", 2, flags, new Vector2(windowSize.X - 16, 170), 0.0f)) @@ -295,12 +299,11 @@ private void RenderUI() ImGui.Spacing(); - var halfWidth = (int)(windowSize.X / 2); - - ImGui.Text("Local:"); + ImGui.SetCursorPosX((halfWidth / 2) - 15); + ImGui.Text("Local"); ImGui.SameLine(); - ImGui.SetCursorPosX(halfWidth); - ImGui.Text("Remote:"); + ImGui.SetCursorPosX((halfWidth + halfWidth / 2) - 15); + ImGui.Text("Remote"); ImGui.Spacing(); @@ -453,8 +456,8 @@ private void RenderUI() } ImGui.Spacing(); - - ImGui.Text("Downloads:"); + ImGui.SetCursorPosX(halfWidth - 33); + ImGui.Text("Downloads"); if (ImGui.BeginTable("tableDownloads", 4, flags, new Vector2(windowSize.X - 16, 100), 0.0f)) { @@ -516,13 +519,23 @@ private void RenderUI() if (m_client != null) { - if (ImGui.Button("Disconnect", new Vector2(100, 30))) + /* + if (m_config.HasFTPDetails()) + { + connect_ButtonStatus = "Connecting"; + } + else + { + connect_ButtonStatus = "Disconnect"; + } + */ + if (ImGui.Button(connect_ButtonStatus, new Vector2(100, 30))) { m_client?.Dispose(); m_client = null; } } - else if (ImGui.Button("Connect", new Vector2(100, 30))) + else if (ImGui.Button(connect_ButtonStatus, new Vector2(100, 30))) { m_logDetails.Clear(); m_logDetailsChanged = true; @@ -599,7 +612,7 @@ private void RenderUI() } ImGui.SetCursorPos(new Vector2(windowSize.X - 273, windowSize.Y - 32)); - ImGui.Text("Coded by EqUiNoX"); + ImGui.Text("By Team Resurgent"); ImGui.End(); } @@ -609,6 +622,7 @@ private void OnConnecting(object sender, string message) Bass.ChannelStop(m_disconnectHandle); Bass.ChannelPlay(m_dialupHandle); LogMessage("Connecting...", message); + connect_ButtonStatus = "Connecting"; } private void OnError(object sender, string error) @@ -633,11 +647,13 @@ private void OnDisconnected(object sender) LogMessage("Disconnected", "Bye!"); m_client?.Dispose(); m_client = null; + connect_ButtonStatus = "Connect"; } private void OnConnected(object sender) { m_cachedRemoteFileInfo = null; + connect_ButtonStatus = "Disconnect"; } } } diff --git a/Pandora/UI/ImGuiController.cs b/Pandora/UI/ImGuiController.cs index 637a76d..ffc98eb 100644 --- a/Pandora/UI/ImGuiController.cs +++ b/Pandora/UI/ImGuiController.cs @@ -8,6 +8,7 @@ using Pandora.Helpers; using OpenTK.Windowing.Desktop; using OpenTK.Windowing.GraphicsLibraryFramework; +using SixLabors.ImageSharp.PixelFormats; namespace Pandora {