Finish mobile support
This commit is contained in:
6 files changed
+40
-26
No files matched your search
+4
-1
@@ -5,6 +5,7 @@ using Godot;
|
||||
public class Utils {
|
||||
public static void ToggleFullscreen(bool on, List<string> settings)
|
||||
{
|
||||
if (IsMobile()) return;
|
||||
DisplayServer.WindowSetMode(on ? DisplayServer.WindowMode.Fullscreen : DisplayServer.WindowMode.Maximized);
|
||||
|
||||
string vsync = settings.ElementAtOrDefault(1) ?? "1";
|
||||
@@ -19,7 +20,7 @@ public class Utils {
|
||||
|
||||
public static void ToggleVSync(bool on)
|
||||
{
|
||||
DisplayServer.WindowSetVsyncMode(on ? DisplayServer.VSyncMode.Enabled : DisplayServer.VSyncMode.Disabled);
|
||||
if (!IsMobile()) DisplayServer.WindowSetVsyncMode(on ? DisplayServer.VSyncMode.Enabled : DisplayServer.VSyncMode.Disabled);
|
||||
}
|
||||
|
||||
public static List<string> LoadSettings() {
|
||||
@@ -27,4 +28,6 @@ public class Utils {
|
||||
List<string> values = [.. value.Split(':')];
|
||||
return values;
|
||||
}
|
||||
|
||||
public static bool IsMobile() => OS.GetName() == "iOS" || OS.GetName() == "Android";
|
||||
}
|
||||
Reference in new issue
Block a user