mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Have mobile game handle opening/closing mana pools itself
to improve compatibility with network play
This commit is contained in:
@@ -41,8 +41,8 @@ public interface IGuiGame {
|
||||
void enableOverlay();
|
||||
void disableOverlay();
|
||||
void finishGame();
|
||||
Object showManaPool(PlayerView player);
|
||||
void hideManaPool(PlayerView player, Object zoneToRestore);
|
||||
void showManaPool(PlayerView player);
|
||||
void hideManaPool(PlayerView player);
|
||||
void updateStack();
|
||||
void updateZones(Iterable<PlayerZoneUpdate> zonesToUpdate);
|
||||
void updateSingleCard(CardView card);
|
||||
|
||||
@@ -39,7 +39,6 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
||||
protected ManaCostBeingPaid manaCost;
|
||||
protected final SpellAbility saPaidFor;
|
||||
private final boolean wasFloatingMana;
|
||||
private final Object zoneToRestore;
|
||||
private final Queue<Card> delaySelectCards = new LinkedList<Card>();
|
||||
|
||||
private boolean bPaid = false;
|
||||
@@ -55,13 +54,15 @@ public abstract class InputPayMana extends InputSyncronizedBase {
|
||||
|
||||
//if player is floating mana, show mana pool to make it easier to use that mana
|
||||
wasFloatingMana = !player.getManaPool().isEmpty();
|
||||
zoneToRestore = wasFloatingMana ? getController().getGui().showManaPool(PlayerView.get(player)) : null;
|
||||
if (wasFloatingMana) {
|
||||
getController().getGui().showManaPool(PlayerView.get(player));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
if (wasFloatingMana) { //hide mana pool if it was shown due to floating mana
|
||||
getController().getGui().hideManaPool(PlayerView.get(player), zoneToRestore);
|
||||
getController().getGui().hideManaPool(PlayerView.get(player));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public enum ProtocolMethod {
|
||||
enableOverlay (Mode.SERVER),
|
||||
disableOverlay (Mode.SERVER),
|
||||
finishGame (Mode.SERVER),
|
||||
showManaPool (Mode.SERVER, Object.class, PlayerView.class),
|
||||
showManaPool (Mode.SERVER, Void.TYPE, PlayerView.class),
|
||||
hideManaPool (Mode.SERVER, Void.TYPE, PlayerView.class),
|
||||
updateStack (Mode.SERVER),
|
||||
updateZones (Mode.SERVER, Void.TYPE, Iterable/*PlayerZoneUpdate*/.class),
|
||||
|
||||
@@ -117,14 +117,13 @@ public class NetGuiGame extends AbstractGuiGame {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object showManaPool(final PlayerView player) {
|
||||
public void showManaPool(final PlayerView player) {
|
||||
send(ProtocolMethod.showManaPool, player);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideManaPool(final PlayerView player, final Object zoneToRestore) {
|
||||
send(ProtocolMethod.hideManaPool, player, zoneToRestore);
|
||||
public void hideManaPool(final PlayerView player) {
|
||||
send(ProtocolMethod.hideManaPool, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user