GithubHelp home page GithubHelp logo

mtg-workstation's People

Contributors

aroelke avatar celiazut avatar rroelke avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

celiazut rroelke

mtg-workstation's Issues

Create a Filter Bar for the Main Deck

For large decks (e.g. Commander), it can be unwieldy to look through the main deck for cards. This could be aided by adding a filter bar above the deck list similar to the one above the inventory.

Add a Tab for Card Analysis

  • Pie chart for categories or common attributes
  • Distribution of cards per color or devotion to a color
  • Mana produced vs. consumed

ManaCost/Symbol Fixes

  • Sorting ManaSymbols needs to be implemented.
  • Storing ManaSymbols in a Map<ManaSymbol, Integer> in ManaCosts might be better than just a List<ManaCost>
    • equals can be implemented just using the Map's equals method
    • An auxiliary list may still need to be maintained for sorting and displaying purposes

Use Snapshots Instead of a Changelog

Whenever a file is saved, keep a snapshot of the prior-saved version and store them all alongside the new version. The changelog tab should display a history of these snapshots with these features:

  • Inspect a snapshot
  • Restore a snapshot (only delete "future" snapshots on save and warn first when that might happen)
  • View the difference between two snapshots or the current state of the deck and a snapshot
  • Allow for deletion of entries or the entire log (all undoable)

Fix Card Numbers

In the past, some cards did not have numbers in their JSON fields. This post indicates how this might be fixed, if it hasn't already.

  • Investigate current MTGJSON to see if it added card numbers to those that don't have them printed
  • Fix if necessary

TristateCheckBox Colors

TristateCheckBox does/may not necessarily correctly follow the color behaviors of the look-and-feel. For example, on Windows 10 the box for partially selected does not change color upon rollover.

Loading the Inventory is Slow

It takes several seconds to wait for loading the inventory, which could get worse when on a slow machine. Possible solutions:

  • Parallelize processing the JSON input
  • After processing the JSON, cache the results in a file using Java's serialization mechanism and load from there unless a new version is detected (requires making cards mutable)

Add a Notes Tab

Add a tab where a user can input arbitrary text. Make it support text formatting if possible.

Save Categories and Decks in Plain Text

Possible formats:

  • JSON
  • Properties
  • Custom serialization (as it used to be)

Pros:

  • Allows reading of file outside of editor (for debugging, manual updating, etc.)
  • Depending on format, allows easier checking if new features have been added to the file

Cons:

  • Potential hit to performance when opening a deck
  • Effort in coding

Steps:

  • Change settings to desired format
  • Add method to Filter and CategorySpec to serialize in the desired format (don't remove existing serialization yet)
  • Change default categories to desired format
  • Add method to DeckSerializer to serialize decksd in the desired format
  • Move old serialization to import with a legacy option (but also secretly allow it to be used from the reguar open menu)

Dynamically Disable Popup Menu Items

Menu bar items are disabled if their actions wouldn't (or shouldn't) do anything while the menu is open. Popup menu items should be dynamically disabled/enabled the same way.

Fix for changes to mtgjson

Three changes:

  • AllSets-x.json no longer exists
  • AllSets.json has a different organization than older versions
  • There may be issues connecting and downloading

Fix Format Legality

At some point in the past, mtgjson.com changed the way it determines format legality, but this code has not been updated for the change.

  • Update legality determination based on current representation in JSON
  • MTGJSON now has a field indicating if a card can be a commander, and which formats it can be a commander in
  • Add support for partners

Right-Clicking Tables

  • Right clicking can only select individual rows; you can't extend selections using shift or drag like you can with the left mouse button
  • Behavior is odd when combined with drag-and-drop

CategorySpec Should Be Immutable

Class CategorySpec currently allows its fields to be changed via mutators. However, some components of the editor make copies of CategorySpecs and operate on those rather than the originals, throwing out the originals when done. This should be made the universal behavior my making the class immutable and having mutators return copies with the specific change made in a similar manner to how Scala's case classes work with their copy methods (except with separate functions for each field since Java doesn't have this feature).

Add TCGPlayer Link

MTGJSON now includes links to the TCGPlayer page for a card. Add the ability to go there, and possibly scrape the page for pricing as well.

