Added NetworkManager to initialize steam
This commit is contained in:
parent
a0a288ae22
commit
24edfec9c0
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
# Godot 4+ specific ignores
|
# Godot 4+ specific ignores
|
||||||
.godot/
|
.godot/
|
||||||
/android/
|
/android/
|
||||||
|
.idea/
|
Binary file not shown.
@ -45,9 +45,11 @@ theme = ExtResource("1_jmwsb")
|
|||||||
[node name="LogLabel" type="RichTextLabel" parent="Panel/VBoxContainer/MarginContainer"]
|
[node name="LogLabel" type="RichTextLabel" parent="Panel/VBoxContainer/MarginContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
|
focus_mode = 2
|
||||||
theme = ExtResource("1_jmwsb")
|
theme = ExtResource("1_jmwsb")
|
||||||
bbcode_enabled = true
|
bbcode_enabled = true
|
||||||
scroll_following = true
|
scroll_following = true
|
||||||
|
selection_enabled = true
|
||||||
|
|
||||||
[node name="InputField" type="LineEdit" parent="Panel/VBoxContainer"]
|
[node name="InputField" type="LineEdit" parent="Panel/VBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
18
assets/core/networking/NetworkManager.gd
Normal file
18
assets/core/networking/NetworkManager.gd
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
func _init() -> void:
|
||||||
|
# Set your game's Steam app ID here
|
||||||
|
OS.set_environment("SteamAppId", str(480))
|
||||||
|
OS.set_environment("SteamGameId", str(480))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
var init_result = Steam.steamInit()
|
||||||
|
if init_result["status"] <= 1: # Check if initialization was successful
|
||||||
|
GameConsole.print_line("Steam is running!")
|
||||||
|
var steamId = Steam.getSteamID()
|
||||||
|
GameConsole.print_line("Steam ID: " + str(Steam.getFriendPersonaName(steamId)))
|
||||||
|
else:
|
||||||
|
GameConsole.log_error("Steam failed to initialize: " + str(init_result))
|
||||||
|
|
@ -1,3 +1,6 @@
|
|||||||
[gd_scene format=3 uid="uid://huq7dxk5yvjk"]
|
[gd_scene load_steps=2 format=3 uid="uid://huq7dxk5yvjk"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://assets/core/networking/NetworkManager.gd" id="1_dcack"]
|
||||||
|
|
||||||
[node name="Main" type="Node"]
|
[node name="Main" type="Node"]
|
||||||
|
script = ExtResource("1_dcack")
|
||||||
|
@ -19,6 +19,10 @@ config/icon="res://assets/icon.png"
|
|||||||
|
|
||||||
GameConsole="*res://addons/ingameconsole/GameConsole.tscn"
|
GameConsole="*res://addons/ingameconsole/GameConsole.tscn"
|
||||||
|
|
||||||
|
[debug]
|
||||||
|
|
||||||
|
file_logging/enable_file_logging=true
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/size/viewport_width=1280
|
window/size/viewport_width=1280
|
||||||
|
Loading…
Reference in New Issue
Block a user