Novetus_src/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs

126 lines
3.9 KiB
C#
Raw Normal View History

2024-05-15 19:29:07 +03:00
using Novetus.Core;
2021-11-13 22:56:56 +02:00
using System;
2021-06-04 22:58:40 +03:00
using System.Drawing;
using System.Drawing.Text;
2023-04-14 19:00:12 +03:00
using System.IO;
2021-06-04 22:58:40 +03:00
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)
{
2023-12-12 01:47:03 +02:00
FileManagement.ReadInfoFile(LocalPaths.InfoPath,
LocalPaths.VersionTermList,
LocalPaths.LauncherPath);
if (File.Exists(LocalPaths.ConfigPath))
{
2023-04-14 19:00:12 +03:00
ReadConfigValues(LocalPaths.ConfigPath);
}
if (GlobalVars.UserConfiguration.ReadSettingBool("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);
}*/
2023-04-14 19:00:12 +03:00
if (File.Exists(LocalPaths.ConfigPath))
{
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)
{
LauncherBox.Checked = !GlobalVars.UserConfiguration.ReadSettingBool("BootstrapperShowUI");
2021-06-04 22:58:40 +03:00
}
private void LaunchNovetusButton_Click(object sender, EventArgs e)
{
LaunchNovetus();
}
private void LaunchNovetus()
2022-09-18 17:59:32 +03:00
{
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-nocmd");
Close();
}
private void LaunchNovetusWithConsoleButton_Click(object sender, EventArgs e)
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)
{
2023-05-19 03:25:05 +03:00
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmdonly " + ArgBox.Text);
2021-06-04 22:58:40 +03:00
Close();
}
private void CMDHelpButton_Click(object sender, EventArgs e)
{
2022-09-18 17:59:32 +03:00
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmdonly -help");
2021-06-04 22:58:40 +03:00
}
private void DependencyInstallerButton_Click(object sender, EventArgs e)
{
2024-05-15 19:29:07 +03:00
LocalFuncs.LaunchApplicationExt(GlobalPaths.BasePath, 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.SaveSettingBool("BootstrapperShowUI", !LauncherBox.Checked);
}
2023-05-19 03:25:05 +03:00
private void CMDBarebonesButton_Click(object sender, EventArgs e)
{
LocalFuncs.LaunchApplication(LocalPaths.LauncherName, "-cmdonly " + ArgBox.Text);
}
2021-06-04 22:58:40 +03:00
}
}