@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == buttons[0]) {
			if(modeSelect.getSelectedItem() == "LOCAL") {
				int nRows = Integer.parseInt(sizes[0].getText());
				int nCols = Integer.parseInt(sizes[1].getText());
				int nPlayers = (Integer)(playerSelect.getSelectedItem());
				int nPlanets = Integer.parseInt(txtPlanets.getText());
				GameManager.NewGame(GameManager.GameType.LOCAL,  GameManager.StringToMode((String)gameSelect.getSelectedItem()), null, nPlayers, nPlanets, nRows, nCols);
				String[] names = new String[nPlayers];
				for(int i = 0; i < nPlayers; i++) {
					names[i] = playerNames[i].getText();
				}
				TurnManager.setPlayerData(names, PlayerColors, PlayerAIs);
				BattleMap.Instance.loadBattleMap(nRows, nCols);
			} else if(modeSelect.getSelectedItem() == "ONLINE") {
				System.out.println("Connect to online game?");
			}
			dialog.setVisible(false);
			dialog.dispose();
			BattleMap.Instance.startGame();
		} else if(e.getSource() == buttons[1]) {
			dialog.setVisible(false);
			dialog.dispose();
		} else if(e.getSource() == buttons[3]) {
			System.out.println("Not implemented yet");
		} else {
			System.out.println("Clicked on " + e.getSource());
		}
	}