Hand Calculation Improvements

  • Since the sideboard pane has been updated to allow multiple tabs with lists of extra cards, having a button to exclude cards from sample hand calculation can be removed.
  • Display a probability distribution for each entry in the table (on double-click or right-click)
  • Using the hypergeometric distribution to compute the expected number of cards from a category might be wrong
  • Add the ability to compute unions (or intersections) of multiple categories

Missing Flavor Text

The oracle and printed text panes appear to be missing the flavor text of the card.

"Fill Playset" in Extra List

The popup menu item to fill a playset of cards in an extra list adds four copies instead of filling up to four copies.

Exception in Card Display Panel

Sometimes CardImagePanel will throw an exception:

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:458)
	at editor.gui.display.CardImagePanel.setBounds(CardImagePanel.java:331)
	at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.layoutContainer(BasicTabbedPaneUI.java:2904)
	at java.desktop/java.awt.Container.layout(Container.java:1537)
	at java.desktop/java.awt.Container.doLayout(Container.java:1526)
	at java.desktop/java.awt.Container.validateTree(Container.java:1722)
	at java.desktop/java.awt.Container.validate(Container.java:1657)
	at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI.ensureCurrentLayout(BasicTabbedPaneUI.java:1646)
	at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI.getTabBounds(BasicTabbedPaneUI.java:1666)
	at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI.repaintTab(BasicTabbedPaneUI.java:2338)
	at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.focusLost(BasicTabbedPaneUI.java:4117)
	at java.desktop/java.awt.Component.processFocusEvent(Component.java:6524)
	at java.desktop/java.awt.Component.processFocusEvent(Component.java:6524)
	at java.desktop/java.awt.Component.processEvent(Component.java:6388)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1950)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1060)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:726)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Add ETA to Downloads

Estimate download speed somehow and figure out an ETA if it's taking too long.

Sort Mana Costs by Color

When sorting a list of cards using the mana cost column, make it be consistent by color (for example, single-color cards should be listed in WUBRG order).

Limit Number of Images Stored

So as to not blow up the file system size for images for every card, add a setting to only keep a certain number of cards and delete the oldest/least-frequently-used/etc. image when a new one is downloaded and the assigned limit is exceeded. Unlimited is also allowed.

Row Sorter Warning

Sometimes the card tables' row sorter will throw a warning:

WARNING: row index is bigger than sorter's row count. Most likely this is a wrong sorter usage.

Compilation errors

Hi,
After resolving encoding errors I still have some errors during maven compilation. It's mostly errors about types :
[ERROR] .../deck-editor/MTG Deck Editor/src/editor/database/characteristics/ManaType.java:[111,64] array required, but java.util.List<editor.database.characteristics.ManaType> found

Do you have them ?
Do you think I miss some step during the initialization of the project ?

I found a way to correct them http://stackoverflow.com/questions/20067956/array-required-but-arrayliststring-found but I would like to make sure I don't miss something before begin : there is almost 100 errors of this type.

Thanks!

