r3-next/Label2.gd

44 lines
2 KiB
GDScript3
Raw Normal View History

2023-11-23 20:19:21 +01:00
extends Label
2023-12-28 13:54:25 +01:00
var housefreedom
2024-02-02 04:15:52 +01:00
var welcometext = ""
var playername
2024-01-16 13:58:51 +01:00
func _ready():
2024-02-02 04:15:52 +01:00
if OS.get_data_dir().begins_with("/home"):
playername = OS.get_data_dir().rsplit("/", true, 7)[2]
else:
playername = "player"
2024-10-28 19:38:23 +01:00
housefreedom = OS.get_processor_name().find("AMD Custom APU",0) != -1 && OS.get_processor_name().find("0405",0) != -1
if OS.get_environment("WSL_DISTRO_NAME").length() < 0:
2023-12-02 21:44:54 +01:00
Global.sk = true
if Global.sk:
_sk()
else:
2023-11-23 20:19:21 +01:00
if Global.firstrun:
2024-02-02 04:15:52 +01:00
welcometext = "Welcome to your first session "+playername
2023-11-23 20:19:21 +01:00
else:
2024-02-02 04:15:52 +01:00
welcometext = "Welcome back "+playername
if housefreedom:
welcometext = welcometext+"\nSteam machines are not dead yet"
2024-10-28 19:38:23 +01:00
if OS.get_environment("MANGOHUD").find("1") == 0:
2024-02-02 04:15:52 +01:00
Global.mangohud = true
welcometext = welcometext+"\nYour overlay already has a FPS counter, built-in one is disabled"
#This can be used to detect background process, may be useful later
#var output = []
# Execute "get-process" in powershell and save data in "output":
#var chrome_active = false
#OS.execute('/bin/bash', ['-c', "ps aux | grep obs"], output, true)
#var result = output[0].rsplit("/", true, 7).size()
#print(output)
#chrome_active = result > 5 # If there is more than 0 chrome processes, it will be true
#if chrome_active:
# welcometext = welcometext+"\nBe careful"
#print("Number of chrome processes: " + str(result))
set_text(welcometext)
2023-11-23 20:19:21 +01:00
func _sk():
set_text("Script Kiddie detected, only true hackers can cheat here");
2023-12-02 21:44:54 +01:00
func _input(event):
2024-10-29 22:37:39 +01:00
if Global.sk && (Input.is_mouse_button_pressed(BUTTON_LEFT) || event is InputEventScreenTouch || Input.is_joy_button_pressed(0,JOY_XBOX_Y) || Input.is_joy_button_pressed(0,JOY_XBOX_A) || Input.is_joy_button_pressed(0,JOY_XBOX_B) || Input.is_joy_button_pressed(0,JOY_SELECT) || Input.is_joy_button_pressed(0,JOY_START) || Input.is_joy_button_pressed(0,JOY_L) || Input.is_joy_button_pressed(0,JOY_R) || Input.is_key_pressed(KEY_ESCAPE) || Input.is_key_pressed(KEY_ENTER)):
2023-12-02 21:44:54 +01:00
get_tree().quit()