Commit 13066d44 authored by Aneta Steimarova's avatar Aneta Steimarova

Merge branch 'V3.7' into feature-itests

parents e1b45438 c688eec5
......@@ -50,7 +50,7 @@ public enum GameDefinition implements ApplicationEvent, IMenuItem, INumberedDefi
KIDNAPPING (cz.nic.tablexia.shared.model.definitions.GameDefinition.KIDNAPPING, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_DESCRIPTION, KidnappingGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
NIGHT_WATCH (cz.nic.tablexia.shared.model.definitions.GameDefinition.NIGHT_WATCH, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_DESCRIPTION, NightWatchGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
SHOOTING_RANGE (cz.nic.tablexia.shared.model.definitions.GameDefinition.SHOOTING_RANGE, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_DESCRIPTION, ShootingRangeGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
IN_THE_DARKNESS (cz.nic.tablexia.shared.model.definitions.GameDefinition.IN_THE_DARKNESS, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_DESCRIPTION, InTheDarknessGame.class, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
IN_THE_DARKNESS (cz.nic.tablexia.shared.model.definitions.GameDefinition.IN_THE_DARKNESS, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_DESCRIPTION, InTheDarknessGame.class, true, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
RUNES (cz.nic.tablexia.shared.model.definitions.GameDefinition.RUNES, ApplicationTextManager.ApplicationTextsAssets.GAME_RUNES_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_RUNES_DESCRIPTION, RunesGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
CRIME_SCENE (cz.nic.tablexia.shared.model.definitions.GameDefinition.CRIME_SCENE, ApplicationTextManager.ApplicationTextsAssets.GAME_CRIME_SCENE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_CRIME_SCENE_DESCRIPTION, CrimeSceneGame.class, false, true, ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
PROTOCOL (cz.nic.tablexia.shared.model.definitions.GameDefinition.PROTOCOL,ApplicationTextManager.ApplicationTextsAssets.GAME_PROTOCOL_TITLE,ApplicationTextManager.ApplicationTextsAssets.GAME_PROTOCOL_DESCRIPTION, ProtocolGame.class,false,ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE,ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
......
......@@ -337,7 +337,7 @@ public class CrimeSceneGame extends AbstractTablexiaGame<CrimeSceneGameState> {
private void setUpGameMap() {
gameMap.removeActor(gameMapTexture);
gameMapTexture = ScaleUtil.createImageToHeight(getScreenTextureRegion(LevelDefinition.Level.getLevelByDifficulty(getGameDifficulty(), level).getTexturePath()), GAME_MAP_SIZE);
gameMapTexture = ScaleUtil.createImageToHeight(getScreenTextureRegion(getData().getUsedLevel().getTexturePath()), GAME_MAP_SIZE);
gameMap.addActor(gameMapTexture);
gameMapTexture.setZIndex(0);
setUpSizeAndPositionOfComponents();
......
......@@ -221,7 +221,6 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
contentStack.addActor(backgroundGroup);
contentStack.addActor(foregroundGroup);
contentStack.setDebug(TablexiaSettings.getInstance().isShowBoundingBoxes());
wallImage = new TablexiaNoBlendingImage(getScreenTextureRegion(HallOfFameAssets.HALL_OF_FAME_WALL));
scrollPane = new ScrollPaneWithBorders(contentStack, wallImage);
......@@ -289,7 +288,6 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
for (int i = 0; i < BACKGROUND_TILE_REPEAT_COUNT; i++) {
Image imgBackground = createImageForHorizontalGroup(textureTile, SCREEN_SIZE.y);
imgBackground.setDebug(TablexiaSettings.getInstance().isShowBoundingBoxes());
backgroundGroup.addActor(imgBackground);
}
backgroundGroup.space(BACKGROUND_IOS_SPACING_WORKAROUND);
......@@ -495,51 +493,8 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
heapImage.setPosition(heapX, heapY);
heapImage.setScale(heapScale);
heapImage.setSize(HEAP_WIDTH,HEAP_HEIGHT);
heapImage.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
Log.info(getClass(), "HEAP CLICKED ");
int sum = 0;
List<TablexiaDialogComponentAdapter> components = new ArrayList<TablexiaDialogComponentAdapter>();
for (GameDefinition gameDefinition : GameDefinition.getSortedGameDefinitionList()) {
int numOfStars = 0;
if (starResults.containsKey(gameDefinition)) {
numOfStars = starResults.get(gameDefinition);
sum += numOfStars;
}
components.add(new ResizableSpaceContentDialogComponent());
components.add(new TwoColumnTextContentDialogComponent(
GameMenuDefinition.getGameMenuDefinitionForGameDefinition(gameDefinition).getTitle(),
String.valueOf(numOfStars),
Integer.valueOf(SUM_DIALOG_TITLE_ALIGN),
Integer.valueOf(SUM_DIALOG_VALUE_ALIGN)));
}
components.add(new ResizableSpaceContentDialogComponent());
components.add(new DividerContentDialogComponent());
components.add(new ResizableSpaceContentDialogComponent());
components.add(new TwoColumnTextContentDialogComponent(
getText(COUNT_SUM_TEXT_KEY),
String.valueOf(sum),
SUM_DIALOG_FONT_TYPE,
SUM_DIALOG_FONT_COLOR,
Integer.valueOf(SUM_DIALOG_TITLE_ALIGN),
Integer.valueOf(SUM_DIALOG_VALUE_ALIGN)));
components.add(new ResizableSpaceContentDialogComponent());
components.add(new BackButtonHideComponent());
TablexiaComponentDialog dialog = TablexiaComponentDialogFactory.getInstance().createStandardDialog(components.toArray(new TablexiaDialogComponentAdapter[]{}));
dialog.setName(SCORE_TABLE_DIALOG_NAME);
dialog.setDialogListener(dialogListener);
dialog.show(TROPHY_DIALOG_WIDTH, TROPHY_DIALOG_HEIGHT);
}
});
//Create a group for trophy heap label and put a label right in the middle of it
Group labelGroup = new Group();
labelGroup.setDebug(TablexiaSettings.getInstance().isShowBoundingBoxes());
labelGroup.setBounds(
heapImage.getX() + heapImage.getWidth() * TROPHY_HEAP_LABEL_GROUP_X,
......@@ -554,6 +509,9 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
labelGroup.rotateBy(-15);
heapImage.addListener(new HeapDialogListener());
labelGroup.addListener(new HeapDialogListener());
foregroundGroup.addActor(heapImage);
foregroundGroup.addActor(labelGroup);
}
......@@ -780,4 +738,47 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
if(mouseTimer != null) mouseTimer.cancel();
super.screenDisposed();
}
class HeapDialogListener extends ClickListener {
@Override
public void clicked(InputEvent event, float x, float y) {
final Map<GameDefinition, Integer> starResults = UserTrophy.AllStarsGame.getNumberOfStarsResults(getSelectedUser());
Log.info(getClass(), "HEAP CLICKED ");
int sum = 0;
List<TablexiaDialogComponentAdapter> components = new ArrayList<TablexiaDialogComponentAdapter>();
for (GameDefinition gameDefinition : GameDefinition.getSortedGameDefinitionList()) {
int numOfStars = 0;
if (starResults.containsKey(gameDefinition)) {
numOfStars = starResults.get(gameDefinition);
sum += numOfStars;
}
components.add(new ResizableSpaceContentDialogComponent());
components.add(new TwoColumnTextContentDialogComponent(
GameMenuDefinition.getGameMenuDefinitionForGameDefinition(gameDefinition).getTitle(),
String.valueOf(numOfStars),
Integer.valueOf(SUM_DIALOG_TITLE_ALIGN),
Integer.valueOf(SUM_DIALOG_VALUE_ALIGN)));
}
components.add(new ResizableSpaceContentDialogComponent());
components.add(new DividerContentDialogComponent());
components.add(new ResizableSpaceContentDialogComponent());
components.add(new TwoColumnTextContentDialogComponent(
getText(COUNT_SUM_TEXT_KEY),
String.valueOf(sum),
SUM_DIALOG_FONT_TYPE,
SUM_DIALOG_FONT_COLOR,
Integer.valueOf(SUM_DIALOG_TITLE_ALIGN),
Integer.valueOf(SUM_DIALOG_VALUE_ALIGN)));
components.add(new ResizableSpaceContentDialogComponent());
components.add(new BackButtonHideComponent());
TablexiaComponentDialog dialog = TablexiaComponentDialogFactory.getInstance().createStandardDialog(components.toArray(new TablexiaDialogComponentAdapter[]{}));
dialog.setName(SCORE_TABLE_DIALOG_NAME);
dialog.setDialogListener(dialogListener);
dialog.show(TROPHY_DIALOG_WIDTH, TROPHY_DIALOG_HEIGHT);
}
}
}
\ No newline at end of file
Markdown is supported
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