Added NetworkManager to initialize steam

This commit is contained in:
Chris Bell 2024-12-08 21:50:52 -06:00
parent a0a288ae22
commit 24edfec9c0
6 changed files with 30 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
# Godot 4+ specific ignores
.godot/
/android/
.idea/

View File

@ -45,9 +45,11 @@ theme = ExtResource("1_jmwsb")
[node name="LogLabel" type="RichTextLabel" parent="Panel/VBoxContainer/MarginContainer"]
layout_mode = 2
size_flags_vertical = 3
focus_mode = 2
theme = ExtResource("1_jmwsb")
bbcode_enabled = true
scroll_following = true
selection_enabled = true
[node name="InputField" type="LineEdit" parent="Panel/VBoxContainer"]
layout_mode = 2

View 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))

View File

@ -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"]
script = ExtResource("1_dcack")

View File

@ -19,6 +19,10 @@ config/icon="res://assets/icon.png"
GameConsole="*res://addons/ingameconsole/GameConsole.tscn"
[debug]
file_logging/enable_file_logging=true
[display]
window/size/viewport_width=1280