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