Implement/Improve Cut/Copy/Paste

  • Account for multiples when importing flat arrays of cards
  • Support moving cards between decks and not just copying them (probably don't support moving from decks to other formats)
  • Implement cut/copy/paste using menu items and keyboard actions (currently only drag-and-drop is supported)
  • Copying from the card image panel should only copy that card
  • Make sure selecting table items via the keyboard still works
  • Cut/copy/paste categories between decks and to the presets list in the settings dialog
  • When cutting/copying a category, include cards in it
  • When pasting a category into a deck, decide if included cards should be pasted as well by default
  • Include a "Paste Special" option like Excel that allows the user to paste category only, cards only, or categories + cards

Generalize NumberFilter

Change NumberFilter so that it works with any Comparable, since all it does is test for equality or inequality, which can be done using compareTo. This should make it more compatible with CombatState and Loyalty.

Because of type erasure, it may then be necessary to make NumberFilter a subclass of this.

Add a Tab for Mana Analysis

  • Histogram of cards at each mana cost (bar graph, possibly allowing for display of a subset based on common characteristics or categories)
  • Expected amount of mana produced on each turn (line graph, overlaid)

Use Better Card Identification

MTGJSON may not update the multiverseid field for cards, but the uuid field seems to always exist. Try several methods of identifying a card:

  • uuid
  • multiverseid
  • Name + Expansion

This may cause items that aren't real cards, like tokens to appear in the inventory. This can be solved by removing non-card layouts and skipping items that aren't cards (or adding them and giving them a flag saying they aren't real cards).

CMC Updates

With the recent changes to split card CMC rules, all cards should now only have one CMC and not a list.

  • Fix cmc() so it returns int instead of List<Integer>
    • A split card's CMC is the sum of the faces not useful for analysis
    • A double-faced card's CMC is that of the front face
    • A meld card's CMC is that of the front face for the front faces and the sum of those of the front faces for the back face but that of the front face should be used for analyses
    • A flip card's CMC is that of the top face even when flipped
    • Modal cards' CMC is the front side
  • Remove minCmc(), as there is only one CMC now
  • Fix external references to cmc() so they don't refer to a list
  • Add a setting for split/modal card CMC: max, min, (weighted?) average, sum
  • It's "mana value" now
  • Add a setting to compute mean/median deck mana value using "real" mana value, min mana value, or max mana value

Remove CODES Field from CategorySpec

Now that the code uses Java's object serialization to store categories to disk, having a unique string "code" for them is probably unnecessary and using one of the existing enums is better.

Clean Up Card ID

An earlier restructure changed Cards to be stored in the inventory by Gatherer number rather than ID generated from mtgjson.com (not its ID field; this was generated from the card's name, expansion, and "image name"), making its id() method obsolete.

Encoding and deployment

Hi,
I’m really curious about your app !
I tried to deploy it (mvn install, then mvn deploy), but I had some encoding issues during deployment.

...
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
…
[ERROR] /.../deck-editor/MTG Deck Editor/src/editor/gui/CardTagPanel.java:[117,67] unmappable character for encoding UTF-8
…

I guess you’re using Windows OS, I tried on ubuntu with several encoding (UTF-8, ASCII, windows-1252…) but I doesn’t work.
I think that add encoding in pom.xml file could resolve the problem but I can’t find witch encoding… If by any chance you’ve got an idea about this issue.
Celia

Filter Enhancements

  • Add a flag to all filters that indicates if only the front face of a card should be filtered or if all faces should be filtered
  • Add comment lines
  • Add a filter bar to the main deck tab of the editor frame (could be dismissable and/or only appear if the deck is big enough)
  • Right-click a column header of the inventory (or the main deck after the above is implemented) to create a filter for that attribute
  • Change NumberFilter to work on all Comparables (this may require making NumberFilter a subclass of this new class, like how VariableNumberFilter is a subclass of NumberFilter)
  • Add predefined tokens to TextFilters. For example \cardtype, [cardtype], or ${cardtype} would match any card type, and so on for other attributes
  • Add buttons and/or click-and-drag areas to filter elements to allow for rearranging them

Fix Documentation Spacing

IntelliJ IDEA added spaces to parameter descriptions so they're all aligned. They should be removed.

Add Predefined Tokens to Text Filters

Add tokens that can be input that match a specific set of words for TextFilters. For example:

  • \cardtype matches any card type (Artifact, Creature, Enchatment. etc.)
  • \permanent matches any permanent type (not Instant or Sorcery)
  • \creature matches any creature type (Elf, Wizard, Human, etc.)
  • \basic matches any basic land type

Add more to this list as ideas appear.

Possibilities for delimiters:

  • \token
  • [token]

Combine Different Printings of the Same Card

  • Only show one entry in any deck list for all printings of a card
  • Allow for a choice of printing in a card image panel and in the printed text panel
  • Create a setting for default choice
    • Most/least recent printing
    • First/last within a set
    • Override for specific cards (settable from card image panel as well)
  • Match card on any printing's multiverseid

Use Optional Instead of Null Checks

The Optional class is better than allowing null values, as it makes it explicit when a value can be missing. Also, it may reduce code because you can use x.ifPresent(x -> code) rather than if (x == null) { code }. There's also ifPresentOrElse for when stuff should be done when the object is null.

Places where this could be useful:

Sample Hand Exception

An IndexOutOfBoundsException for attempting to access index 0 of a list of size 0 occurs when the "New Hand" button is pressed on the sample hand tab.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.