add steam overlay, achievements and stats managers

This commit is contained in:
2026-06-23 11:17:31 +02:00
parent efb7a78cf1
commit 298e6cd229
54 changed files with 1031 additions and 13 deletions

View File

@@ -0,0 +1,27 @@
extends Node
const APP_ID: int = 4809260 #Train Goes Choo Choo
var is_on_steam: bool = false
func _init() -> void:
OS.set_environment("SteamAppId", str(APP_ID))
OS.set_environment("SteamGameId", str(APP_ID))
func _ready() -> void:
process_mode = Node.PROCESS_MODE_ALWAYS
var init := Steam.steamInitEx()
if init['status'] != Steam.STEAM_API_INIT_RESULT_OK:
push_error("Steam not initialized: %s" % init['verbal'])
return
is_on_steam = true
Steam.overlay_toggled.connect(_on_overlay_toggled)
func _process(_delta: float) -> void:
if is_on_steam:
Steam.run_callbacks() # every frame, always
func _on_overlay_toggled(active: bool, _user_initiated: bool, _app_id: int) -> void:
get_tree().paused = active