Skip to content
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

Hide non-existent card values in infowidget and cardframe #3239

Merged
merged 6 commits into from
May 15, 2018
Merged

Hide non-existent card values in infowidget and cardframe #3239

merged 6 commits into from
May 15, 2018

Conversation

berserkingyadis
Copy link
Contributor

@berserkingyadis berserkingyadis commented May 11, 2018

Related Ticket(s)

Short roundup of the initial problem

When clicking on a card linked in the chat (or displaying it in the deck editor), it contains emtpy values. For example Power/Toughness for spells or mana cost for lands.
34120202-1c3c75d0-e425-11e7-89d1-f8c9eb152e78

What will change with this Pull Request?

  • Empty fields will be hidden in both the Infowidget (clicking on cards from chat) and the Deckeditor
  • Cards without color will have the Color string "Colorless"

Screenshots

Before

before
before2

After

after
after2

@berserkingyadis
Copy link
Contributor Author

berserkingyadis commented May 11, 2018

This is still work in progress, I tried hiding the big card text box (empty for lands for example), but doing so will hide some of the card type text aswell. This may be the result of some fixed/hardcoded pixel values.

@tooomm
Copy link
Member

tooomm commented May 11, 2018

Cards without color will have the Color string "Colorless"

That's also a nice addition! 👍

@berserkingyadis
Copy link
Contributor Author

What about the CardinfoWidget which opens when clicking a card which does not exist? (Example: [[Gozilla]])

Currently its this

404before

i could change it to this (text hidden, only cardback)

404after

I realize this is not the most optimal solution but it could be done easily.

@ZeldaZach
Copy link
Member

Make sure you run the ./clangify.sh at the top level so your code gets formatted correctly! :)

@ZeldaZach
Copy link
Member

I also like the idea of having a blank card / nothing show when you hover over a bad card (something that's not found in your local db)

@Daenyth
Copy link
Member

Daenyth commented May 11, 2018

I like the idea of having the "card missing" back image showing a label under the card back image showing "unknown card: $name"

@berserkingyadis
Copy link
Contributor Author

berserkingyadis commented May 12, 2018

Unknown cards now look like this in the CardInfoWidget

gozilla

This should be everything, someone please test this. This PR affects the cardframe in the deckbuilder, the cardinfowidget when clicking on a linked card, the cardframe in the game view (when hovering over a card for example) and (dont know if that still is in cockatrice) middle clicking a card in the game view.

@Daenyth
Copy link
Member

Daenyth commented May 12, 2018

Awesome! This is really exciting :)

Copy link
Member

@tooomm tooomm left a comment

Choose a reason for hiding this comment

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

Gave things a run in the client - I think it all works out as expected! 👍

@tooomm tooomm changed the title [WIP] Hide non-existent card values in infowidget and cardframe Hide non-existent card values in infowidget and cardframe May 12, 2018
Copy link
Contributor

@Vafthrudnir Vafthrudnir left a comment

Choose a reason for hiding this comment

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

Great changes!
Hadn't had the chance to test it, but code-wise looks correct. 👍

@ZeldaZach ZeldaZach merged commit 3b3f5a6 into Cockatrice:master May 15, 2018
@berserkingyadis berserkingyadis deleted the cardinfo_hide_emptystrings branch May 15, 2018 09:38
@Daenyth
Copy link
Member

Daenyth commented May 15, 2018

@berserkingyadis Thanks so much for the contribution, and congrats on your first merge! :)

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.

None yet

5 participants