CallMeFoxie / Calendar

1 stars 2 forks source link

Question: Need an unlocalized token for the current season #3

Closed OreCruncher closed 8 years ago

OreCruncher commented 8 years ago

I am looking at integrating the Calendar API with Dynamic Surroundings. What I want to do is use the name of the current season as criteria for filtering sounds that can be played.

Right now in my data set I have regular expressions that does matching against a list of string tokens that I generate based on the current Minecraft world state. For example, the condition string may contain "day" and "raining" meaning it is daytime and it is currently raining. Any sounds that can match successfully against this condition string would be eligible for play.

As it relates to seasons I want to add a season token to my condition string. This will allow sounds to play only during specific seasons. For example, if it is "winter" I wouldn't want to have regular bird chirping playing because it is winter.

For this to work I need to have string tokens that are not localized that map to each distinct season. What I would like to have is a way to use the Calendar API to get the unlocalized string token that represents the season at the current point in time (i.e. "spring", "summer", "winter", "fall"). I know that seasonal providers can do things like have 14 different seasons if they chose, and that is OK. The key thing for me is to have a unique string token for each of those 14 seasons so I can build configuration files.

I hope this makes sense. :)

CallMeFoxie commented 8 years ago

Definitely! I like that idea :)

I have honestly completely forgot about localization and all the config files (and thus seasons defined in them) are unlocalized as of right now.

CallMeFoxie commented 8 years ago

So I've thought about it a bit and decided that the names provided from the API are unlocalized. I will provide a way to localize them soon (tm) (c) (r) :)

OreCruncher commented 8 years ago

Thanks! So ISeason.getName() will return the unlocalized name?

CallMeFoxie commented 8 years ago

Oops yes, forgot to add that to the javadoc. Yes, it will return an unlocalized name of the season, same for months. Getting localized version will be solved, too.

CallMeFoxie commented 8 years ago

in the code