mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
phase indicator
This commit is contained in:
@@ -209,10 +209,27 @@ public class MatchController extends AbstractGuiGame {
|
|||||||
public void alertUser() {
|
public void alertUser() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
private PlayerView lastPlayer;
|
||||||
@Override
|
@Override
|
||||||
public void updatePhase(boolean saveState) {
|
public void updatePhase(boolean saveState) {
|
||||||
final PhaseType ph = getGameView().getPhase();
|
final PhaseType ph = getGameView().getPhase();
|
||||||
|
if (ph != null) {
|
||||||
|
if (ph.isBefore(PhaseType.END_OF_TURN))
|
||||||
|
lastPlayer = getGameView().getPlayerTurn();
|
||||||
|
//reset phase labels
|
||||||
|
view.resetAllPhaseButtons();
|
||||||
|
if (lastPlayer != null && PhaseType.CLEANUP.equals(ph)) {
|
||||||
|
//set phaselabel
|
||||||
|
final VPhaseIndicator.PhaseLabel phaseLabel = view.getPlayerPanel(lastPlayer).getPhaseIndicator().getLabel(ph);
|
||||||
|
if (phaseLabel != null)
|
||||||
|
phaseLabel.setActive(true);
|
||||||
|
} 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())
|
if(GuiBase.isNetworkplay())
|
||||||
checkStack();
|
checkStack();
|
||||||
|
|||||||
@@ -349,32 +349,6 @@ 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
|
|
||||||
public void draw(Graphics g) {
|
|
||||||
super.draw(g);
|
|
||||||
final GameView game = MatchController.instance.getGameView();
|
|
||||||
if (game == null) { return; }
|
|
||||||
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(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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawOverlay(Graphics g) {
|
protected void drawOverlay(Graphics g) {
|
||||||
final GameView game = MatchController.instance.getGameView();
|
final GameView game = MatchController.instance.getGameView();
|
||||||
|
|||||||
Reference in New Issue
Block a user