Skip to content

Updated 'Copy Collection to Clipboard' menu item in the inventory view#10925

Open
mrstarbuck007 wants to merge 10 commits into
Card-Forge:masterfrom
mrstarbuck007:feature/copy-collection
Open

Updated 'Copy Collection to Clipboard' menu item in the inventory view#10925
mrstarbuck007 wants to merge 10 commits into
Card-Forge:masterfrom
mrstarbuck007:feature/copy-collection

Conversation

@mrstarbuck007

Copy link
Copy Markdown

Outputs the entire card collection, minus any cards in Auto-Sell, to the clipboard in Moxfield CSV format for easy importing.

… Outputs the entire card collection, minus any cards in Auto-Sell, to the clipboard in Moxfield CSV format for easy importing.
@mrstarbuck007 mrstarbuck007 changed the title Added 'Copy Collection to Clipboard' menu item in the inventory view Updated 'Copy Collection to Clipboard' menu item in the inventory view Jun 8, 2026

@Jetz72 Jetz72 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it'd be easier and more accurate to output the edition code and collector number rather than going through and grouping them by set.

Comment on lines +515 to +518
ItemPool<PaperCard> autoSellCards = AdventurePlayer.current().getAutoSellCards();
CardPool playedCards = AdventurePlayer.current().getCards().getFilteredPool(card -> !autoSellCards.contains(card));
menu.addItem(new FMenuItem(Forge.getLocalizer().getMessage("btnCopyCollectionToClipboard"), Forge.hdbuttons ? FSkinImage.HDEXPORT : FSkinImage.BLANK, e1 -> FDeckViewer.copyCollectionToClipboard(playedCards)));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should build playedCards when clicking the button rather than when opening the menul

Comment on lines +77 to +81
regexCardName = regexA.matcher(regexCardName).replaceAll("a");
regexCardName = regexE.matcher(regexCardName).replaceAll("e");
regexCardName = regexI.matcher(regexCardName).replaceAll("i");
regexCardName = regexO.matcher(regexCardName).replaceAll("o");
regexCardName = regexU.matcher(regexCardName).replaceAll("u");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have StringUtils::stripAccents, but why wouldn't we want to export the oracle name?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Moxfield csv import can't handle accented characters so we need to replace them with the ASCII equivalents.

@mrstarbuck007 mrstarbuck007 requested a review from Jetz72 June 9, 2026 01:47
@tool4ever

Copy link
Copy Markdown
Contributor

How about we don't try optimizing generic features for site-specific quirks? that seems like a neverending mess

@mrstarbuck007

mrstarbuck007 commented Jun 9, 2026 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants