mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
commit really safe for work
crash handler now shows assemblyname and assemblydescription
This commit is contained in:
parent
c7a50f87ef
commit
d90ea0ba01
2 changed files with 21 additions and 1 deletions
|
@ -48,6 +48,7 @@ namespace ShiftOS.WinForms
|
|||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
//if ANYONE puts code before those two winforms config lines they will be declared a drunky. - Michael
|
||||
CrashHandler.SetGameMetadata(Assembly.GetExecutingAssembly());
|
||||
SkinEngine.SetIconProber(new ShiftOSIconProvider());
|
||||
ShiftOS.Engine.AudioManager.Init(new ShiftOSAudioProvider());
|
||||
Localization.RegisterProvider(new WFLanguageProvider());
|
||||
|
|
|
@ -109,7 +109,10 @@ namespace ShiftOS.Engine
|
|||
System.IO.FileInfo fileInfo = new System.IO.FileInfo(assembly.Location);
|
||||
DateTime lastModified = fileInfo.LastWriteTime;
|
||||
|
||||
string rtbcrash_Text = $@" === ShiftOS has crashed ===
|
||||
string rtbcrash_Text = $@" === {AssemblyName} has crashed. ===
|
||||
|
||||
Game: {AssemblyName}
|
||||
Description: {AssemblyDescription}
|
||||
|
||||
Basic Information For User:
|
||||
---------------------------------
|
||||
|
@ -195,5 +198,21 @@ Stack trace:
|
|||
this.Close();
|
||||
Application.Restart();
|
||||
}
|
||||
|
||||
public static string AssemblyName { get; private set; }
|
||||
public static string AssemblyDescription { get; private set; }
|
||||
|
||||
public static void SetGameMetadata(Assembly assembly)
|
||||
{
|
||||
AssemblyName = assembly.GetName().Name;
|
||||
foreach(var attr in assembly.GetCustomAttributes(true))
|
||||
{
|
||||
if(attr is AssemblyDescriptionAttribute)
|
||||
{
|
||||
AssemblyDescription = (attr as AssemblyDescriptionAttribute).Description;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue