feat(LocationSettings): Add drop ratio to grid settings #1347
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[This performs a database migration]
This is a new feature that at the same time also is a bugfix.
It adds a new setting to the location grid setting.
context:
PA has an option to auto scale assets when dropped if they have a specific format in their name. For example goblin_1x1 should in normal circumstances fit exactly 1 grid cell, dragon_3x3 should be resized to 3 by 3 grid cells.
The existing implementation was erroneously using a method to do this based on the common 5ft system to automatically adjust this when a location had a bigger size (e.g. 10ft maps would automatically make something_2x2 fit in 1 cell)
This however completely breaks for everything that does not use the 5ft system, be it because you use SI units or because your system uses something custom or you enjoy defining your sizes in terms of pizzas.
The simple fix is to disable that system, but then dropping assets on maps that have a different scale no longer works properly. So to address that as well, a new setting is added that defines how these assets should be scaled when dropped on the map.
A drop ratio of 1 is the default, it means the asset will resize purely on it's specified dimensions.
A drop ratio of 0.5 would resize a something_2x2 to 1x1.
This fixes #1345.