fafranco82 / swdestinydb

Star Wars Destiny Deckbuilder
52 stars 26 forks source link

Feature : non-unique elite characters dices #319

Closed jlannoy closed 3 years ago

jlannoy commented 3 years ago

This PR allows to manage correctly the non-unique elite characters, allowing to choose between a combinations of elite and non elite of those characters. First, here is how it appears with this PR.

In the deckbuild list :

Capture d’écran 2020-12-19 à 16 28 34

In the deckbuild modal :

Capture d’écran 2020-12-19 à 16 29 14

How do I manage it? There is a Doctrine migration adding a "dices" fields to a deckslot. The goal of this field is to contain an array of integers, each representing one instance of dices for a non unique elite characters. Each time it is needed, this new field is used instead of the "dice" one. Maybe it's not the cleanest solution but I wanted to keep it simple. The dices kind-of checkboxes are now the same template in the deckbuild list and in the modal.

It also therefore refactor other type of diced characters, not using anymore the "2nd" quantity field but a more generic way, allowing for example a third dice on a character.

It's not yet perfect in terms of UI but it's a huge step. We are using it since more than two weeks with our playtesters on our own swdestinydb instance and it seems ok for most situation. It also works with TTS deck export. I'll try to follow any bug related to this.

(Fixes #297)

fafranco82 commented 3 years ago

First of all... A HUGE thank you for your awesome work with this PR and the others!!!

The only thing to note is that this feature must be also applied to decklistslot and take into account when publishing a deck (a deck is private, a decklist is the public part, cloning the deck what you publish)

Thank you again!

jlannoy commented 3 years ago

Right, I didn't pay attention to that. I'll try fix it tomorrow :)