Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
  • Loading branch information
NaysKutzu committed Mar 10, 2024
1 parent 3f1d532 commit 6e67642
Show file tree
Hide file tree
Showing 30 changed files with 12,390 additions and 645 deletions.
20 changes: 10 additions & 10 deletions Forms/Controller/NewDatabase.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions Forms/Controller/NewDatabase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Pterodactyl.Handlers;
using Pterodactyl.Managers;
using RestSharp;
using System;
using System.Collections.Generic;
Expand All @@ -17,10 +18,22 @@ namespace Pterodactyl.Forms.Controller
public partial class NewDatabase : Form
{
private string ServerId;
private UIStyler styler;

public NewDatabase(string Serverid)
{
InitializeComponent();
this.ServerId = Serverid;
try
{
styler = new UIStyler();
styler.LoadFromYaml("styles.yaml");
styler.ApplyStyles(this);
}
catch (Exception ex)
{
Program.logger.Log(LogType.Error, "[UI] Failed to apply UI modification: \n" + ex.ToString());
}
}

private void lblclose_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -64,7 +77,7 @@ private void btnadddb_Click(object sender, EventArgs e)
else
{
Program.Alert("Error while creating your database!", FrmAlert.enmType.Error);
Program.logger.Log(Managers.LogType.Error, "[Forms.Controller.NewDatabase.cs]: " + response.ErrorMessage);
Program.logger.Log(Managers.LogType.Error, "[Forms.Controller.NewDatabase.cs]: " + response.Content);
FrmServerController x = new FrmServerController(ServerId);
x.Show();
this.Hide();
Expand All @@ -80,12 +93,7 @@ private void btnadddb_Click(object sender, EventArgs e)

private void NewDatabase_Load(object sender, EventArgs e)
{

if (RegistryHandler.GetSetting("AlwaysOnTop") == "true")
{
this.TopMost = true;
}

this.TopMost = true;
}
}
}
15 changes: 11 additions & 4 deletions Forms/FrmAlert.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@

using Pterodactyl.Handlers;
using Pterodactyl.Managers;
using Pterodactyl.Properties;
# pragma warning disable

namespace Pterodactyl.Forms
{
public partial class FrmAlert : Form
{
private UIStyler styler;

public FrmAlert()
{
InitializeComponent();
try {
styler = new UIStyler();
styler.LoadFromYaml("styles.yaml");
styler.ApplyStyles(this);
} catch (Exception ex)
{
Program.logger.Log(LogType.Error, "[UI] Failed to apply UI modification: \n"+ex.ToString());
}
}

private void FrmAlert_Load(object sender, EventArgs e)
Expand Down Expand Up @@ -66,7 +77,6 @@ private void timer1_Tick(object sender, EventArgs e)
base.Close();
}
break;

}

}
Expand Down Expand Up @@ -95,7 +105,6 @@ public void showAlert(string msg, enmType type)
}
this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5;


switch (type)
{
case enmType.Succes:
Expand All @@ -116,8 +125,6 @@ public void showAlert(string msg, enmType type)
break;
}



this.lblMsg.Text = msg;

this.Show();
Expand Down
12 changes: 12 additions & 0 deletions Forms/FrmInstallTools.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Pterodactyl.Handlers;
using Pterodactyl.Managers;
using System.IO;
using System.IO.Compression;
using System.Net.Http;
Expand All @@ -7,9 +8,20 @@ namespace Pterodactyl.Forms
{
public partial class FrmInstallTools : Form
{
private UIStyler styler;
public FrmInstallTools()
{
InitializeComponent();
try
{
styler = new UIStyler();
styler.LoadFromYaml("styles.yaml");
styler.ApplyStyles(this);
}
catch (Exception ex)
{
Program.logger.Log(LogType.Error, "[UI] Failed to apply UI modification: \n" + ex.ToString());
}
}

private void guna2Button1_Click(object sender, EventArgs e)
Expand Down
7 changes: 4 additions & 3 deletions Forms/FrmLoading.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 19 additions & 8 deletions Forms/FrmLoading.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

using Pterodactyl.Handlers;
using Pterodactyl.Managers;
using Pterodactyl.Properties;
using System.Diagnostics;
using System.Text.RegularExpressions;
Expand All @@ -8,9 +9,21 @@ namespace Pterodactyl.Forms
{
public partial class FrmLoading : Form
{
private UIStyler styler;

public FrmLoading()
{
InitializeComponent();
try
{
styler = new UIStyler();
styler.LoadFromYaml("styles.yaml");
styler.ApplyStyles(this);
}
catch (Exception ex)
{
Program.logger.Log(LogType.Error, "[UI] Failed to apply UI modification: \n" + ex.ToString());
}
}

private void lblexit_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -105,20 +118,13 @@ @echo off
}
private void FrmLoading_Load(object sender, EventArgs e)
{
LoadTheme();
CheckForUpdate();
if (RegistryHandler.GetSetting("AlwaysOnTop") == "true")
{
this.TopMost = true;
}
}
private void LoadTheme()
{
this.BackColor = Color.FromArgb(Managers.ThemeManager.background_r, Managers.ThemeManager.background_g, Managers.ThemeManager.background_b);
lblwarning.ForeColor = Color.FromArgb(Managers.ThemeManager.text_r, Managers.ThemeManager.text_g, Managers.ThemeManager.text_b);
lblappname.ForeColor = Color.FromArgb(Managers.ThemeManager.text_r, Managers.ThemeManager.text_g, Managers.ThemeManager.text_b);
lblexit.ForeColor = Color.FromArgb(Managers.ThemeManager.text_r, Managers.ThemeManager.text_g, Managers.ThemeManager.text_b);
}

public static async Task Download()
{
string releaseURL = "https://github.com/MythicalLTD/Pterodactyl-Desktop/releases/latest/download/PterodactylSetup.msi";
Expand Down Expand Up @@ -163,5 +169,10 @@ private void lblappname_Click(object sender, EventArgs e)
{

}

private void appicon_Click(object sender, EventArgs e)
{

}
}
}
Loading

0 comments on commit 6e67642

Please sign in to comment.