Skip to content
Snippets Groups Projects
Commit 0bb26b9d authored by Turid Cecilie Dahl's avatar Turid Cecilie Dahl
Browse files

MR fixes

parent 669f2ef4
Branches
No related tags found
1 merge request!66Resolve "Make it look pretty"
...@@ -18,11 +18,9 @@ import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; ...@@ -18,11 +18,9 @@ import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.gameware.game.GameWare; import com.gameware.game.GameWare;
import com.gameware.game.QueryIntermediate; import com.gameware.game.QueryIntermediate;
import com.gameware.game.models.Game; import com.gameware.game.models.Game;
import com.gameware.game.models.Tournament;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -30,7 +28,7 @@ public class SinglePlayerSelectGameState extends State { ...@@ -30,7 +28,7 @@ public class SinglePlayerSelectGameState extends State {
private Table table; private Table table;
private Table innerTable; private Table innerTable;
private ScrollPane tournamentsPane; private ScrollPane scrollPane;
private List<Game> games = new ArrayList<>(); private List<Game> games = new ArrayList<>();
private final String backBtnText = "Back"; private final String backBtnText = "Back";
...@@ -81,9 +79,9 @@ public class SinglePlayerSelectGameState extends State { ...@@ -81,9 +79,9 @@ public class SinglePlayerSelectGameState extends State {
innerTable.row(); innerTable.row();
} }
tournamentsPane = new ScrollPane(innerTable, skin); scrollPane = new ScrollPane(innerTable, skin);
table.add(tournamentsPane).spaceBottom(spacingOnBottom); table.add(scrollPane).spaceBottom(spacingOnBottom);
table.getCell(tournamentsPane).size(Gdx.graphics.getWidth()/1.3f, Gdx.graphics.getHeight()/3f); table.getCell(scrollPane).size(Gdx.graphics.getWidth()/1.3f, Gdx.graphics.getHeight()/3f);
table.row(); table.row();
stage.addActor(table); stage.addActor(table);
......
...@@ -13,25 +13,19 @@ import java.util.List; ...@@ -13,25 +13,19 @@ import java.util.List;
import com.badlogic.gdx.scenes.scene2d.ui.Image; import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.gameware.game.QueryIntermediate;
import com.gameware.game.GameWare; import com.gameware.game.GameWare;
import com.gameware.game.models.Game; import com.gameware.game.models.Game;
import java.io.IOException; import java.io.IOException;
import java.io.IOException;
public class ViewHighScoreState extends State { public class ViewHighScoreState extends State {
private Table table; private Table table;
private Table innerTable; private Table innerTable;
private ScrollPane tournamentsPane; private ScrollPane scrollPane;
private List<Game> games; private List<Game> games;
private String backBtnText = "Back"; private String backBtnText = "Back";
...@@ -85,9 +79,9 @@ public class ViewHighScoreState extends State { ...@@ -85,9 +79,9 @@ public class ViewHighScoreState extends State {
innerTable.row(); innerTable.row();
} }
tournamentsPane = new ScrollPane(innerTable, skin); scrollPane = new ScrollPane(innerTable, skin);
table.add(tournamentsPane).spaceBottom(spacingOnBottom); table.add(scrollPane).spaceBottom(spacingOnBottom);
table.getCell(tournamentsPane).size(Gdx.graphics.getWidth()/1.2f, Gdx.graphics.getHeight()/3f); table.getCell(scrollPane).size(Gdx.graphics.getWidth()/1.2f, Gdx.graphics.getHeight()/3f);
table.row(); table.row();
stage.addActor(table); stage.addActor(table);
......
...@@ -25,8 +25,6 @@ public class ViewTournamentState extends State { ...@@ -25,8 +25,6 @@ public class ViewTournamentState extends State {
private Round round; private Round round;
private Dialog dialog; private Dialog dialog;
TextButton playBtn;
private int padding = 50; private int padding = 50;
private Label stateNameText; private Label stateNameText;
...@@ -61,11 +59,8 @@ public class ViewTournamentState extends State { ...@@ -61,11 +59,8 @@ public class ViewTournamentState extends State {
table.add(stateNameText).spaceBottom(spacingOnBottomInputFIeld); table.add(stateNameText).spaceBottom(spacingOnBottomInputFIeld);
table.row(); table.row();
// if(round.isPlayed()){
// table.add(new Label("You have aldready played\nWait for others to finish", skin)).spaceBottom(spacingOnBottom);
// }else {
table.add(makePlayBtn()).size(buttonWidth*1.4f, buttonHeight*1.2f).spaceBottom(spacingOnBottom); table.add(makePlayBtn()).size(buttonWidth*1.4f, buttonHeight*1.2f).spaceBottom(spacingOnBottom);
// }
table.row(); table.row();
PlayStateTemplate state = GameWare.getInstance().getGameIdToPlayState().get(round.getGameId()); PlayStateTemplate state = GameWare.getInstance().getGameIdToPlayState().get(round.getGameId());
...@@ -126,7 +121,7 @@ public class ViewTournamentState extends State { ...@@ -126,7 +121,7 @@ public class ViewTournamentState extends State {
} }
private TextButton makePlayBtn(){ private TextButton makePlayBtn(){
TextButton playBtn;
if(round.isPlayed()){ if(round.isPlayed()){
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(); TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.up = skin.newDrawable("button", Color.GRAY); textButtonStyle.up = skin.newDrawable("button", Color.GRAY);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment