From a64556c077d4fdee8b0005582b0493dc1b23087d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 22 Feb 2016 05:35:40 +0100 Subject: List: add unselect() --- core/src/ch/asynk/rustanddust/ui/List.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/ch/asynk/rustanddust/ui/List.java b/core/src/ch/asynk/rustanddust/ui/List.java index 0d5165a..c8834e3 100644 --- a/core/src/ch/asynk/rustanddust/ui/List.java +++ b/core/src/ch/asynk/rustanddust/ui/List.java @@ -36,6 +36,7 @@ public class List extends Widget this.selected = new Bg(game.getUiRegion(game.UI_SELECT)); } + public void unselect() { idx = null; } public Integer getIdx() { return idx; } @Override @@ -53,7 +54,7 @@ public class List extends Widget public void setItems(int clipN, Collection items) { - this.idx = null; + unselect(); this.items = items; compute(); } -- cgit v1.1-2-g2b99