mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-07-03 14:24:34 +00:00
Added 'Internals' folder to project and moved SkinANIM, SkinBox, CommitInfo and ProgramInfo(ApplicationBuildInfo now) into 'Internals'
This commit is contained in:
@@ -1,63 +1,10 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace PckStudio
|
||||
{
|
||||
sealed class ProgramInfo
|
||||
{
|
||||
// this is to specify which build release this is. This is manually updated for now
|
||||
// TODO: add different chars for different configurations
|
||||
private const string BuildType = "b";
|
||||
private static System.Globalization.Calendar _buildCalendar;
|
||||
private DateTime date = new FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
|
||||
|
||||
public string BetaBuildVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
// adopted Minecraft Java Edition Snapshot format (YYwWWn)
|
||||
// to keep better track of work in progress features and builds
|
||||
_buildCalendar ??= new System.Globalization.CultureInfo("en-US").Calendar;
|
||||
return string.Format("#{0}w{1}{2}",
|
||||
date.ToString("yy"),
|
||||
_buildCalendar.GetWeekOfYear(date, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday),
|
||||
BuildType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class CommitInfo
|
||||
{
|
||||
private static string _branchName = null;
|
||||
private static string _commitHash = null;
|
||||
|
||||
public static string BranchName
|
||||
{
|
||||
get
|
||||
{
|
||||
return _branchName ??= Assembly
|
||||
.GetEntryAssembly()
|
||||
.GetCustomAttributes<AssemblyMetadataAttribute>()
|
||||
.FirstOrDefault(attr => attr.Key == "GitBranch")?.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public static string CommitHash
|
||||
{
|
||||
get
|
||||
{
|
||||
return _commitHash ??= Assembly
|
||||
.GetEntryAssembly()
|
||||
.GetCustomAttributes<AssemblyMetadataAttribute>()
|
||||
.FirstOrDefault(attr => attr.Key == "GitHash")?.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class Program
|
||||
{
|
||||
public static readonly string ProjectUrl = "https://github.com/PhoenixARC/-PCK-Studio";
|
||||
@@ -66,8 +13,6 @@ namespace PckStudio
|
||||
public static readonly string AppData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "PCK-Studio");
|
||||
public static readonly string AppDataCache = Path.Combine(AppData, "cache");
|
||||
|
||||
public static readonly ProgramInfo Info = new ProgramInfo();
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user