From 424ba46364d0d5c1ca66f8720aef243046af411c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 14 May 2017 11:56:51 +1000 Subject: [PATCH] Message box when default.zip missing --- ClassicalSharp/Program.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ClassicalSharp/Program.cs b/ClassicalSharp/Program.cs index 45dbef230..e87d6e94b 100644 --- a/ClassicalSharp/Program.cs +++ b/ClassicalSharp/Program.cs @@ -2,6 +2,7 @@ using System; using System.IO; using System.Net; +using System.Windows.Forms; using ClassicalSharp.Textures; using OpenTK; @@ -24,8 +25,7 @@ namespace ClassicalSharp { Utils.LogDebug("Starting " + AppName + ".."); string path = Path.Combine(Program.AppDirectory, TexturePack.Dir); if (!File.Exists(Path.Combine(path, "default.zip"))) { - Utils.LogDebug("default.zip not found. Cannot start."); - return; + MessageDefaultZipMissing(); return; } bool nullContext = true; @@ -48,6 +48,11 @@ namespace ClassicalSharp { } } + // put in separate function, because we don't want to load winforms assembly if possible + static void MessageDefaultZipMissing() { + MessageBox.Show("default.zip not found, try running the launcher first.", "Missing file"); + } + static void SelectResolution(out int width, out int height) { DisplayDevice device = DisplayDevice.Default; width = 640; height = 480;