-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow non-db cards to be moved around #2960
Conversation
I like the idea of painting the background with a css style (so it's themable) defaulting to red when we don't have the card. That can be a separate PR |
cockatrice/src/decklistmodel.cpp
Outdated
@@ -264,11 +264,44 @@ QModelIndex DeckListModel::findCard(const QString &cardName, const QString &zone | |||
return nodeToIndex(cardNode); | |||
} | |||
|
|||
QModelIndex DeckListModel::addCard(const QString &cardName, const QString &zoneName) | |||
QModelIndex DeckListModel::addCard(const QString &cardName, const QString &zoneName, bool anAddAnyway) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the an
in anAddAnyway
?
Maybe rename to addIfMissingFromDb
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an = argument variable, n = integer... should be a b = boolean. Will fix this to be
abAddAnyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use hungarian notation, please don't do that. We can tell it's an argument because it's in the argument list and we can tell it's a boolean because it's labelled bool
.
I guess we are good here then after the var rename @Daenyth ? |
Fixes #2954
Before we could not move cards around if they weren't in the DB b/c if the card was not in the db, the program would discard the entry. There is now an overload variable that tells the program to pretend it's in the database with default values and continue as directed.
Load from Clipboard:
![screenshot 2017-12-15 23 51 43](https://user-images.githubusercontent.com/7460172/34067395-ed848c84-e1f2-11e7-9565-c0c387f9d01a.png)
Highlight the row and press "S":
![screenshot 2017-12-15 23 51 48](https://user-images.githubusercontent.com/7460172/34067394-ed4bb3a0-e1f2-11e7-965c-eb67a4d1319a.png)