mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-23 17:17:31 -04:00
add license, move folders
This commit is contained in:
parent
185cc74060
commit
271c4a46a1
132 changed files with 21 additions and 0 deletions
42
app/scripts/platform.gd
Normal file
42
app/scripts/platform.gd
Normal file
|
@ -0,0 +1,42 @@
|
|||
extends Node
|
||||
class_name Platform
|
||||
|
||||
enum {
|
||||
WINDOWS,
|
||||
MACOS,
|
||||
LINUX_BSD,
|
||||
ANDROID,
|
||||
IOS,
|
||||
WEB
|
||||
}
|
||||
|
||||
|
||||
static func is_windows() -> bool:
|
||||
return get_platform() == WINDOWS
|
||||
|
||||
|
||||
static func is_linux() -> bool:
|
||||
return get_platform() == LINUX_BSD
|
||||
|
||||
|
||||
static func is_debug() -> bool:
|
||||
return OS.is_debug_build()
|
||||
|
||||
|
||||
static func get_platform() -> int:
|
||||
match OS.get_name():
|
||||
"Windows", "UWP":
|
||||
return WINDOWS
|
||||
"macOS":
|
||||
return MACOS
|
||||
"Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD":
|
||||
return LINUX_BSD
|
||||
"Android":
|
||||
return ANDROID
|
||||
"iOS":
|
||||
return IOS
|
||||
"Web":
|
||||
return WEB
|
||||
_:
|
||||
assert(false, "No such platform")
|
||||
return -1
|
Loading…
Add table
Add a link
Reference in a new issue