Dashboard GameUpdate
This commit is contained in:
@@ -64,6 +64,7 @@ public class Dashboard_GUI extends JPanel{
|
||||
private JButton btnpik = new JButton("Pik");
|
||||
private JButton btnkaro = new JButton("Karo");
|
||||
private JButton btnkreuz = new JButton("Kreuz");
|
||||
private final JLabel label_final = new JLabel("Spiel beendet");
|
||||
|
||||
public Dashboard_GUI(Spiel Spiel, Texturenpakete texturen) {
|
||||
setMinimumSize(new Dimension(1000, 600));
|
||||
@@ -167,6 +168,12 @@ public class Dashboard_GUI extends JPanel{
|
||||
|
||||
|
||||
mitte.add(mitte_center);
|
||||
label_final.setVisible(false);
|
||||
label_final.setFont(new Font("Tahoma", Font.PLAIN, 34));
|
||||
label_final.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
label_final.setForeground(Color.BLACK);
|
||||
|
||||
mitte_center.add(label_final, BorderLayout.SOUTH);
|
||||
|
||||
//Wunschfarben Button Listener
|
||||
|
||||
@@ -176,7 +183,7 @@ public class Dashboard_GUI extends JPanel{
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
aktuellesSpiel.getKartensatz().SetWunschfarbe(Farbe.PIK);
|
||||
btnpik.setVisible(false);
|
||||
showwunsch(false);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -186,7 +193,7 @@ public class Dashboard_GUI extends JPanel{
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
aktuellesSpiel.getKartensatz().SetWunschfarbe(Farbe.KARO);
|
||||
btnkaro.setVisible(false);
|
||||
showwunsch(false);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -196,7 +203,7 @@ public class Dashboard_GUI extends JPanel{
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
aktuellesSpiel.getKartensatz().SetWunschfarbe(Farbe.KREUZ);
|
||||
btnkreuz.setVisible(false);
|
||||
showwunsch(false);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -204,7 +211,7 @@ public class Dashboard_GUI extends JPanel{
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
aktuellesSpiel.getKartensatz().SetWunschfarbe(Farbe.HERZ);
|
||||
btnherz.setVisible(false);
|
||||
showwunsch(false);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -244,6 +251,8 @@ public class Dashboard_GUI extends JPanel{
|
||||
aktuellesSpiel = Spiel;
|
||||
System.out.println("DASHBOARD: Game darstellen");
|
||||
cl.show(panelCont, "2");
|
||||
showwunsch(false);
|
||||
aussetzen.setVisible(false);
|
||||
aktuellesSpiel.spiel(this);
|
||||
aktualisiereGUI();
|
||||
}
|
||||
@@ -373,16 +382,44 @@ public class Dashboard_GUI extends JPanel{
|
||||
aktualisiereSpieleranzeige();
|
||||
aktualisiereAblage();
|
||||
aktualisiereHand();
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
|
||||
public void showwunsch(){
|
||||
btnpik.setVisible(true);
|
||||
btnherz.setVisible(true);
|
||||
btnkaro.setVisible(true);
|
||||
btnkreuz.setVisible(true);
|
||||
public void showwunsch(boolean status){
|
||||
btnpik.setVisible(status);
|
||||
btnherz.setVisible(status);
|
||||
btnkaro.setVisible(status);
|
||||
btnkreuz.setVisible(status);
|
||||
mitte_unten.updateUI();
|
||||
//mitte_unten.revalidate();
|
||||
//mitte_unten.repaint();
|
||||
}
|
||||
|
||||
public Farbe getwunschfarbe() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return Farbe.KARO;
|
||||
}
|
||||
|
||||
|
||||
public void gewonnen(Spieler spieler) {
|
||||
|
||||
if(spieler == spieler.SPIELER) {
|
||||
System.out.println("Spiel gewonnen");
|
||||
label_final.setText("Spiel gewonnen");
|
||||
}
|
||||
if(spieler == spieler.COMPUTER) {
|
||||
System.out.println("Spiel verloren");
|
||||
label_final.setText("Spiel verloren");
|
||||
}
|
||||
player_hand.setVisible(false);
|
||||
label_final.setVisible(true);
|
||||
ablagestapel.setVisible(false);
|
||||
rechts.setVisible(false);
|
||||
updateUI();
|
||||
aktualisiereGUI();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user