Tutorial option in title screen will now created a game with tutorial xmls. Host game will now created a game with the race xml instead of tutorial xml as well. Made changes to tutorial label in title. #story[1189]
This commit is contained in:
@@ -37,6 +37,8 @@ public class HostController extends Controller {
|
||||
|
||||
private Event game;
|
||||
|
||||
private int gameType = 0;
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
@@ -48,7 +50,7 @@ public class HostController extends Controller {
|
||||
*/
|
||||
public void hostGamePressed() throws IOException{
|
||||
try {
|
||||
this.game = new Event(false);
|
||||
this.game = new Event(gameType);
|
||||
connectSocket("localhost", 4942);
|
||||
} catch (EventConstructionException e) {
|
||||
Logger.getGlobal().log(Level.SEVERE, "Could not create Event.", e);
|
||||
@@ -89,4 +91,8 @@ public class HostController extends Controller {
|
||||
parent.enterTitle();
|
||||
}
|
||||
|
||||
public void setGameType(int gameType){
|
||||
this.gameType = gameType;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -94,6 +94,10 @@ public class MainController extends Controller {
|
||||
hostController.hostGamePressed();
|
||||
}
|
||||
|
||||
public void setGameType(int gameType){
|
||||
hostController.setGameType(gameType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Controller for the applications will house the menu and the displayed pane.
|
||||
*
|
||||
|
||||
@@ -47,6 +47,7 @@ public class TitleController extends Controller {
|
||||
*/
|
||||
public void hostAGame() throws IOException {
|
||||
titleWrapper.setVisible(false);
|
||||
parent.setGameType(0);
|
||||
parent.hostGame();
|
||||
App.getStage().setResizable(true);
|
||||
}
|
||||
@@ -117,6 +118,7 @@ public class TitleController extends Controller {
|
||||
public void tutorialStartPressed() throws IOException {
|
||||
titleWrapper.setVisible(false);
|
||||
System.out.println("Start the tutorial!");
|
||||
parent.setGameType(2);
|
||||
parent.beginGame();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user