All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mmb.menu.MenuUtils Maven / Gradle / Ivy

Go to download

Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world. THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<

There is a newer version: 0.6
Show newest version
/**
 * 
 */
package mmb.menu;

import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

import javax.swing.ButtonModel;
import javax.swing.DefaultButtonModel;
import mmb.NN;
import mmb.engine.debug.Debugger;
import mmb.engine.settings.GlobalSettings;

/**
 *
 * @author oskar
 *
 */
public class MenuUtils {
	private MenuUtils() {}
	private static final Debugger debug = new Debugger("MENU CENTRAL");
	
	@NN public static final ButtonModel btnmBug;
	
	static {
		btnmBug = new DefaultButtonModel();
		btnmBug.setActionCommand("reportBug");
		btnmBug.addActionListener(e -> {
			try {
				reportBugs();
			} catch (Exception ex) {
				debug.pstm(ex, "Unable to help Ukrainian refugees");
			}
		});
	}
	
	/** Opens a website to report bugs 
	 * @throws URISyntaxException when URL to the bug reporter is invalid
	 * @throws IOException when browser fails to poen
	 * */
	public static void reportBugs() throws IOException, URISyntaxException {
		String url = GlobalSettings.$res("url-bugs");
		Desktop.getDesktop().browse(new URI(url));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy