Update FControlGameEventHandler

some method don't exist on mobile port and are specifically for desktop so let those routine run for its specific platform
This commit is contained in:
Anthony Calosa
2020-04-21 17:50:25 +08:00
parent 1f7faa773c
commit 3cdbf3eb67

View File

@@ -240,6 +240,9 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
@Override @Override
public Void visit(final GameEventSpellAbilityCast event) { public Void visit(final GameEventSpellAbilityCast event) {
needStackUpdate = true; needStackUpdate = true;
if(GuiBase.getInterface().isLibgdxPort()) {
return processEvent(); //mobile port don't have notify stack addition like the desktop
} else {
processEvent(); processEvent();
final Runnable notifyStackAddition = new Runnable() { final Runnable notifyStackAddition = new Runnable() {
@@ -249,7 +252,7 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
} }
}; };
GuiBase.getInterface().invokeInEdtLater(notifyStackAddition); GuiBase.getInterface().invokeInEdtLater(notifyStackAddition);
}
return null; return null;
} }
@@ -262,6 +265,9 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
@Override @Override
public Void visit(final GameEventSpellRemovedFromStack event) { public Void visit(final GameEventSpellRemovedFromStack event) {
needStackUpdate = true; needStackUpdate = true;
if(GuiBase.getInterface().isLibgdxPort()) {
return processEvent(); //mobile port don't have notify stack addition like the desktop
} else {
processEvent(); processEvent();
final Runnable notifyStackAddition = new Runnable() { final Runnable notifyStackAddition = new Runnable() {
@@ -271,7 +277,7 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
} }
}; };
GuiBase.getInterface().invokeInEdtLater(notifyStackAddition); GuiBase.getInterface().invokeInEdtLater(notifyStackAddition);
}
return null; return null;
} }
@@ -357,14 +363,12 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
@Override @Override
public Void visit(final GameEventCardChangeZone event) { public Void visit(final GameEventCardChangeZone event) {
if(event.to.getZoneType() == ZoneType.Battlefield) if(GuiBase.getInterface().isLibgdxPort()) {
refreshFieldUpdate = true; updateZone(event.from);
//pfps the change to the zones have already been performed with add and remove calls return updateZone(event.to);
// this is only for playing a sound } else {
// updateZone(event.from);
//return updateZone(event.to);
return processEvent(); return processEvent();
}
} }
@Override @Override
@@ -399,11 +403,12 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
@Override @Override
public Void visit(final GameEventShuffle event) { public Void visit(final GameEventShuffle event) {
//pfps the change to the library has already been performed by a setCards call if (GuiBase.getInterface().isLibgdxPort()) {
// this is only for playing a sound return updateZone(event.player.getZone(ZoneType.Library));
// return updateZone(event.player.getZone(ZoneType.Library)); } else {
return processEvent(); return processEvent();
} }
}
@Override @Override
public Void visit(final GameEventManaPool event) { public Void visit(final GameEventManaPool event) {