Commit 253c7cf8 authored by Drahomír Karchňák's avatar Drahomír Karchňák

Merge branch 'feature-desktop-runes' into 'V3.5.1'

#766 Runes disable unfolded scaling for desktop version

See merge request !586
parents 70d3f890 8b2808ea
......@@ -142,16 +142,18 @@ public class RunesGame extends AbstractTablexiaGame<RunesGameState> {
setActorToFullScene(background);
// click listener to fold all holders on click on background
getStage().addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (event.getTarget().equals(background)) {
holderManager.foldAll();
if(TablexiaSettings.getInstance().getPlatform() != TablexiaSettings.Platform.DESKTOP) {
getStage().addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (event.getTarget().equals(background)) {
holderManager.foldAll();
}
Log.debug(getClass(), "Clicked x:" + x / getSceneWidth() + ", y:" + y / getSceneInnerHeight());
super.clicked(event, x, y);
}
Log.debug(getClass(),"Clicked x:" + x/getSceneWidth() + ", y:" + y/getSceneInnerHeight());
super.clicked(event, x, y);
}
});
});
}
}
......@@ -270,16 +272,21 @@ public class RunesGame extends AbstractTablexiaGame<RunesGameState> {
private void initHolders() {
int maxGroups = PositionDefinition.getGroupsCount(getData().getRound(), getGameDifficulty());
TablexiaSettings settings = TablexiaSettings.getInstance();
for (int i = 0; i < maxGroups; i++) {
final RunesHolder runesHolder = HolderManager.createHolder(targetPlate.getActiveTargetsDescriptions(),runesDifficultyDefinition);
runesHolder.init();
runesHolder.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
holderManager.switchFolded(runesHolder);
super.clicked(event, x, y);
}
});
if(settings.getPlatform() != TablexiaSettings.Platform.DESKTOP) {
runesHolder.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
holderManager.switchFolded(runesHolder);
super.clicked(event, x, y);
}
});
}
holderManager.getHolders().add(runesHolder);
runesGroup.addActor(runesHolder);
}
......@@ -320,7 +327,10 @@ public class RunesGame extends AbstractTablexiaGame<RunesGameState> {
holderManager.moveHolders(newPositions, getSceneWidth(), getSceneInnerHeight());
holderManager.updateHolders(targetPlate.getActiveTargetsDescriptions(), getData().getRound());
holderManager.addHoldersActors(runesLibrary, correctRuneListener);
holderManager.foldAll();
if(TablexiaSettings.getInstance().getPlatform() != TablexiaSettings.Platform.DESKTOP) {
holderManager.foldAll();
}
}
......
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