mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Merge branch 'fixups' into 'master'
Fixups Closes #680, #676, and #673 See merge request core-developers/forge!905
This commit is contained in:
@@ -891,7 +891,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
// ensure that selection is within maximum allowed changeNum
|
||||
do {
|
||||
selectedCards = decider.getController().chooseCardsForZoneChange(destination, origin, sa, fetchList, delayedReveal, selectPrompt, decider);
|
||||
} while (selectedCards.size() > changeNum);
|
||||
} while (selectedCards != null && selectedCards.size() > changeNum);
|
||||
for (Card card : selectedCards) {
|
||||
chosenCards.add(card);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package forge.screens.home.online;
|
||||
|
||||
import java.net.BindException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,6 +8,7 @@ import javax.swing.JMenu;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import forge.FThreads;
|
||||
import forge.error.BugReporter;
|
||||
import forge.gui.FNetOverlay;
|
||||
import forge.gui.SOverlayUtils;
|
||||
import forge.gui.framework.EDocID;
|
||||
@@ -19,6 +21,7 @@ import forge.screens.home.CHomeUI;
|
||||
import forge.screens.home.CLobby;
|
||||
import forge.screens.home.VLobby;
|
||||
import forge.screens.home.sanctioned.ConstructedGameMenu;
|
||||
import forge.util.gui.SOptionPane;
|
||||
|
||||
public enum CSubmenuOnlineLobby implements ICDoc, IMenuProvider {
|
||||
SINGLETON_INSTANCE;
|
||||
@@ -41,7 +44,18 @@ public enum CSubmenuOnlineLobby implements ICDoc, IMenuProvider {
|
||||
join(url);
|
||||
}
|
||||
else {
|
||||
host();
|
||||
try {
|
||||
host();
|
||||
} catch (Exception ex) {
|
||||
// IntelliJ swears that BindException isn't thrown in this try block, but it is!
|
||||
if (ex.getClass() == BindException.class) {
|
||||
SOptionPane.showErrorDialog("Unable to start server, port already in use!");
|
||||
SOverlayUtils.hideOverlay();
|
||||
} else {
|
||||
BugReporter.reportException(ex);
|
||||
}
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18,6 +18,7 @@ import forge.control.FControlGamePlayback;
|
||||
import forge.deck.CardPool;
|
||||
import forge.deck.Deck;
|
||||
import forge.deck.DeckSection;
|
||||
import forge.error.BugReporter;
|
||||
import forge.events.UiEventNextGameDecision;
|
||||
import forge.game.*;
|
||||
import forge.game.ability.AbilityFactory;
|
||||
@@ -60,6 +61,7 @@ import forge.util.TextUtil;
|
||||
import forge.util.collect.FCollection;
|
||||
import forge.util.collect.FCollectionView;
|
||||
import forge.util.gui.SOptionPane;
|
||||
import io.sentry.Sentry;
|
||||
import org.apache.commons.lang3.Range;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
@@ -458,6 +460,11 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
@Override
|
||||
public <T extends GameEntity> List<T> chooseEntitiesForEffect(final FCollectionView<T> optionList,
|
||||
final DelayedReveal delayedReveal, final SpellAbility sa, final String title, final Player targetedPlayer) {
|
||||
|
||||
// useful details for debugging problems with the mass select logic
|
||||
Sentry.getContext().addExtra("Card", sa.getCardView().toString());
|
||||
Sentry.getContext().addExtra("SpellAbility", sa.toString());
|
||||
|
||||
// Human is supposed to read the message and understand from it what to
|
||||
// choose
|
||||
if (optionList.isEmpty()) {
|
||||
@@ -493,7 +500,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
input.setCancelAllowed(true);
|
||||
input.setMessage(MessageUtil.formatMessage(title, player, targetedPlayer));
|
||||
input.showAndWait();
|
||||
return (List<T>) Iterables.getFirst(input.getSelected(), null);
|
||||
return (List<T>) input.getSelected();
|
||||
}
|
||||
|
||||
tempShow(optionList);
|
||||
|
||||
Reference in New Issue
Block a user