Closed Wartori54 closed 6 months ago
I'm still a little on the fence about this change personally and am a little unsure if casting to Unlocalized is going to be confusing or unclear for people who want to use these in an unlocalized way, but I suppose we can try it for a while and see how people react to it. Although if we're going in this direction I may do a small follow up change to this area to revert it back to how things were structured before my change to simplify things, where the menu items were using primary constructors on the class.
This abstracts localization handling from all the constructors of all the classes derived from
Item
to a singleLocalized
class, the major benefit of this is code de-duplication. This does not require any changes from the user sinceLocalized
can be implicitly casted from string. In order to re-introduce the ability to draw unlocalized strings to the screen a subclass ofLocalized
was added which can also be casted from a string but it must be done explicitly:(Unlocalized) "Hello, Fuji!"
, thus getting rid of anylocalized = true
in the constructor parameters.