Merge remote-tracking branch 'origin/css' into css
# Conflicts: # racevisionGame/src/main/resources/visualiser/scenes/hostgame.fxml
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class App extends Application {
|
||||
});
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/visualiser/scenes/main.fxml"));
|
||||
Parent root = loader.load();
|
||||
stage.setResizable(false);
|
||||
// stage.setResizable(false);
|
||||
MainController mc = (MainController) loader.getController();
|
||||
mc.enterTitle();
|
||||
Scene scene = new Scene(root);
|
||||
@@ -45,6 +45,7 @@ public class App extends Application {
|
||||
stage.setScene(scene);
|
||||
stage.setTitle("RaceVision - Team 7");
|
||||
stage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/SailIcon.png")));
|
||||
mc.startCss();
|
||||
stage.show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user