EwenDC / root-automated-setup

Automated Advanced Setup for Leder Game's popular board game Root
https://ewendc.github.io/root-automated-setup/
5 stars 4 forks source link

Show specific Vagabond pawn in Choose Faction step if the Vagabond Pack was selected #26

Open steevefontaine opened 1 year ago

steevefontaine commented 1 year ago

In the Choose Faction step of the faction draft, the Vagabond pawn shown in the Vagabond description is always the black (Ronin) pawn or the white (Thief) pawn, and it doesn't match the selected Vagabond character.

Capture d'écran_20221124_153558

In this example, I selected the Scoundrel but the app shows the Ronin pawn instead of the Scoundrel pawn.

The current behavior is fine if I don't have the Vagabond pack. But if I have the Vagabond pack (which means if this expansion was selected in the first step), I will always play with the new specific Vagabond pawns, so I would expect the app to show the according pawn in the description of the selected Vagabond character.

This is clearly a very minor issue.

EwenDC commented 1 year ago

Haha this is something I did think about the best way of tackling while developing. The current solution was the easiest way of showing both meeples without having bespoke logic, since I didn't want a hardcoded check of "if user has vagabond pack then use vagabond character meeple".

This would be a quite simple change to componentCount. Using the already retrieved selectedFaction, you can check if the faction has an associated vagabond. If there is, and the component prop is "warriors", grab the selected vagabond image from selectedFaction.vagabond.image and render it before the faction warrior image like so: image