Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix old tokens being completely transparent when added to campaign
It used to be that `Token.tokenOpacity` would use the default value of `0` when an old token was loaded that didn't have the field. This would be modified into `1` so that the token would be opaque instead of transparent. Now that we support real zero opacity, we need another default value so that we distinguish it. The field is now a `Float` instead of a `float` so that `null` is now the default, and a value of `0` can be relied on as meaning fully transparent. `readResolve()` is also now responsible for fixing up the opacity rather than leaving that for the getter. Some cleanup is also included as `getTokenOpacity()` now longer needs to range-check the value, and we don't need a separate and public-facing `setTokenOpacity()` for string values.
- Loading branch information