mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
# fix Cleanup Phase Highlight
- todo: find out why this is needed, something is affecting the getplayerturn on every eot..
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user