Novetus_src/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs

106 lines
3.2 KiB
C#
Raw Normal View History

2021-11-13 22:56:56 +02:00
using NLog;
using System;
2021-06-04 22:58:40 +03:00
using System.Drawing;
using System.Drawing.Text;
using System.Windows.Forms;
namespace Novetus.Bootstrapper
2021-06-04 22:58:40 +03:00
{
public partial class NovetusLaunchForm : Form
{
public NovetusLaunchForm()
{
InitializeComponent();
}
private void NovetusLaunchForm_Load(object sender, EventArgs e)
{
2022-09-13 00:26:34 +03:00
FileManagement.ReadInfoFile(LocalPaths.InfoPath, true, LocalPaths.LauncherPath);
ReadConfigValues(LocalPaths.ConfigPath);
if (GlobalVars.UserConfiguration.BootstrapperShowUI)
2021-11-07 16:29:26 +02:00
{
//use novetus font for label!!
2021-11-07 16:29:26 +02:00
//dammit windows 11...
/*GlobalFuncs.LogPrint("Loading Font...");
try
2021-11-07 16:29:26 +02:00
{
PrivateFontCollection pfc = new PrivateFontCollection();
string fontPath = LocalPaths.FixedDataDir + "\\BootstrapperFont.ttf";
pfc.AddFontFile(fontPath);
foreach (var fam in pfc.Families)
{
VersionLabel.Font = new Font(fam, VersionLabel.Font.Size);
LaunchNovetusButton.Font = new Font(fam, VersionLabel.Font.Size);
}
GlobalFuncs.LogPrint("Font Loaded");
2021-11-07 16:29:26 +02:00
}
catch (Exception ex)
{
GlobalFuncs.LogExceptions(ex);
}*/
VersionLabel.Text = GlobalVars.ProgramInformation.Version.ToUpper();
CenterToScreen();
2021-11-07 16:29:26 +02:00
}
else
2021-11-07 16:29:26 +02:00
{
LaunchNovetus();
}
}
2021-06-04 22:58:40 +03:00
void ReadConfigValues(string cfgpath)
{
2022-09-13 00:26:34 +03:00
FileManagement.Config(cfgpath, false);
LauncherBox.Checked = !GlobalVars.UserConfiguration.BootstrapperShowUI;
2021-06-04 22:58:40 +03:00
}
private void LaunchNovetusButton_Click(object sender, EventArgs e)
{
LaunchNovetus();
}
private void LaunchNovetus()
2021-06-04 22:58:40 +03:00
{
LocalFuncs.LaunchApplication(LocalPaths.LauncherName);
Close();
}
private void LaunchSDKButton_Click(object sender, EventArgs e)
{
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-sdk");
Close();
}
private void CMDButton_Click(object sender, EventArgs e)
{
2022-09-15 20:45:30 +03:00
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmd -cmdmode " + ArgBox.Text);
2021-06-04 22:58:40 +03:00
Close();
}
private void CMDHelpButton_Click(object sender, EventArgs e)
{
2022-09-15 19:46:16 +03:00
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmd -help");
2021-06-04 22:58:40 +03:00
}
private void DependencyInstallerButton_Click(object sender, EventArgs e)
{
LocalFuncs.LaunchApplicationExt(GlobalPaths.BasePathLauncher, LocalPaths.DependencyLauncherName);
2021-06-04 22:58:40 +03:00
Close();
}
private void URIButton_Click(object sender, EventArgs e)
{
LocalFuncs.LaunchApplication(LocalPaths.URIName);
Close();
}
private void LauncherBox_CheckedChanged(object sender, EventArgs e)
{
GlobalVars.UserConfiguration.BootstrapperShowUI = !LauncherBox.Checked;
}
2021-06-04 22:58:40 +03:00
}
}