Commit c688eec5 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

Merge branch '937-sin-slavy-opravy-vzhledu' into 'V3.7'

Resolve "Siň slavy: opravy vzhledu"

See merge request !731
parents 2b8e5fc7 3c9c7c92
......@@ -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