From 68828cc7cc460cbba7f77932386883c137707555 Mon Sep 17 00:00:00 2001 From: Zocker1999NET Date: Mon, 4 Jul 2016 20:36:00 +0200 Subject: [PATCH] Colours Buttons deaktivieren --- Colours.java | 95 ++++++++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 52 deletions(-) diff --git a/Colours.java b/Colours.java index 5cc3066..ab1e6eb 100644 --- a/Colours.java +++ b/Colours.java @@ -96,58 +96,49 @@ public class Colours extends World implements ButtonEvent //der per Konstruktor die Daten der Colorklasse übertragen werden, dannach wird die Map die aktive Welt public void buttonClicked (Button b) { - if ( b == schwarz && possw == true) - { - color[x] = sw; - pn[x]=getName(x,"Schwarz"); - if(pn[x].length() > 0) { - x+=1; - possw = false; - } - } - if (b == blau && posbl == true) - { - color[x] = bl; - pn[x]=getName(x,"Blau"); - if(pn[x].length() > 0) { - x+=1; - posbl = false; - } - } - if (b == grün && posgr == true ) - { - color[x] = gr; - pn[x]=getName(x,"Grün"); - if(pn[x].length() > 0) { - x+=1; - posgr = false; - } - } - if ( b == rot && posrt == true) - { - color[x] = rt; - pn[x]=getName(x,"Rot"); - if(pn[x].length() > 0) { - x+=1; - posrt = false; - } - } - if ( b == gelb && posgb == true) - { - color [x] = gb; - pn[x]=getName(x,"Gelb"); - if(pn[x].length() > 0) { - x+=1; - posgb = false; - } - } - if ( b == lila && posli == true) - { - color [x] = li; - pn[x]=getName(x,"Lila"); - if(pn[x].length() > 0) { - x+=1; - posli = false; + if (x < 5) { + if (b == schwarz && possw == true) { + color[x] = sw; + pn[x]=getName(x,"Schwarz"); + if(pn[x].length() > 0) { + x+=1; + possw = false; + } + } else if (b == blau && posbl == true) { + color[x] = bl; + pn[x]=getName(x,"Blau"); + if(pn[x].length() > 0) { + x+=1; + posbl = false; + } + } else if (b == grün && posgr == true ) { + color[x] = gr; + pn[x]=getName(x,"Grün"); + if(pn[x].length() > 0) { + x+=1; + posgr = false; + } + } else if (b == rot && posrt == true) { + color[x] = rt; + pn[x]=getName(x,"Rot"); + if(pn[x].length() > 0) { + x+=1; + posrt = false; + } + } else if (b == gelb && posgb == true) { + color [x] = gb; + pn[x]=getName(x,"Gelb"); + if(pn[x].length() > 0) { + x+=1; + posgb = false; + } + } else if (b == lila && posli == true) { + color [x] = li; + pn[x]=getName(x,"Lila"); + if(pn[x].length() > 0) { + x+=1; + posli = false; + } } } if(b == remove && x > 0) {