Skip to content

Commit

Permalink
Deobfuscate UI code about skipping tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
StenAL committed May 18, 2024
1 parent 5a16e6b commit c42c613
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions client/src/main/java/agolf/game/GameControlPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@ public void update(Graphics var1) {
var1.fillRect(0, 0, this.anInt342, this.anInt343);
}

public void actionPerformed(ActionEvent var1) {
Object var2 = var1.getSource();
if (var2 == this.buttonSkip) {
if (this.gameContainer.gamePanel.method339(this.playerCount == 1)) {
public void actionPerformed(ActionEvent event) {
Object source = event.getSource();
if (source == this.buttonSkip) {
if (this.gameContainer.gamePanel.skipButtonPressed(this.playerCount == 1)) {
this.setVisible(false);
this.remove(this.buttonSkip);
this.setVisible(true);
this.skipButtonVisible = false;
}

} else if (var2 == this.buttonNewGame) {
} else if (source == this.buttonNewGame) {
this.buttonNewGame.removeActionListener(this);
this.setVisible(false);
this.remove(this.buttonNewGame);
this.setVisible(true);
this.aGamePlayerInfoPanel__341.readyForNewGameLocal();
this.gameContainer.gamePanel.requestNewGame();
} else {
if (var2 == this.buttonBack) {
if (source == this.buttonBack) {
this.buttonBack.removeActionListener(this);
this.setVisible(false);
this.remove(this.buttonBack);
Expand Down
8 changes: 4 additions & 4 deletions client/src/main/java/agolf/game/GamePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,11 @@ protected void sendEndStroke(int playerid, SynchronizedBool[] settings, int var3
this.gameContainer.connection.writeData("game\t" + data);
}

protected boolean method339(boolean var1) {
protected boolean skipButtonPressed(boolean isSinglePlayer) {
if (this.state == 1) {
if (!var1) {
this.gamePlayerInfoPanel.method366();
if (this.gamePlayerInfoPanel.method376() && this.gameCanvas.method137()) {
if (!isSinglePlayer) {
this.gamePlayerInfoPanel.voteSkip();
if (this.gamePlayerInfoPanel.shouldSkipTrack() && this.gameCanvas.method137()) {
this.gameCanvas.restartGame();
}

Expand Down
8 changes: 4 additions & 4 deletions client/src/main/java/agolf/game/GamePlayerInfoPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ protected void setGameOutcome(int[] outcome) {
this.repaint();
}

protected void method366() {
protected void voteSkip() {
this.voteSkip(this.playerId);
}

Expand Down Expand Up @@ -507,9 +507,9 @@ protected void method375(int[][] var1) {
this.repaint();
}

protected boolean method376() {
for (int var1 = 0; var1 < this.playerCount; ++var1) {
if (this.anIntArray394[var1] == 0 && !this.playerVotedToSkip[var1]) {
protected boolean shouldSkipTrack() {
for (int player = 0; player < this.playerCount; ++player) {
if (this.anIntArray394[player] == 0 && !this.playerVotedToSkip[player]) {
return false;
}
}
Expand Down

0 comments on commit c42c613

Please sign in to comment.