mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Fix so extra hand panes removed after losing control of another player
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package forge.control;
|
package forge.control;
|
||||||
|
|
||||||
import com.google.common.eventbus.Subscribe;
|
import com.google.common.eventbus.Subscribe;
|
||||||
|
|
||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
@@ -26,6 +27,7 @@ import forge.gui.toolbox.special.PhaseLabel;
|
|||||||
import forge.net.FServer;
|
import forge.net.FServer;
|
||||||
import forge.util.Lang;
|
import forge.util.Lang;
|
||||||
import forge.util.maps.MapOfLists;
|
import forge.util.maps.MapOfLists;
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -118,14 +120,17 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
FThreads.invokeInEdtNowOrLater(new Runnable() { @Override public void run() {
|
FThreads.invokeInEdtNowOrLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
CMatchUI.SINGLETON_INSTANCE.initHandViews(FServer.instance.getLobby().getGuiPlayer());
|
CMatchUI.SINGLETON_INSTANCE.initHandViews(FServer.instance.getLobby().getGuiPlayer());
|
||||||
SLayoutIO.loadLayout(null);
|
SLayoutIO.loadLayout(null);
|
||||||
VMatchUI.SINGLETON_INSTANCE.populate();
|
VMatchUI.SINGLETON_INSTANCE.populate();
|
||||||
for (VHand h : VMatchUI.SINGLETON_INSTANCE.getHands()) {
|
for (VHand h : VMatchUI.SINGLETON_INSTANCE.getHands()) {
|
||||||
h.getLayoutControl().updateHand();
|
h.getLayoutControl().updateHand();
|
||||||
}
|
}
|
||||||
} });
|
}
|
||||||
|
});
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,15 @@ public enum VMatchUI implements IVTopLevelUI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove any hand panels that aren't needed anymore
|
||||||
|
for (int i = EDocID.Hands.length - 1; i >= lstHands.size(); i--) {
|
||||||
|
DragCell cellWithHand = EDocID.Hands[i].getDoc().getParentCell();
|
||||||
|
if (cellWithHand != null) {
|
||||||
|
cellWithHand.removeDoc(EDocID.Hands[i].getDoc());
|
||||||
|
EDocID.Hands[i].setDoc(new VEmptyDoc(EDocID.Hands[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Fill in gaps
|
// Fill in gaps
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user