Message box when default.zip missing

This commit is contained in:
UnknownShadow200 2017-05-14 11:56:51 +10:00
parent a5d3dcf73b
commit 424ba46364

View File

@ -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;