Quality of live improvement

This commit is contained in:
Felix Koppe
2024-12-09 16:07:26 +01:00
parent 6a4bdfa455
commit de0f04b5b7
3 changed files with 12 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ public class GameView extends MdgaView {
private GuiHandler guiHandler; private GuiHandler guiHandler;
private ButtonLeft leaveButton; private ButtonLeft leaveButton;
private ButtonRight confirmButton; public ButtonRight confirmButton;
private ButtonRight noPowerButton; private ButtonRight noPowerButton;
@@ -28,6 +28,8 @@ public class GameView extends MdgaView {
private FilterPostProcessor fpp; private FilterPostProcessor fpp;
public boolean needConfirm = false;
private Node guiHandlerNode = new Node(); private Node guiHandlerNode = new Node();
public GameView(MdgaApp app) { public GameView(MdgaApp app) {
@@ -116,10 +118,14 @@ public Color getOwnColor() {
public void needConfirm() { public void needConfirm() {
noPowerButton.hide(); noPowerButton.hide();
confirmButton.show(); confirmButton.show();
needConfirm = true;
} }
public void noConfirm() { public void noConfirm() {
confirmButton.hide(); confirmButton.hide();
needConfirm = false;
} }
public void showNoPower() { public void showNoPower() {

View File

@@ -59,7 +59,6 @@ public void enter() {
public void leave() { public void leave() {
onLeave(); onLeave();
settingsButton.hide(); settingsButton.hide();
while (settingsDepth > 0) { while (settingsDepth > 0) {
@@ -197,8 +196,12 @@ public void pressForward() {
} }
if (this instanceof GameView gameView) { if (this instanceof GameView gameView) {
if(gameView.needConfirm) {
app.getModelSynchronize().confirm();
} else {
app.getAcousticHandler().playSound(MdgaSound.WRONG_INPUT); app.getAcousticHandler().playSound(MdgaSound.WRONG_INPUT);
} }
}
if (this instanceof CeremonyView ceremonyView) { if (this instanceof CeremonyView ceremonyView) {
ceremonyView.forward(); ceremonyView.forward();

View File

@@ -38,7 +38,6 @@ public void exit() {
@Override @Override
public void received(SelectPieceMessage msg) { public void received(SelectPieceMessage msg) {
//TODO
ArrayList<Piece> pieces = msg.getPieces().stream().map(piece -> logic.getGame().getPieceThroughUUID(piece.getUuid())).collect(Collectors.toCollection(ArrayList::new)); ArrayList<Piece> pieces = msg.getPieces().stream().map(piece -> logic.getGame().getPieceThroughUUID(piece.getUuid())).collect(Collectors.toCollection(ArrayList::new));
parent.getSelectPiece().setPossiblePieces(pieces); parent.getSelectPiece().setPossiblePieces(pieces);
ArrayList<UUID> listPiece = pieces.stream().map(Piece::getUuid).collect(Collectors.toCollection(ArrayList::new)); ArrayList<UUID> listPiece = pieces.stream().map(Piece::getUuid).collect(Collectors.toCollection(ArrayList::new));