Commits

Maxim Roncace committed ccc5f78

Fix annoying "missing button" bug on first launch
Add custom title to launcher window (that wasn't there already?)

Comments (0)

Files changed (1)

MineFlat Launcher/src/Launcher.java

 	 */
 	public static final String 	LIB_LOCATION = "http://slick.ninjacave.com/slick.zip";
 	/**
-	 * The location to download the program's main JAR from.
-	 * This can be replaced with a PHP script which serves the file in order to handle
+	 * The location from which to download the program's main JAR.
+	 * This may be replaced with a PHP script which serves the file in order to handle
 	 * validation and to keep track of downloads
 	 */
 	public static final String 	JAR_LOCATION = "http://amigocraft.net/mineflat/serve.php";
 	Font smallFont = new Font("Verdana", Font.BOLD, 16);
 
 	public Launcher(){
+		f.setTitle(NAME + " Launcher");
 		if (progress == null){
 			this.setLayout(null);
 			play = new JButton("Play Game");
 				}
 			}
 			if (fail == null){
-				if (update){
+				File versionFile = new File(appData(), FOLDER_NAME);
+				versionFile = new File(versionFile, "version");
+				if (update || !versionFile.exists()){
+					progress = "Creating version file";
+					createVersionFile();
 					progress = "Downloading mineflat.jar";
 					try {
 						main.delete();
 					launch();
 				}
 				else {
-					File versionFile = new File(appData(), FOLDER_NAME);
-					versionFile = new File(versionFile, "version");
 					try {
 						if (versionFile.exists()){
 							BufferedReader currentVersionReader = new BufferedReader(
 										" " + currentStage + " to version " + latestVersion + " " +
 										latestStage + "?";
 							}
-
-						}
-						else if (!update){
-							updateAvailable = true;
-							updateMsg = "No version file detected! Press \"Update\" to " +
-									"automatically begin an update.";
 						}
 					}
 					catch (Exception ex){
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.