mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-16 19:14:15 -04:00
[GUI] Add "About" window & update titles
This commit is contained in:
77
AssetStudioGUI/AboutForm.cs
Normal file
77
AssetStudioGUI/AboutForm.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AssetStudioGUI
|
||||
{
|
||||
public partial class AboutForm : Form
|
||||
{
|
||||
public AboutForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
var productName = Application.ProductName;
|
||||
var arch = Environment.Is64BitProcess ? "x64" : "x32";
|
||||
Text += " " + productName;
|
||||
productTitleLabel.Text = productName;
|
||||
productVersionLabel.Text = $"v{Application.ProductVersion} [{arch}]";
|
||||
productNamelabel.Text = productName;
|
||||
modVersionLabel.Text = Application.ProductVersion;
|
||||
|
||||
licenseRichTextBox.Text = GetLicenseText();
|
||||
}
|
||||
|
||||
private string GetLicenseText()
|
||||
{
|
||||
string license = "MIT License";
|
||||
|
||||
if (File.Exists("LICENSE"))
|
||||
{
|
||||
string text = File.ReadAllText("LICENSE");
|
||||
license = text.Replace("\r", "")
|
||||
.Replace("\n\n", "\r")
|
||||
.Replace("\nCopyright", "\tCopyright")
|
||||
.Replace("\n", " ")
|
||||
.Replace("\r", "\n\n")
|
||||
.Replace("\tCopyright", "\nCopyright");
|
||||
}
|
||||
|
||||
return license;
|
||||
}
|
||||
|
||||
private void checkUpdatesLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var ps = new ProcessStartInfo("https://github.com/aelurum/AssetStudio/releases")
|
||||
{
|
||||
UseShellExecute = true
|
||||
};
|
||||
Process.Start(ps);
|
||||
}
|
||||
|
||||
private void gitPerfareLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var ps = new ProcessStartInfo("https://github.com/Perfare")
|
||||
{
|
||||
UseShellExecute = true
|
||||
};
|
||||
Process.Start(ps);
|
||||
}
|
||||
|
||||
private void gitAelurumLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
var ps = new ProcessStartInfo("https://github.com/aelurum")
|
||||
{
|
||||
UseShellExecute = true
|
||||
};
|
||||
Process.Start(ps);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user