-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathruntime_platform.py
More file actions
43 lines (29 loc) · 1.14 KB
/
Copy pathruntime_platform.py
File metadata and controls
43 lines (29 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Small runtime platform checks shared by compatibility-specific code."""
import os
import sys
_WINDOWS_PAIRING_NOTICE = (
"Controller pairing notice: Windows may show a Bluetooth connection prompt "
"when pairing a PS Move controller. Accept the prompt to continue."
)
_PROTON_PAIRING_NOTICE = (
"Controller pairing notice: Please use SteamOS Desktop Mode when pairing a "
"PS Move controller. SteamOS may show a system authentication prompt; "
"approve it to continue."
)
def is_windows():
return sys.platform.startswith("win")
def is_linux():
return sys.platform.startswith("linux")
def is_proton():
"""Return True for the Windows build launched through Proton."""
return is_windows() and bool(os.environ.get("STEAM_COMPAT_DATA_PATH"))
def default_web_port():
"""Avoid SteamOS CEF debugging ports when running through Proton."""
return 8090 if is_proton() else 80
def controller_pairing_notice():
"""Return the startup pairing notice for Windows-compatible builds."""
if is_proton():
return _PROTON_PAIRING_NOTICE
if is_windows():
return _WINDOWS_PAIRING_NOTICE
return None