mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
lock and invokeGameAction removed, removed input locks in PayManaBase ('cause HumanPlaySA sets these locks internally)
This commit is contained in:
@@ -74,7 +74,7 @@ public class InputCleanup extends InputPassPriorityBase {
|
||||
if (!player.getZone(ZoneType.Hand).contains(card))
|
||||
return;
|
||||
|
||||
game.getInputQueue().lockAndInvokeGameAction(new Runnable() {
|
||||
game.getInputQueue().invokeGameAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
card.getController().discard(card, null);
|
||||
|
||||
@@ -183,10 +183,10 @@ public abstract class InputPayManaBase extends InputSyncronizedBase implements I
|
||||
@Override
|
||||
public void run() {
|
||||
HumanPlay.playSpellAbility(chosen.getActivatingPlayer(), chosen);
|
||||
onManaAbilityPlayed(chosen);
|
||||
onManaAbilityPlayed(chosen);
|
||||
}
|
||||
};
|
||||
game.getInputQueue().lockAndInvokeGameAction(proc);
|
||||
game.getInputQueue().invokeGameAction(proc);
|
||||
// EDT that removes lockUI from input stack will call our showMessage() method
|
||||
}
|
||||
|
||||
|
||||
@@ -199,18 +199,6 @@ public class InputQueue extends MyObservable implements java.io.Serializable {
|
||||
input.awaitLatchRelease();
|
||||
}
|
||||
|
||||
public void lockAndInvokeGameAction(final Runnable proc) {
|
||||
Runnable toRun = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InputQueue.this.lock();
|
||||
proc.run();
|
||||
InputQueue.this.unlock();
|
||||
}
|
||||
};
|
||||
invokeGameAction(toRun);
|
||||
}
|
||||
|
||||
public void invokeGameAction(final Runnable proc) {
|
||||
if(FThreads.isEDT()) {
|
||||
FThreads.invokeInNewThread(proc);
|
||||
|
||||
Reference in New Issue
Block a user