Adjusted for the web port
This commit is contained in:
@@ -43,6 +43,7 @@ import com.watabou.noosa.Game;
|
||||
import com.watabou.utils.Bundlable;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.FileUtils;
|
||||
import com.watabou.utils.DeviceCompat;;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
@@ -56,6 +57,7 @@ import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.Random;
|
||||
|
||||
public enum Rankings {
|
||||
|
||||
@@ -64,6 +66,11 @@ public enum Rankings {
|
||||
public static final int TABLE_SIZE = 11;
|
||||
|
||||
public static final String RANKINGS_FILE = "rankings.dat";
|
||||
|
||||
private static String generateUUID() {
|
||||
Random random = new Random();
|
||||
return Long.toHexString(random.nextLong()) + "-" + Long.toHexString(random.nextLong());
|
||||
}
|
||||
|
||||
public ArrayList<Record> records;
|
||||
public int lastRecord;
|
||||
@@ -116,7 +123,11 @@ public enum Rankings {
|
||||
|
||||
INSTANCE.saveGameData(rec);
|
||||
|
||||
if (DeviceCompat.isWeb()) {
|
||||
rec.gameID = generateUUID();
|
||||
} else {
|
||||
rec.gameID = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
if (rec.daily){
|
||||
if (Dungeon.dailyReplay){
|
||||
@@ -533,7 +544,11 @@ public enum Rankings {
|
||||
if (bundle.contains(DATA)) gameData = bundle.getBundle(DATA);
|
||||
if (bundle.contains(ID)) gameID = bundle.getString(ID);
|
||||
|
||||
if (DeviceCompat.isWeb()) {
|
||||
if (gameID == null) gameID = generateUUID();
|
||||
} else {
|
||||
if (gameID == null) gameID = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -643,11 +643,13 @@ public class GameScene extends PixelScene {
|
||||
public void destroy() {
|
||||
|
||||
//tell the actor thread to finish, then wait for it to complete any actions it may be doing.
|
||||
if (!DeviceCompat.isWeb()) {
|
||||
if (!waitForActorThread( 4500, true )){
|
||||
Throwable t = new Throwable();
|
||||
t.setStackTrace(actorThread.getStackTrace());
|
||||
throw new RuntimeException("timeout waiting for actor thread! ", t);
|
||||
}
|
||||
}
|
||||
|
||||
Emitter.freezeEmitters = false;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class v3_X_Changes {
|
||||
changes.hardlight(Window.TITLE_COLOR);
|
||||
changeInfos.add(changes);
|
||||
|
||||
if (DeviceCompat.isDesktop() && SharedLibraryLoader.isLinux) {
|
||||
if (DeviceCompat.isDesktop() && System.getProperty("os.name").toLowerCase().contains("nux")) {
|
||||
changes.addButton(new ChangeButton(Icons.DISPLAY.get(), "A Note for Steam Deck users",
|
||||
"A bug was fixed in this patch which affected display scaling on Steam Deck. Due to a quirk in how the Steam Deck reported display dimensions, the game incorrectly thought Steam Deck's screen was about 4\", instead of 7\".\n" +
|
||||
"\n" +
|
||||
|
||||
Reference in New Issue
Block a user