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;
|
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() {
|
public GameFormat getStandard() {
|
||||||
return this.map.get("Standard");
|
return this.map.get("Standard");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,17 @@ public class CardManager extends ItemManager<PaperCard> {
|
|||||||
}
|
}
|
||||||
menu.add(fmt);
|
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() {
|
GuiUtils.addMenuItem(menu, "Sets...", null, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
@@ -186,6 +186,17 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
|
|||||||
}
|
}
|
||||||
menu.add(fmt);
|
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() {
|
GuiUtils.addMenuItem(menu, "Sets...", null, new Runnable() {
|
||||||
@Override public void run() {
|
@Override public void run() {
|
||||||
final DeckSetFilter existingFilter = getFilter(DeckSetFilter.class);
|
final DeckSetFilter existingFilter = getFilter(DeckSetFilter.class);
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ public abstract class FormatFilter<T extends InventoryItem> extends ItemFilter<T
|
|||||||
@Override
|
@Override
|
||||||
public boolean tap(Integer index, GameFormat value, float x, float y, int count) {
|
public boolean tap(Integer index, GameFormat value, float x, float y, int count) {
|
||||||
selectedFormat=value;
|
selectedFormat=value;
|
||||||
|
Forge.back();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
[format]
|
|
||||||
Name:Kaladesh Block
|
|
||||||
Type:Historic
|
|
||||||
Order:109
|
|
||||||
Sets:KLD, AER
|
|
||||||
Reference in New Issue
Block a user