From 542c25fcdb9c96855be0364af90d975be2238896 Mon Sep 17 00:00:00 2001 From: yvmou Date: Mon, 21 Sep 2026 16:04:59 +0800 Subject: [PATCH] =?UTF-8?q?steam=E5=88=9D=E5=A7=8B=E5=8C=96=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoload/steamworks.gd | 18 ++++++++++++++++++ autoload/steamworks.gd.uid | 1 + project.godot | 4 ++++ 3 files changed, 23 insertions(+) create mode 100644 autoload/steamworks.gd create mode 100644 autoload/steamworks.gd.uid diff --git a/autoload/steamworks.gd b/autoload/steamworks.gd new file mode 100644 index 0000000..7a4a4ec --- /dev/null +++ b/autoload/steamworks.gd @@ -0,0 +1,18 @@ +extends Node + +# Steam AppID +var steam_app_id: int = 480 + +func _ready() -> void: + initialize_steam() + +func initialize_steam() -> void: + var initialize_response: Dictionary = Steam.steamInitEx( + steam_app_id, + true + ) + print("Did Steam initialize?: %s" % initialize_response) + + if initialize_response['status'] > Steam.STEAM_API_INIT_RESULT_OK: + print("Failed to initialize Steam, shutting down: %s" % initialize_response) + get_tree().quit() diff --git a/autoload/steamworks.gd.uid b/autoload/steamworks.gd.uid new file mode 100644 index 0000000..df30282 --- /dev/null +++ b/autoload/steamworks.gd.uid @@ -0,0 +1 @@ +uid://w087kpi6dipk diff --git a/project.godot b/project.godot index 777e89b..7b226a3 100644 --- a/project.godot +++ b/project.godot @@ -14,6 +14,10 @@ config/name="agame" config/features=PackedStringArray("4.7", "Forward Plus") config/icon="res://icon.svg" +[autoload] + +Steamworks="*uid://w087kpi6dipk" + [debug] file_logging/enable_file_logging=true