Commit 163b1ce3 authored by Anton Danilov's avatar Anton Danilov

#769 Added double click for InTheDarknessGame, adjusted tap/doubletap threshold times

parent f89d898f
......@@ -40,7 +40,6 @@ import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.bus.ApplicationBus;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.games.in_the_darkness.action.InTheDarknessActionType;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
import cz.nic.tablexia.shared.model.resolvers.InTheDarknessScoreResolver;
import cz.nic.tablexia.util.ui.actionwidget.Action;
import cz.nic.tablexia.util.ui.actionwidget.ActionContainer;
......@@ -615,6 +614,12 @@ public class InTheDarknessGame extends AbstractTablexiaGame<List<MapWidget>> imp
return newAction;
}
@Override
public void onActionDoubleTap(Action action) {
if (!TablexiaSettings.getInstance().isRunningOnMobileDevice()) {
removeActionAndUpdateView(action.getOrderNumber());
}
}
@Override
protected void prepareSelectedActions(String selectedActionsString, AbstractTablexiaGame tablexiaGame) {
......
......@@ -132,7 +132,13 @@ public class ActionsWidget extends Group implements ActionListener {
getHeight() - actionSize - ((orderNumber / NUMBER_OF_COLUMNS) * (actionSize + ACTION_OFFSET)),
visible,
inTheDarknessGame,
actionNumber);
actionNumber) {
@Override
protected void onDoubleTap(){
actionsStripWidget.addSelectedAction(getTexturePath(), actionsStripWidget.getSelectedActions().size(),inTheDarknessGame, getActionNumber());
}
};
action.addActionListener(this);
action.setClickable();
......@@ -255,10 +261,11 @@ public class ActionsWidget extends Group implements ActionListener {
@Override
public void onActionDoubleTap(Action action) {
}
//////////////////////////////////////////// TUTORIAL STEPS
//////////////////////////////////////////// TUTORIAL STEPS
private void tryToPerformNextTutorialStep() {
if (inTheDarknessDifficulty == InTheDarknessDifficulty.TUTORIAL) {
......
......@@ -23,8 +23,8 @@ import com.badlogic.gdx.scenes.scene2d.Actor;
* Created by Vitaliy Vashchenko on 22.8.16.
*/
public class Touch {
public static final float TIME_BETWEEN_TOUCHES = 100;
public static final float TIME_BETWEEN_TAPS = 500;
public static final float TIME_BETWEEN_TOUCHES = 300;
public static final float TIME_BETWEEN_TAPS = 600;
private long time;
private Actor touchedActor;
......
......@@ -244,7 +244,7 @@ public class Action extends Image {
protected void dragAction(float dragPositionX, float dragPositionY) {
moveBy(dragPositionX - getWidth() / 2, dragPositionY - getHeight() / 2);
}
protected void upAction(boolean hideWithAnimation) {
clickable = false;
draggable = false;
......
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