mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Updates to UI to separate out format filters
This commit is contained in:
@@ -309,6 +309,16 @@ public class GameFormat implements Comparable<GameFormat> {
|
||||
return coreList;
|
||||
}
|
||||
|
||||
public Iterable<GameFormat> getHistoricList() {
|
||||
List<GameFormat> coreList = new ArrayList<>();
|
||||
for(GameFormat format: naturallyOrdered){
|
||||
if(format.getFormatType().equals(FormatType.Historic)){
|
||||
coreList.add(format);
|
||||
}
|
||||
}
|
||||
return coreList;
|
||||
}
|
||||
|
||||
public GameFormat getStandard() {
|
||||
return this.map.get("Standard");
|
||||
}
|
||||
|
||||
@@ -92,6 +92,17 @@ public class CardManager extends ItemManager<PaperCard> {
|
||||
}
|
||||
menu.add(fmt);
|
||||
|
||||
JMenu fmthist = GuiUtils.createMenu("Historic Format");
|
||||
for (final GameFormat f : FModel.getFormats().getHistoricList()) {
|
||||
GuiUtils.addMenuItem(fmthist, f.getName(), null, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
itemManager.addFilter(new CardFormatFilter(itemManager, f));
|
||||
}
|
||||
}, FormatFilter.canAddFormat(f, itemManager.getFilter(CardFormatFilter.class)));
|
||||
}
|
||||
menu.add(fmthist);
|
||||
|
||||
GuiUtils.addMenuItem(menu, "Sets...", null, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -186,6 +186,17 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
|
||||
}
|
||||
menu.add(fmt);
|
||||
|
||||
final JMenu fmtall = GuiUtils.createMenu("Historic Format");
|
||||
for (final GameFormat f : FModel.getFormats().getHistoricList()) {
|
||||
GuiUtils.addMenuItem(fmtall, f.getName(), null, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
addFilter(new DeckFormatFilter(DeckManager.this, f));
|
||||
}
|
||||
}, FormatFilter.canAddFormat(f, getFilter(DeckFormatFilter.class)));
|
||||
}
|
||||
menu.add(fmtall);
|
||||
|
||||
GuiUtils.addMenuItem(menu, "Sets...", null, new Runnable() {
|
||||
@Override public void run() {
|
||||
final DeckSetFilter existingFilter = getFilter(DeckSetFilter.class);
|
||||
|
||||
@@ -166,6 +166,7 @@ public abstract class FormatFilter<T extends InventoryItem> extends ItemFilter<T
|
||||
@Override
|
||||
public boolean tap(Integer index, GameFormat value, float x, float y, int count) {
|
||||
selectedFormat=value;
|
||||
Forge.back();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
[format]
|
||||
Name:Kaladesh Block
|
||||
Type:Historic
|
||||
Order:109
|
||||
Sets:KLD, AER
|
||||
Reference in New Issue
Block a user