mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
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:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user