added and option to swap between css files in the title pane
#pair[zwu18, hba56] #story[1087]
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) {
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<TextField fx:id="gameNameField" promptText="Enter game name [DOES NOTHING ATM]" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.valignment="TOP" />
|
||||
<TextField fx:id="hostNameField" promptText="Enter host name [DOES NOTHING ATM]" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.valignment="BOTTOM" />
|
||||
<TextField fx:id="gameNameField" disable="true" promptText="Enter game name" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.valignment="TOP" />
|
||||
<TextField fx:id="hostNameField" disable="true" promptText="Enter host name" GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.valignment="BOTTOM" />
|
||||
<Button fx:id="hostGameBtn" mnemonicParsing="false" onAction="#hostGamePressed" text="Host Game" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="2">
|
||||
<font>
|
||||
<Font size="20.0" />
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?import javafx.scene.text.Text?>
|
||||
|
||||
<AnchorPane fx:id="titleWrapper" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.TitleController">
|
||||
<AnchorPane fx:id="titleWrapper" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="visualiser.Controllers.TitleController">
|
||||
<children>
|
||||
<GridPane layoutY="39.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="800.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<columnConstraints>
|
||||
@@ -45,6 +45,8 @@
|
||||
<Font name="Comic Sans MS" size="12.0" />
|
||||
</font>
|
||||
</Text>
|
||||
<RadioButton fx:id="nightModeRD" layoutX="681.0" layoutY="168.0" mnemonicParsing="false" onAction="#setNightMode" text="Night Mode" />
|
||||
<RadioButton fx:id="dayModeRD" layoutX="574.0" layoutY="168.0" mnemonicParsing="false" onAction="#setDayMode" selected="true" text="Day Mode" />
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane prefHeight="20.0" prefWidth="20.0" style="-fx-background-color: #6be6ff;" GridPane.columnSpan="4" GridPane.rowSpan="4">
|
||||
@@ -59,7 +61,7 @@
|
||||
<Image url="@../images/cloud.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<ImageView fx:id="imgWhale" fitHeight="113.0" fitWidth="98.0" layoutX="68.0" layoutY="257.0" pickOnBounds="true" preserveRatio="true">
|
||||
<ImageView fx:id="imgWhale" fitHeight="113.0" fitWidth="98.0" layoutX="69.0" layoutY="302.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
||||
<Image url="@../images/whale.png" />
|
||||
</image>
|
||||
|
||||
Reference in New Issue
Block a user