[Mobile] refactor netplay phase indicator

This commit is contained in:
Anthony Calosa
2021-10-06 21:28:39 +08:00
parent 38f7d1ba83
commit 050ecb51bd
4 changed files with 29 additions and 0 deletions

View File

@@ -223,11 +223,15 @@ public class MatchController extends AbstractGuiGame {
final VPhaseIndicator.PhaseLabel phaseLabel = view.getPlayerPanel(lastPlayer).getPhaseIndicator().getLabel(ph);
if (phaseLabel != null)
phaseLabel.setActive(true);
if (GuiBase.isNetworkplay())
getGameView().updateNeedsPhaseRedrawn(lastPlayer, PhaseType.CLEANUP);
} else if (getGameView().getPlayerTurn() != null) {
//set phaselabel
final VPhaseIndicator.PhaseLabel phaseLabel = view.getPlayerPanel(getGameView().getPlayerTurn()).getPhaseIndicator().getLabel(ph);
if (phaseLabel != null)
phaseLabel.setActive(true);
if (GuiBase.isNetworkplay())
getGameView().updateNeedsPhaseRedrawn(getGameView().getPlayerTurn(), ph);
}
}

View File

@@ -442,6 +442,17 @@ public class MatchScreen extends FScreen {
if (activeEffect != null) {
activeEffect.draw(g, 10, 10, 100, 100);
}
if (game.getNeedsPhaseRedrawn()) {
resetAllPhaseButtons();
if (game.getPlayerTurn() != null && game.getPhase() != null) {
final PhaseLabel phaseLabel = getPlayerPanel(game.getPlayerTurn()).getPhaseIndicator().getLabel(game.getPhase());
if (phaseLabel != null) {
phaseLabel.setActive(true);
game.clearNeedsPhaseRedrawn();
}
}
}
}
@Override