You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.0 KiB

package visualiser.Controllers2;
import javafx.fxml.FXML;
import javafx.scene.control.RadioButton;
import javafx.stage.Modality;
import java.io.IOException;
/**
* Controller for the opening title window.
* Has two initial buttons for a user to decide how to play their game. Has a
* burger-boat and comic sans styling to allure and entice users into playing
* the game.
*/
public class TitleController extends Controller2 {
private @FXML RadioButton dayModeRD;
private @FXML RadioButton nightModeRD;
/**
* Method called when the 'host a game' button is pressed.
* Opens the next window allowing a user to host their own game.
* Currently used to run the RaceVision mock.
* @throws IOException if main has problems
*/
public void hostAGame() throws IOException {
loadScene("hostLobby.fxml");
}
/**
* To be implemented at a later date- will open the next scene displaying
* games a player can join. Place holder method for now!
*/
public void joinAGame() throws IOException {
loadScene("lobby.fxml");
}
/**
* Switches the css of the program to day mode theme
*/
public void setDayMode(){
dayModeRD.getScene().getStylesheets().clear();
dayModeRD.getScene().getStylesheets().add("/css/dayMode.css");
nightModeRD.setSelected(false);
}
/**
* Switches the css of the program to night mode theme
*/
public void setNightMode(){
nightModeRD.getScene().getStylesheets().clear();
nightModeRD.getScene().getStylesheets().add("/css/nightMode.css");
dayModeRD.setSelected(false);
}
/**
* Called when control button is pressed. New pop up window displaying controls
*/
public void showControls(){
try {
loadPopupScene("keyBindings.fxml",
"Game Controls", Modality.WINDOW_MODAL);
} catch (IOException e) {
e.printStackTrace();
}
}
}