# 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); return new Rectangle(0, VPrompt.HEIGHT, scroller.getWidth(), getHeight() - 2 * VPrompt.HEIGHT);
} }
private PlayerView lastPlayer;
@Override @Override
protected void drawOverlay(Graphics g) { protected void drawOverlay(Graphics g) {
final GameView game = MatchController.instance.getGameView(); final GameView game = MatchController.instance.getGameView();
if (game == null) { return; } 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 //reset phase labels
resetAllPhaseButtons(); resetAllPhaseButtons();
//set phaselabel if (lastPlayer != null && PhaseType.CLEANUP.equals(ph)) {
final PhaseLabel phaseLabel = getPlayerPanel(game.getPlayerTurn()).getPhaseIndicator().getLabel(game.getPhase()); //set phaselabel
if (phaseLabel != null) final PhaseLabel phaseLabel = getPlayerPanel(lastPlayer).getPhaseIndicator().getLabel(ph);
phaseLabel.setActive(true); 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) { if(gameMenu!=null) {