Commit e5299357 authored by Tor Martin Frøberg Wang's avatar Tor Martin Frøberg Wang
Browse files

Added a placeholder thumbnail for when a placeholder has not been set

parent 176549c6
......@@ -30,7 +30,7 @@ public class BubbleWrapState extends PlayStateUnion {
super.setPauseButtonWhite();
super.setTotalGameTime(20f);
super.setFontColorWhite();
super.screenshot = new Texture(Gdx.files.internal("gameTextures/BubbleWrap/bubbleWrapPhotoEdit.png"));
super.setThumbnail(new Texture(Gdx.files.internal("gameTextures/BubbleWrap/bubbleWrapPhotoEdit.png")));
background = new Texture(Gdx.files.internal("gameTextures/BubbleWrap/bubblewrap_background.jpg"));
unpopped = new Texture(Gdx.files.internal("gameTextures/BubbleWrap/bubble_unpopped_1.png"));
......
......@@ -26,7 +26,7 @@ public class ColorRushState extends PlayStateUnion {
public ColorRushState(GameStateManager gsm){
super(gsm);
super.screenshot = new Texture(Gdx.files.internal("gameTextures/ColorRush/colorRushPhotoEdit.png"));
super.setThumbnail(new Texture(Gdx.files.internal("gameTextures/ColorRush/colorRushPhotoEdit.png")));
super.setTotalGameTime(30f);
// Creates the background
......
......@@ -34,7 +34,7 @@ public class FruitSlicerState extends PlayStateUnion {
public FruitSlicerState(GameStateManager gsm) {
super(gsm);
super.setTotalGameTime(60f);
super.screenshot = new Texture(Gdx.files.internal("gameTextures/FruitSlicer/FruitSlicerPhotoEdit.png"));
super.setThumbnail(new Texture(Gdx.files.internal("gameTextures/FruitSlicer/FruitSlicerPhotoEdit.png")));
super.setFontColorWhite();
super.setPauseButtonWhite();
......
......@@ -51,7 +51,7 @@ public abstract class PlayStateUnion extends State {
protected float currentDuration = 0f;
// Game objects
protected Texture screenshot = null;
private Texture thumbnail = new Texture(Gdx.files.internal("gameTextures/placeholderThumbnail.png"));
private PauseButton pauseButton;
private LoadingText loadingText = new LoadingText();
private BitmapFont font;
......@@ -127,6 +127,7 @@ public abstract class PlayStateUnion extends State {
this.loadingText.dispose();
this.pauseButton.dispose();
this.font.dispose();
this.thumbnail.dispose();
}
@Override
......@@ -261,6 +262,11 @@ public abstract class PlayStateUnion extends State {
this.currentDuration = currentDuration;
}
public void setThumbnail(Texture thumbnailTexture){
this.thumbnail.dispose();
this.thumbnail = thumbnailTexture;
}
// Getters
public Color getFontColor(){
return this.font.getColor();
......@@ -274,8 +280,8 @@ public abstract class PlayStateUnion extends State {
return this.totalGameTime;
}
public Texture getScreenshot(){
return screenshot;
public Texture getThumbnail(){
return thumbnail;
}
// Hide and show methods:
......
......@@ -187,7 +187,7 @@ public class CreateNewTournamentState extends MenuStateUnion {
continue;
}
innerTable.add(new Image(GameWare.getInstance().getGameIdToPlayState().get(g.getId()).getScreenshot())).width(imageWidthAndHeigh).height(imageWidthAndHeigh);
innerTable.add(new Image(GameWare.getInstance().getGameIdToPlayState().get(g.getId()).getThumbnail())).width(imageWidthAndHeigh).height(imageWidthAndHeigh);
Table innerInnerTable = new Table();
innerInnerTable.defaults().space(spacingLittle);
......
......@@ -91,7 +91,7 @@ public class SinglePlayerSelectGameState extends MenuStateUnion {
if(GameWare.getInstance().getGameIdToPlayState().get(g.getId()) == null){
continue;
}
innerTable.add(new Image(GameWare.getInstance().getGameIdToPlayState().get(g.getId()).getScreenshot())).width(imageWidthAndHeigh).height(imageWidthAndHeigh).pad(spacingLittle);
innerTable.add(new Image(GameWare.getInstance().getGameIdToPlayState().get(g.getId()).getThumbnail())).width(imageWidthAndHeigh).height(imageWidthAndHeigh).pad(spacingLittle);
Table innerInnerTable = new Table();
innerInnerTable.add(makeTableWithLabelAndQuestionIcon(new Label(g.getName(), skin), makeQuestionIconDialog(new Label(g.getExplanation().replaceAll("\\\\n", "\n"), skin)))).spaceBottom(spacingLittle);
......
......@@ -97,7 +97,7 @@ public class ViewHighScoreState extends MenuStateUnion {
if(GameWare.getInstance().getGameIdToPlayState().get(g.getId()) == null){
continue;
}
innerTable.add(new Image(GameWare.getInstance().getGameIdToPlayState().get(g.getId()).getScreenshot())).width(imageWidthAndHeigh).height(imageWidthAndHeigh).pad(spacingLittle);
innerTable.add(new Image(GameWare.getInstance().getGameIdToPlayState().get(g.getId()).getThumbnail())).width(imageWidthAndHeigh).height(imageWidthAndHeigh).pad(spacingLittle);
Table innerInnerTable = new Table();
innerInnerTable.add(makeTableWithLabelAndQuestionIcon(new Label(g.getName(), skin), makeQuestionIconDialog(new Label(g.getExplanation().replaceAll("\\\\n", "\n"), skin)))).spaceBottom(spacingLittle);
......
......@@ -121,7 +121,7 @@ public class ViewTournamentState extends MenuStateUnion {
currentRoundTable.setBackground(backgroundTableBlueRounded);
currentRoundTable.add(new Label("This round:\n\n"+gameName,skin)).space(spacingLittle);
PlayStateUnion state = GameWare.getInstance().getGameIdToPlayState().get(round.getGameId());
currentRoundTable.add(new Image(state.getScreenshot())).width(imageWidthAndHeigh).height(imageWidthAndHeigh).spaceBottom(spacingMedium).colspan(2);
currentRoundTable.add(new Image(state.getThumbnail())).width(imageWidthAndHeigh).height(imageWidthAndHeigh).spaceBottom(spacingMedium).colspan(2);
rootTable.add(currentRoundTable).maxHeight(Gdx.graphics.getHeight()/5).colspan(2);
rootTable.row();
......
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