Skip to content
Snippets Groups Projects
Commit 06f18d93 authored by marcus's avatar marcus
Browse files

changed creategame and joingame so wrong pin and lack of nickname returns suitable feedback

parent 9ee38d5a
No related branches found
No related tags found
2 merge requests!22Resolve "Create game model",!18Draft: Resolve "Create game model"
...@@ -42,6 +42,10 @@ public class CreateGameController { ...@@ -42,6 +42,10 @@ public class CreateGameController {
if (confirmNickname()) { if (confirmNickname()) {
state.getStateManager().setState(new LobbyState(state.getStateManager(), createGameView.getPin(), createGameView.getNickname(), _FBIC)); state.getStateManager().setState(new LobbyState(state.getStateManager(), createGameView.getPin(), createGameView.getNickname(), _FBIC));
} }
else{
createGameView.setNickNameMessage("Wrong pin");
}
} }
} }
} }
...@@ -62,6 +66,8 @@ public class CreateGameController { ...@@ -62,6 +66,8 @@ public class CreateGameController {
createGameView.render(sb); createGameView.render(sb);
} }
public void dispose() { public void dispose() {
createGameView.dispose(); createGameView.dispose();
} }
......
...@@ -53,7 +53,7 @@ public class JoinGameController { ...@@ -53,7 +53,7 @@ public class JoinGameController {
}); });
} else { } else {
// Stay on JoinGameState and display an error message if inputs are not valid // Stay on JoinGameState and display an error message if inputs are not valid
joinGameView.setErrorMessage("DB error"); //joinGameView.setErrorMessage("DB error");
} }
} }
......
...@@ -67,6 +67,11 @@ public class FirebaseManager implements FirebaseInterface { ...@@ -67,6 +67,11 @@ public class FirebaseManager implements FirebaseInterface {
} }
@Override
public void resetRoundFlag(String pin) {
}
@Override @Override
public void listenForGameStart(String pin, GameStartCallback callback) { public void listenForGameStart(String pin, GameStartCallback callback) {
......
...@@ -43,6 +43,8 @@ public class CreateGameView { ...@@ -43,6 +43,8 @@ public class CreateGameView {
private String pin; private String pin;
private String selectedLevel = "easy"; // default to easy private String selectedLevel = "easy"; // default to easy
private String nickNameMessage;
...@@ -106,6 +108,8 @@ public class CreateGameView { ...@@ -106,6 +108,8 @@ public class CreateGameView {
nicknameField.setSize(nicknameBounds.width, nicknameBounds.height); nicknameField.setSize(nicknameBounds.width, nicknameBounds.height);
stage.addActor(nicknameField); stage.addActor(nicknameField);
nickNameMessage="";
} }
...@@ -143,6 +147,10 @@ public class CreateGameView { ...@@ -143,6 +147,10 @@ public class CreateGameView {
font.draw(spriteBatch, "Easy", easyButtonBounds.x + (easyButtonBounds.width / 2) - 35, easyButtonBounds.y + (easyButtonBounds.height / 2) + 20); font.draw(spriteBatch, "Easy", easyButtonBounds.x + (easyButtonBounds.width / 2) - 35, easyButtonBounds.y + (easyButtonBounds.height / 2) + 20);
font.draw(spriteBatch, "Medium", mediumButtonBounds.x + (mediumButtonBounds.width / 2) - 60, mediumButtonBounds.y + (mediumButtonBounds.height / 2) + 20); font.draw(spriteBatch, "Medium", mediumButtonBounds.x + (mediumButtonBounds.width / 2) - 60, mediumButtonBounds.y + (mediumButtonBounds.height / 2) + 20);
font.draw(spriteBatch, "Hard", hardButtonBounds.x + (hardButtonBounds.width / 2) - 35, hardButtonBounds.y + (hardButtonBounds.height / 2) + 20); font.draw(spriteBatch, "Hard", hardButtonBounds.x + (hardButtonBounds.width / 2) - 35, hardButtonBounds.y + (hardButtonBounds.height / 2) + 20);
if (!nickNameMessage.isEmpty()){
font.draw(spriteBatch,nickNameMessage,nicknameBounds.x+120,nicknameBounds.y);
}
spriteBatch.end(); spriteBatch.end();
...@@ -189,6 +197,10 @@ public class CreateGameView { ...@@ -189,6 +197,10 @@ public class CreateGameView {
public Rectangle getCreateGameBounds() { public Rectangle getCreateGameBounds() {
return createGameBounds; return createGameBounds;
} }
public void setNickNameMessage(String nickNameMessage) {
this.nickNameMessage = nickNameMessage;
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment