Skip to content

Commit

Permalink
Vuln Patching + UI Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
xxbeefydjxx committed Nov 5, 2024
1 parent b1f00ff commit 96116e6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Pandora/Pandora.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentFTP" Version="46.0.2" />
<PackageReference Include="ImGui.NET" Version="1.89.5" />
<PackageReference Include="FluentFTP" Version="51.1.0" />
<PackageReference Include="ImGui.NET" Version="1.89.6" />
<PackageReference Include="ManagedBass" Version="3.1.1" />
<PackageReference Include="OpenTK" Version="4.7.7" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
<PackageReference Include="OpenTK" Version="4.8.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
</ItemGroup>

<ItemGroup>
Expand Down
40 changes: 28 additions & 12 deletions Pandora/UI/ApplicationUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Runtime.InteropServices;
using OpenTK.Windowing.GraphicsLibraryFramework;
using System;
using SixLabors.ImageSharp.PixelFormats;

namespace Pandora
{
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand All @@ -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)
Expand All @@ -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";
}
}
}
1 change: 1 addition & 0 deletions Pandora/UI/ImGuiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Pandora.Helpers;
using OpenTK.Windowing.Desktop;
using OpenTK.Windowing.GraphicsLibraryFramework;
using SixLabors.ImageSharp.PixelFormats;

namespace Pandora
{
Expand Down

0 comments on commit 96116e6

Please sign in to comment.