detect mangohud

This commit is contained in:
Page Asgardius 2024-01-26 14:16:00 -07:00
parent 96131747bb
commit 4c6e795a74
3 changed files with 12 additions and 9 deletions

View file

@ -1,5 +1,6 @@
extends Label extends Label
var housefreedom var housefreedom
var welcometext = ""
func _ready(): func _ready():
housefreedom = OS.get_processor_name().contains("AMD Custom APU") && OS.get_processor_name().contains("0405") housefreedom = OS.get_processor_name().contains("AMD Custom APU") && OS.get_processor_name().contains("0405")
if (OS.get_name() != "Linux" && !OS.get_name().ends_with("BSD")) || OS.get_distribution_name().contains("Kali") || !OS.get_data_dir().begins_with("/home") || OS.get_environment("WSL_DISTRO_NAME").length() < 0: if (OS.get_name() != "Linux" && !OS.get_name().ends_with("BSD")) || OS.get_distribution_name().contains("Kali") || !OS.get_data_dir().begins_with("/home") || OS.get_environment("WSL_DISTRO_NAME").length() < 0:
@ -8,15 +9,15 @@ func _ready():
_sk() _sk()
else: else:
if Global.firstrun: if Global.firstrun:
welcometext = "Welcome to your first session "+OS.get_data_dir().rsplit("/", true, 7)[2]
else:
welcometext = "Welcome back "+OS.get_data_dir().rsplit("/", true, 7)[2]
if housefreedom: if housefreedom:
set_text("Welcome to your first session "+OS.get_data_dir().rsplit("/", true, 7)[2]+"\nSteam machines are not dead yet"); welcometext = welcometext+"\nSteam machines are not dead yet"
else: if OS.get_environment("MANGOHUD").contains("1"):
set_text("Welcome to your first session "+OS.get_data_dir().rsplit("/", true, 7)[2]); Global.mangohud = true
else: welcometext = welcometext+"\nYour overlay already has a FPS counter, built-in one is disabled"
if housefreedom: set_text(welcometext)
set_text("Welcome back "+OS.get_data_dir().rsplit("/", true, 7)[2]+"\nSteam machines are not dead yet");
else:
set_text("Welcome back "+OS.get_data_dir().rsplit("/", true, 7)[2]);
func _sk(): func _sk():
set_text("Script Kiddie detected, only true hackers can cheat here"); set_text("Script Kiddie detected, only true hackers can cheat here");

1
fps.gd
View file

@ -1,4 +1,5 @@
extends Label extends Label
func _process(delta: float) -> void: func _process(delta: float) -> void:
if !Global.mangohud:
set_text("FPS: " + str(Engine.get_frames_per_second())); set_text("FPS: " + str(Engine.get_frames_per_second()));

View file

@ -13,6 +13,7 @@ const pchars = ["res://sprites/common/midori/midori.tscn"]
const npchars = [] const npchars = []
var cpchar = 0 var cpchar = 0
var dcpchar = 0 var dcpchar = 0
var mangohud = false
var cspawnarea = [null, null] var cspawnarea = [null, null]
var owlocation = [[null, null], [null, null]] var owlocation = [[null, null], [null, null]]
var hiscoresfile = "user://hiscores.save" var hiscoresfile = "user://hiscores.save"