summaryrefslogtreecommitdiffstats
path: root/test/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2019-12-27 14:40:52 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2019-12-27 14:40:52 +0100
commit828816db241467c296d3559226cd5fe5494e5761 (patch)
tree32b4822bd0688e60f2093c7c9c846f4580778035 /test/src/ch/asynk
parent876fb5909fdb1924f4ee8355a0e7840911c6b9a2 (diff)
downloadgdx-boardgame-828816db241467c296d3559226cd5fe5494e5761.zip
gdx-boardgame-828816db241467c296d3559226cd5fe5494e5761.tar.gz
ui : Assembly is dead, Element swallows touch() that now returns Element
Diffstat (limited to 'test/src/ch/asynk')
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java2
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java4
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/UiScreen.java8
3 files changed, 7 insertions, 7 deletions
diff --git a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
index 5357449..f609f2c 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
@@ -218,7 +218,7 @@ public class BoardScreen extends AbstractScreen
{
cam.unproject(x, y, boardTouch);
cam.unprojectHud(x, y, hudTouch);
- if (btn.touch(hudTouch.x, hudTouch.y)) {
+ if (btn.touch(hudTouch.x, hudTouch.y) != null) {
setState(state.next());
} else {
board.touch(boardTouch.x, boardTouch.y);
diff --git a/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java b/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java
index 23887f6..b0a312a 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java
@@ -73,8 +73,10 @@ public class MenuScreen extends AbstractScreen
{
hudTouch.set(x, y, 0);
camera.unproject(hudTouch);
- if (root.touch(hudTouch.x, hudTouch.y)) {
+ if (root.touch(hudTouch.x, hudTouch.y) != root) {
switch(menu.touched()) {
+ case -1:
+ break;
case 0:
app.switchToUi();
break;
diff --git a/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java b/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java
index e0fcaf4..bdd8b88 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java
@@ -134,10 +134,8 @@ public class UiScreen extends AbstractScreen
{
hudTouch.set(x, y, 0);
camera.unproject(hudTouch);
- if (root.touch(hudTouch.x, hudTouch.y)) {
- if (root.touched() == next)
- setState(state.next());
- }
+ if (root.touch(hudTouch.x, hudTouch.y) == next)
+ setState(state.next());
}
@Override protected void onDragged(int dx, int dy)
{
@@ -213,7 +211,7 @@ class MyList extends Patch
scrollable.setPosition(getInnerX(), getInnerY(), getInnerWidth(), getInnerHeight() - title.getHeight() - 15);
}
- @Override public boolean touch(float x, float y)
+ @Override public Element touch(float x, float y)
{
return scrollable.touch(x, y);
}