mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Restored functionality : deckeditor shows all valid formats for decks in its list.
This commit is contained in:
@@ -290,7 +290,6 @@ public class GameFormat implements Comparable<GameFormat> {
|
|||||||
if ( gf.isDeckLegal(deck) )
|
if ( gf.isDeckLegal(deck) )
|
||||||
return gf;
|
return gf;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NoFormat;
|
return NoFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,6 +299,8 @@ public class GameFormat implements Comparable<GameFormat> {
|
|||||||
if (gf.isDeckLegal(deck))
|
if (gf.isDeckLegal(deck))
|
||||||
result.add(gf);
|
result.add(gf);
|
||||||
}
|
}
|
||||||
|
if( result.isEmpty())
|
||||||
|
result.add(NoFormat);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,10 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.card.CardAiHints;
|
import forge.card.CardAiHints;
|
||||||
@@ -34,6 +37,7 @@ import forge.card.mana.ManaCost;
|
|||||||
import forge.deck.CardPool;
|
import forge.deck.CardPool;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
import forge.deck.DeckSection;
|
import forge.deck.DeckSection;
|
||||||
|
import forge.game.GameFormat;
|
||||||
import forge.gui.CardPreferences;
|
import forge.gui.CardPreferences;
|
||||||
import forge.item.IPaperCard;
|
import forge.item.IPaperCard;
|
||||||
import forge.item.InventoryItem;
|
import forge.item.InventoryItem;
|
||||||
@@ -407,8 +411,14 @@ public class ItemColumn extends TableColumn {
|
|||||||
if (deck == null) {
|
if (deck == null) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return Singletons.getModel().getFormats().getFormatOfDeck(deck).getIndex();
|
Iterable<GameFormat> all = Singletons.getModel().getFormats().getAllFormatsOfDeck(deck);
|
||||||
|
int acc = 0;
|
||||||
|
for(GameFormat gf : all) {
|
||||||
|
int ix = gf.getIndex();
|
||||||
|
if( ix < 30 )
|
||||||
|
acc |= 0x40000000 >> (ix - 1);
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Function<Entry<? extends InventoryItem, Integer>, Object>() {
|
new Function<Entry<? extends InventoryItem, Integer>, Object>() {
|
||||||
@@ -418,7 +428,8 @@ public class ItemColumn extends TableColumn {
|
|||||||
if (deck == null) {
|
if (deck == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return Singletons.getModel().getFormats().getFormatOfDeck(deck).getName();
|
Iterable<GameFormat> all = Singletons.getModel().getFormats().getAllFormatsOfDeck(deck);
|
||||||
|
return StringUtils.join(Iterables.transform(all, GameFormat.FN_GET_NAME) , ", ");
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
DECK_MAIN("Main", "Main Deck", 30, 30, 30, SortState.ASC, new IntegerRenderer(),
|
DECK_MAIN("Main", "Main Deck", 30, 30, 30, SortState.ASC, new IntegerRenderer(),
|
||||||
|
|||||||
Reference in New Issue
Block a user