From 7fcb5662cb51d3c75d3a744102bd30a033665948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 15 Nov 2014 16:11:47 +0100 Subject: OkCancel: add boolean to hide cancel button --- core/src/ch/asynk/tankontank/game/hud/OkCancel.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/ch/asynk/tankontank/game/hud/OkCancel.java b/core/src/ch/asynk/tankontank/game/hud/OkCancel.java index 59d345c..56c3e96 100644 --- a/core/src/ch/asynk/tankontank/game/hud/OkCancel.java +++ b/core/src/ch/asynk/tankontank/game/hud/OkCancel.java @@ -26,6 +26,11 @@ public class OkCancel extends Bg public void show(String msg, Position position) { + show(msg, position, true); + } + + public void show(String msg, Position position, boolean canCancel) + { label.write(msg); float height = (label.getHeight() + (4 * padding) + okBtn.getHeight()); @@ -41,6 +46,7 @@ public class OkCancel extends Bg label.setPosition((x + padding), (y + okBtn.getHeight() + (2 * padding))); visible = true; ok = false; + cancelBtn.visible = canCancel; } public boolean hit(float x, float y) -- cgit v1.1-2-g2b99