added and option to swap between css files in the title pane

#pair[zwu18, hba56]
#story[1087]
This commit is contained in:
hba56
2017-07-27 12:04:17 +12:00
parent 8bb66bc5e4
commit 64b4aa539a
5 changed files with 29 additions and 4 deletions
@@ -73,6 +73,11 @@ public class MainController extends Controller {
*/
public void hostGame(){ hostController.hostGame(); }
/**
* Sets up the css for the start of the program
*/
public void startCss(){titleController.setDayMode();}
/**
* Main Controller for the applications will house the menu and the displayed pane.
*
@@ -5,6 +5,7 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.RadioButton;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
@@ -24,6 +25,10 @@ public class TitleController extends Controller {
Button btnJoin;
@FXML
AnchorPane titleWrapper;
@FXML
RadioButton dayModeRD;
@FXML
RadioButton nightModeRD;
/**
* Method called when the 'host a game' button is pressed.
@@ -50,6 +55,18 @@ public class TitleController extends Controller {
parent.enterLobby();
}
public void setDayMode(){
dayModeRD.getScene().getStylesheets().clear();
dayModeRD.getScene().getStylesheets().add("/css/dayMode.css");
nightModeRD.setSelected(false);
}
public void setNightMode(){
nightModeRD.getScene().getStylesheets().clear();
nightModeRD.getScene().getStylesheets().add("/css/nightMode.css");
dayModeRD.setSelected(false);
}
@Override
public void initialize(URL location, ResourceBundle resources) {