Prepare for release again

This commit is contained in:
2025-06-03 20:37:28 -07:00
parent 3a223d5baf
commit 21d5584290
2 changed files with 143 additions and 10 deletions

View File

@@ -9,7 +9,29 @@ public class LoadingMenu : MonoBehaviour
public TMP_Text text;
public Button button;
void Awake() {
void Awake()
{
Application.targetFrameRate = 360;
QualitySettings.vSyncCount = PlayerPrefs.GetInt("Setting5", 1);
Screen.fullScreen = PlayerPrefs.GetInt("Setting1", 1) == 1;
if (!Application.isMobilePlatform)
{
SetIfNone("Setting1", 1);
SetIfNone("Setting2", 0);
SetIfNone("Setting3", 0);
SetIfNone("Setting4", 0);
SetIfNone("Setting5", 1);
}
else
{
SetIfNone("Setting1", 1, true);
SetIfNone("Setting2", 1, true);
SetIfNone("Setting3", 0);
SetIfNone("Setting4", 0);
SetIfNone("Setting5", 0, true);
QualitySettings.vSyncCount = 0;
}
PlayerPrefs.SetString("latestVersion", Application.version);
button.onClick.AddListener(() =>
{
Application.OpenURL("https://berrydash.lncvrt.xyz/download");
@@ -26,6 +48,7 @@ public class LoadingMenu : MonoBehaviour
using UnityWebRequest request = UnityWebRequest.Get("https://berrydash.lncvrt.xyz/database/canLoadClient.php");
request.SetRequestHeader("User-Agent", "BerryDashClient");
request.SetRequestHeader("ClientVersion", Application.version);
request.SetRequestHeader("ClientPlatform", Application.platform.ToString());
await request.SendWebRequest();
if (request.result != UnityWebRequest.Result.Success)
{
@@ -42,4 +65,12 @@ public class LoadingMenu : MonoBehaviour
button.gameObject.SetActive(true);
}
}
void SetIfNone(string key, int value, bool overrideValue = false)
{
if (!PlayerPrefs.HasKey(key) || overrideValue)
{
PlayerPrefs.SetInt(key, value);
}
}
}