Update #30 - Fixed various client bugs

This commit is contained in:
lax1dude
2024-05-18 23:17:29 -07:00
parent 32fda35ace
commit c6ac781036
50 changed files with 798 additions and 446 deletions

View File

@ -64,8 +64,12 @@ public class PlatformApplication {
String str = glfwGetClipboardString(win);
return str == null ? "" : str;
}
public static void setLocalStorage(String name, byte[] data) {
setLocalStorage(name, data, true);
}
public static void setLocalStorage(String name, byte[] data, boolean hooks) {
if(data == null) {
(new File("_eagstorage."+name+".dat")).delete();
}else {
@ -76,8 +80,12 @@ public class PlatformApplication {
}
}
}
public static byte[] getLocalStorage(String data) {
return getLocalStorage(data, true);
}
public static byte[] getLocalStorage(String data, boolean hooks) {
File f = new File("_eagstorage."+data+".dat");
if(!f.isFile()) {
return null;

View File

@ -230,6 +230,10 @@ public class PlatformInput {
glfwSwapBuffers(win);
}
public static boolean isVSyncSupported() {
return true;
}
public static boolean wasResized() {
boolean b = windowResized;
windowResized = false;

View File

@ -8,6 +8,7 @@ import org.json.JSONObject;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapterHooks;
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry;
/**
@ -31,6 +32,8 @@ public class DesktopClientConfigAdapter implements IClientConfigAdapter {
public final List<DefaultServer> defaultServers = new ArrayList();
private final DesktopClientConfigAdapterHooks hooks = new DesktopClientConfigAdapterHooks();
@Override
public String getDefaultLocale() {
return "en_US";
@ -129,4 +132,32 @@ public class DesktopClientConfigAdapter implements IClientConfigAdapter {
return false;
}
@Override
public boolean isAllowFNAWSkins() {
return true;
}
@Override
public String getLocalStorageNamespace() {
return EaglercraftVersion.localStorageNamespace;
}
@Override
public IClientConfigAdapterHooks getHooks() {
return hooks;
}
private static class DesktopClientConfigAdapterHooks implements IClientConfigAdapterHooks {
@Override
public void callLocalStorageSavedHook(String key, String base64) {
}
@Override
public String callLocalStorageLoadHook(String key) {
return null;
}
}
}