mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 12:05:14 -04:00
Fix 'classicalsharp has crashed' dialog being shown multiple times in the launcher.
This commit is contained in:
parent
a362366ef4
commit
819dfc434f
@ -70,6 +70,7 @@ namespace Launcher2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FocusedChanged( object sender, EventArgs e ) {
|
void FocusedChanged( object sender, EventArgs e ) {
|
||||||
|
if( Program.ShowingErrorDialog ) return;
|
||||||
MakeBackground();
|
MakeBackground();
|
||||||
Screen.Resize();
|
Screen.Resize();
|
||||||
}
|
}
|
||||||
|
@ -10,13 +10,20 @@ namespace Launcher2 {
|
|||||||
|
|
||||||
public static string AppDirectory;
|
public static string AppDirectory;
|
||||||
|
|
||||||
|
public static bool ShowingErrorDialog = false;
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main( string[] args ) {
|
static void Main( string[] args ) {
|
||||||
AppDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
AppDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||||
string logPath = Path.Combine( AppDirectory, "launcher.log" );
|
string logPath = Path.Combine( AppDirectory, "launcher.log" );
|
||||||
|
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
|
||||||
ErrorHandler.InstallHandler( logPath );
|
ErrorHandler.InstallHandler( logPath );
|
||||||
LauncherWindow window = new LauncherWindow();
|
LauncherWindow window = new LauncherWindow();
|
||||||
window.Run();
|
window.Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void UnhandledExceptionHandler( object sender, UnhandledExceptionEventArgs e ) {
|
||||||
|
ShowingErrorDialog = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user