public void saveMapFile(File file) {
		System.err.println("Saving scene as " + file);
		System.out.println("path:" + file.getParent() + " name:" + file.getName());
		String js_fileName = file.getName();
		if(js_fileName.indexOf(".") > 0) {
			js_fileName = js_fileName.substring(0, js_fileName.indexOf("."));
		}
		js_fileName += ".js";
		System.out.println("js_fileName:" + js_fileName);
		File js_file = new File(file.getParent() + "\\" + js_fileName);

		if (scene.getTileset().isUnsaved()) {
			System.out.println("?? 2 " + (scene.getTileset() == gfx));
			PromptDialog.tell("Please save your tileset first.", "OK");
			return;
		}
		try {
			scene.saveMapScene(file, js_file);
			openFile = file;
			mainFrame.validate();
		} catch (Exception e) {
			PromptDialog.tell("Could not save: " + e, "OK");
			e.printStackTrace();
		}
	}