Skip to content
Snippets Groups Projects
Commit 7aeb9213 authored by Matyáš Latner's avatar Matyáš Latner
Browse files

Merge branch 'feature-inthedarkness' into 'V3.2.1'

Feature inthedarkness



See merge request !371
parents 8ae7d28e 1c086a05
No related branches found
No related tags found
No related merge requests found
......@@ -677,49 +677,51 @@ public abstract class AbstractTablexiaGame<T> extends AbstractTablexiaScreen<T>
final GameResult gameResult = GameDAO.getGameResult(game);
final Image[] cupsImages = new Image[gameResult.getStarCount()];
TablexiaDialogComponentAdapter cups = new TablexiaDialogComponentAdapter() {
private static final int CUPS_TABLE_SPACING = 4;
private static final float CUP_WIDTH_RATIO = 1f / 8;
private static final float CUP_HEIGHT_RATIO = 1f / 6;
if(getGameDifficulty().hasScore()) {
TablexiaDialogComponentAdapter cups = new TablexiaDialogComponentAdapter() {
private static final int CUPS_TABLE_SPACING = 4;
private static final float CUP_WIDTH_RATIO = 1f / 8;
private static final float CUP_HEIGHT_RATIO = 1f / 6;
private List<Cell> cupCells;
private List<Cell> cupCells;
@Override
public void prepareContent(Cell content) {
Table table = new Table();
table.defaults().space(CUPS_TABLE_SPACING);
@Override
public void prepareContent(Cell content) {
Table table = new Table();
table.defaults().space(CUPS_TABLE_SPACING);
cupCells = new ArrayList<Cell>();
content.setActor(table);
cupCells = new ArrayList<Cell>();
content.setActor(table);
for(int i = 0; i < GameResult.values()[GameResult.values().length - 1].getStarCount(); i++) {
Image cup;
cup = new Image(getGameGlobalTextureRegion(VICTORY_DIALOG_RATINGSTAR_DISABLED));
cup.setScaling(Scaling.fit);
for (int i = 0; i < GameResult.values()[GameResult.values().length - 1].getStarCount(); i++) {
Image cup;
cup = new Image(getGameGlobalTextureRegion(VICTORY_DIALOG_RATINGSTAR_DISABLED));
cup.setScaling(Scaling.fit);
//Saves the cups which are changed during the animation
if(i < gameResult.getStarCount()) {
cupsImages[i] = cup;
//Saves the cups which are changed during the animation
if (i < gameResult.getStarCount()) {
cupsImages[i] = cup;
}
cupCells.add(table.add(cup));
}
cupCells.add(table.add(cup));
}
resize();
}
resize();
}
@Override
public void sizeChanged() {
resize();
}
@Override
public void sizeChanged() {
resize();
}
private void resize() {
for (Cell cell: cupCells) {
cell.width(getDialog().getWidth() * CUP_WIDTH_RATIO).height(getDialog().getHeight() * CUP_HEIGHT_RATIO);
private void resize() {
for (Cell cell : cupCells) {
cell.width(getDialog().getWidth() * CUP_WIDTH_RATIO).height(getDialog().getHeight() * CUP_HEIGHT_RATIO);
}
}
}
};
adapters.add(new ResizableSpaceContentDialogComponent());
adapters.add(cups);
};
adapters.add(new ResizableSpaceContentDialogComponent());
adapters.add(cups);
}
//Sentence
String text = "";
......@@ -933,10 +935,12 @@ public abstract class AbstractTablexiaGame<T> extends AbstractTablexiaScreen<T>
victoryDialog.setComponentsSizeComputedCallback(new Runnable() {
@Override
public void run() {
animateAndPlayVictoryDialogSounds(gameResult, cupsImages);
animateProgressBarAndExperienceStars(cupsImages, GameDifficulty.getByGame(game), rankProgress, progressBar);
if(getGameDifficulty().hasScore()) {
animateAndPlayVictoryDialogSounds(gameResult, cupsImages);
animateProgressBarAndExperienceStars(cupsImages, GameDifficulty.getByGame(game), rankProgress, progressBar);
UserRankManager.getInstance().forceRefreshUserRank(getSelectedUser());
UserRankManager.getInstance().forceRefreshUserRank(getSelectedUser());
}
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment