v1.3.2: adjusted daily run timer to be language-neutral
This commit is contained in:
@@ -56,10 +56,6 @@ scenes.heroselectscene.daily_no=No
|
||||
scenes.heroselectscene.daily_unavailable=A new daily run is available every day at midnight UTC
|
||||
scenes.heroselectscene.daily_unavailable_long=It seems you've started a daily that's in the future! This can happen if you recently changed timezones, or if you changed your system clock. _Your next daily will be available in %d days._
|
||||
scenes.heroselectscene.daily_existing=You already have a daily run in progress. You must end that run before starting another daily.
|
||||
scenes.heroselectscene.daily_seconds=%d Seconds
|
||||
scenes.heroselectscene.daily_minutes=%d Minutes
|
||||
scenes.heroselectscene.daily_hours=%d Hours
|
||||
scenes.heroselectscene.daily_30_hours=30+ Hours
|
||||
scenes.heroselectscene.custom_seed_title=Enter a Custom Seed
|
||||
scenes.heroselectscene.custom_seed_desc=The same seed and game version always generate the same dungeon! Seeds are nine uppercase letters (e.g. ABC-DEF-GHI), but you can enter anything you want and the game will convert it. _Games with a custom seed cannot earn badges, contribute to games played, and appear at the bottom of the rankings page._
|
||||
scenes.heroselectscene.custom_seed_duplicate=You already have a regular game in progress with that seed. You must end that game before using that custom seed.
|
||||
|
||||
+15
-16
@@ -57,7 +57,11 @@ import com.watabou.noosa.ui.Component;
|
||||
import com.watabou.utils.DeviceCompat;
|
||||
import com.watabou.utils.GameMath;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class HeroSelectScene extends PixelScene {
|
||||
|
||||
@@ -482,31 +486,26 @@ public class HeroSelectScene extends PixelScene {
|
||||
|
||||
private long timeToUpdate = 0;
|
||||
|
||||
private final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss", Locale.ROOT);
|
||||
{
|
||||
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (Game.realTime > timeToUpdate){
|
||||
if (Game.realTime > timeToUpdate && visible){
|
||||
long diff = (SPDSettings.lastDaily() + DAY) - Game.realTime;
|
||||
|
||||
if (diff > 0){
|
||||
//<1 minute
|
||||
if (diff < MINUTE){
|
||||
text(Messages.get(HeroSelectScene.class, "daily_seconds", (diff / SECOND)+1));
|
||||
timeToUpdate = Game.realTime + SECOND;
|
||||
//<1 hour
|
||||
} else if (diff < HOUR){
|
||||
text(Messages.get(HeroSelectScene.class, "daily_minutes", (diff / MINUTE)+1));
|
||||
timeToUpdate = Game.realTime + 5*SECOND;
|
||||
//<30 hours (a few extra in case of timezone shenanigans)
|
||||
} else if (diff < (DAY + 6*HOUR)) {
|
||||
text(Messages.get(HeroSelectScene.class, "daily_hours", (diff / HOUR)+1));
|
||||
timeToUpdate = Game.realTime + 5*MINUTE;
|
||||
//>30 hours, probably a cheater!
|
||||
if (diff > 30*HOUR){
|
||||
text("30:00:00+");
|
||||
} else {
|
||||
text(Messages.get(HeroSelectScene.class, "daily_30_hours"));
|
||||
timeToUpdate = Game.realTime + 20*MINUTE;
|
||||
text(dateFormat.format(new Date(diff)));
|
||||
}
|
||||
textColor(0x888888);
|
||||
timeToUpdate = Game.realTime + SECOND;
|
||||
} else {
|
||||
text(Messages.get(HeroSelectScene.class, "daily"));
|
||||
textColor(0xFFFFFF);
|
||||
|
||||
Reference in New Issue
Block a user