# fix Cleanup Phase Highlight

- todo: find out why this is needed, something is affecting the getplayerturn on every eot..
This commit is contained in:
Anthony Calosa
2021-10-05 13:05:10 +08:00
parent 693d5c4597
commit eafd04c6e6

View File

@@ -348,19 +348,29 @@ public class MatchScreen extends FScreen {
}
return new Rectangle(0, VPrompt.HEIGHT, scroller.getWidth(), getHeight() - 2 * VPrompt.HEIGHT);
}
private PlayerView lastPlayer;
@Override
protected void drawOverlay(Graphics g) {
final GameView game = MatchController.instance.getGameView();
if (game == null) { return; }
if (game.getPlayerTurn() != null && game.getPhase() != null) {
if (game.getPhase() != null) {
final PhaseType ph = game.getPhase();
if (ph.isBefore(PhaseType.END_OF_TURN))
lastPlayer = game.getPlayerTurn();
//reset phase labels
resetAllPhaseButtons();
if (lastPlayer != null && PhaseType.CLEANUP.equals(ph)) {
//set phaselabel
final PhaseLabel phaseLabel = getPlayerPanel(game.getPlayerTurn()).getPhaseIndicator().getLabel(game.getPhase());
final PhaseLabel phaseLabel = getPlayerPanel(lastPlayer).getPhaseIndicator().getLabel(ph);
if (phaseLabel != null)
phaseLabel.setActive(true);
} else if (game.getPlayerTurn() != null) {
//set phaselabel
final PhaseLabel phaseLabel = getPlayerPanel(game.getPlayerTurn()).getPhaseIndicator().getLabel(ph);
if (phaseLabel != null)
phaseLabel.setActive(true);
}
}
if(gameMenu!=null) {