Commit 533ff1e0 authored by Haakon Gunleiksrud's avatar Haakon Gunleiksrud
Browse files

Merge branch '96-add-loading-text-to-enter-tournament' into 'dev'

Resolve "Add loading text to enter tournament"

Closes #96

See merge request tobiasio/progark-gruppe-3!99
parents 96005c3c e5daea35
......@@ -70,6 +70,10 @@ public class CreateJoinTournamentState extends State {
private boolean includeCheckboxClicked = false;
private boolean leaveConfirmed = false;
private boolean joinButtonClicked = false;
private boolean enterButtonClicked = false;
private Tournament enteredTournament;
private Round enteredRound;
private LoadingText loadingText = new LoadingText();
public CreateJoinTournamentState(GameStateManager gsm) {
......@@ -293,6 +297,14 @@ public class CreateJoinTournamentState extends State {
this.joinButtonClicked = false;
}
// User pressed the enter tournament button
if(this.enterButtonClicked && this.loadingText.textIsRendering()){
this.handleEnterBtnClick(this.enteredTournament, this.enteredRound);
this.enterButtonClicked = false;
this.enteredTournament = null;
this.enteredRound = null;
}
this.loadingText.update(dt);
}
......@@ -319,6 +331,13 @@ public class CreateJoinTournamentState extends State {
this.loadingText.setLoading();
}
private void setEnterButtonClicked(Tournament clickedTournament, Round enteredRound){
this.enterButtonClicked = true;
this.enteredTournament = clickedTournament;
this.enteredRound = enteredRound;
this.loadingText.setLoading();
}
// Handle click methods
......@@ -405,7 +424,7 @@ public class CreateJoinTournamentState extends State {
}
public void clicked(InputEvent event, float x, float y) {
handleEnterBtnClick(tournament, round);
setEnterButtonClicked(tournament, round);
};
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment