Updates to UI to separate out format filters

This commit is contained in:
austinio7116
2018-04-03 17:27:42 +01:00
committed by maustin
parent e01eab131f
commit def7ba5faf
5 changed files with 33 additions and 5 deletions

View File

@@ -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");
}

View File

@@ -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() {

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -1,5 +0,0 @@
[format]
Name:Kaladesh Block
Type:Historic
Order:109
Sets:KLD, AER