()
| 22 | private static FDeckViewer deckViewer; |
| 23 | private static FPopupMenu menu = new FPopupMenu() { |
| 24 | @Override |
| 25 | protected void buildMenu() { |
| 26 | Deck deck = deckViewer.deck; |
| 27 | for (Entry<DeckSection, CardPool> entry : deck) { |
| 28 | final DeckSection section = entry.getKey(); |
| 29 | final CardPool pool = entry.getValue(); |
| 30 | int count = pool.countAll(); |
| 31 | if (count == 0) { continue; } |
| 32 | |
| 33 | final String captionPrefix = section.getLocalizedName(); |
| 34 | final FImage icon = FDeckEditor.iconFromDeckSection(section); |
| 35 | |
| 36 | FMenuItem item = new FMenuItem(captionPrefix + " (" + count + ")", icon, e -> deckViewer.setCurrentSection(section)); |
| 37 | if (section == deckViewer.currentSection) { |
| 38 | item.setSelected(true); |
| 39 | } |
| 40 | addItem(item); |
| 41 | } |
| 42 | addItem(new FMenuItem(Forge.getLocalizer().getMessage("btnCopyToClipboard"), Forge.hdbuttons ? FSkinImage.HDEXPORT : FSkinImage.BLANK, e -> copyDeckToClipboard(deckViewer.deck))); |
| 43 | } |
| 44 | }; |
| 45 | |
| 46 | public static void copyDeckToClipboard(Deck deck) { |
nothing calls this directly
no test coverage detected