[Mobile] add Shahrazad support

This commit is contained in:
Anthony Calosa
2021-02-03 03:37:44 +08:00
parent 5b80f48461
commit 524ac3ae0c
6 changed files with 42 additions and 6 deletions

View File

@@ -280,6 +280,21 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
return null;
}
@Override
public Void visit(final GameEventSubgameEnd event) {
if (event.maingame != null) {
for (Player p : event.maingame.getPlayers()) {
updateZone(p, ZoneType.Battlefield);
updateZone(p, ZoneType.Hand);
updateZone(p, ZoneType.Graveyard);
updateZone(p, ZoneType.Exile);
updateZone(p, ZoneType.Command);
}
return processEvent();
}
return null;
}
@Override
public Void visit(final GameEventZone event) {
if (event.player != null) {

View File

@@ -185,7 +185,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
return true; //if not in game, card can be shown
}
if(GuiBase.getInterface().isLibgdxPort()){
if(gameView.isGameOver()) {
if(gameView != null && gameView.isGameOver()) {
return true;
}
if(spectator!=null) { //workaround fix!! this is needed on above code or it will

View File

@@ -69,6 +69,7 @@ public class HostedMatch {
private final MatchUiEventVisitor visitor = new MatchUiEventVisitor();
private final Map<PlayerControllerHuman, NextGameDecision> nextGameDecisions = Maps.newHashMap();
private boolean isMatchOver = false;
public int subGameCount = 0;
public HostedMatch() {}
@@ -362,6 +363,7 @@ public class HostedMatch {
@Override
public Void visit(final GameEventSubgameStart event) {
subGameCount++;
event.subgame.subscribeToEvents(SoundSystem.instance);
event.subgame.subscribeToEvents(visitor);
@@ -387,7 +389,10 @@ public class HostedMatch {
}
}
};
GuiBase.getInterface().invokeInEdtAndWait(switchGameView);
if (GuiBase.getInterface().isLibgdxPort())
GuiBase.getInterface().invokeInEdtNow(switchGameView);
else
GuiBase.getInterface().invokeInEdtAndWait(switchGameView);
//ensure opponents set properly
for (final Player p : event.subgame.getPlayers()) {
@@ -419,7 +424,11 @@ public class HostedMatch {
}
}
};
GuiBase.getInterface().invokeInEdtAndWait(switchGameView);
if (GuiBase.getInterface().isLibgdxPort())
GuiBase.getInterface().invokeInEdtNow(switchGameView);
else
GuiBase.getInterface().invokeInEdtAndWait(switchGameView);
return null;
}