Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Fixed colors
Browse files Browse the repository at this point in the history
Fixed bug: Colors were changed on click even if the field was flagged
  • Loading branch information
SebastianThomas committed Jul 6, 2021
1 parent ba65926 commit 3d8e418
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions main/java/de/sth/minesweeper/buttons/SweeperButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ public SweeperButton(MineSweeper sweeper, GameStatistic stats, int x, int y, int
}

public void emitReveal() {
this.setBackground((this.x + this.y) % 2 == 0 ? ColorConstant.BUTTON_REVEALED_LIGHT : ColorConstant.BUTTON_REVEALED_DARK);

try {
// If current button is not revealed, and the game is still running
if (!this.revealed && !this.game.gameOver && !this.rightClicked) {
this.revealed = true;
this.setBackground((this.x + this.y) % 2 == 0 ? ColorConstant.BUTTON_REVEALED_LIGHT : ColorConstant.BUTTON_REVEALED_DARK);
this.reveal();
this.game.newReveal(this, this.x, this.y);
}
Expand Down
2 changes: 1 addition & 1 deletion main/java/de/sth/minesweeper/updates/UpdateConstants.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.sth.minesweeper.updates;

public abstract class UpdateConstants {
public static final String currentVersion = "v4.9.1";
public static final String currentVersion = "v4.9.2";

enum UpdateOptions {
/**
Expand Down
Binary file modified out/minesweeper.jar
Binary file not shown.

0 comments on commit 3d8e418

Please sign in to comment.