nthiebes / old-world-builder

An army builder for Warhammer: The Old World and Warhammer Fantasy Battles.
https://old-world-builder.com
Other
25 stars 38 forks source link

Feat: Display a single armor option as checkbox instead of radioset. #148

Closed TheMost82 closed 7 months ago

TheMost82 commented 8 months ago

Fixes not being able to deselect a single armor option.

TheMost82 commented 8 months ago

Confirmed working example: image image

Still working for existing multiple selection units: image

TheMost82 commented 8 months ago

Thanks in advance for reviewing! One sidenote: Now that i got the dev env up and running i am thinking about refactoring the whole unit section a bit to make all radio sets and checkboxes easier to read. Would require a larger review then though... :)

TheMost82 commented 7 months ago

Alright, finally got back to this topic, were a few hectic weeks and did not have the mind for it :) Refactored based on your comments:

I also tried to disable the checkbox when only a single armor option is available that is already activated by default in the units source - but I did not get this to work, only based on the already loaded units armor where the current active state is toggled. Maybe you could add this and show me how one would do that? 🥺

nthiebes commented 7 months ago

@TheMost82 I merged and deployed your changes! Besides some adjustments to datasets (removing a few "no armour" options) I made sure to use radio buttons for single armor options that are active by default: https://github.com/nthiebes/old-world-builder/commit/e485e18737641cade6b86891b52d52cb2201f709

TheMost82 commented 7 months ago

Thanks for sharing, that helped my understanding of the project structure! 👍