mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
remove input call won't update the input queue.
it will get updated anyway - by unlock for instance
This commit is contained in:
@@ -85,13 +85,10 @@ public class InputQueue extends MyObservable implements java.io.Serializable {
|
||||
* a boolean.
|
||||
*/
|
||||
final void removeInput(Input inp) {
|
||||
FThreads.assertExecutedByEdt(false);
|
||||
Input topMostInput = inputStack.isEmpty() ? null : inputStack.pop();
|
||||
|
||||
if( topMostInput != inp )
|
||||
throw new RuntimeException("Cannot remove input " + inp.getClass().getSimpleName() + " because it's not on top of stack. Stack = " + inputStack );
|
||||
|
||||
this.updateObservers();
|
||||
}
|
||||
|
||||
public final boolean isEmpty() {
|
||||
|
||||
@@ -31,15 +31,9 @@ public abstract class InputSyncronizedBase extends InputBase implements InputSyn
|
||||
// ensure input won't accept any user actions.
|
||||
FThreads.invokeInEdtNowOrLater(new Runnable() { @Override public void run() { setFinished(); } });
|
||||
|
||||
// this will update input proxy, so there might be anything happening in the thread
|
||||
getQueue().invokeGameAction( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// this will update input proxy, so there might be anything happening in the thread
|
||||
getQueue().removeInput(InputSyncronizedBase.this);
|
||||
cdlDone.countDown();
|
||||
}
|
||||
});
|
||||
// thread irrelevant
|
||||
getQueue().removeInput(InputSyncronizedBase.this);
|
||||
cdlDone.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user