From cbac026ebc4b4a381b19f2bd7dd7ac1d5e584092 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Mon, 4 Jul 2022 11:13:11 -0400 Subject: [PATCH] add player node which will be used to capture their info from the HUD --- godot/monitor/Monitor.tscn | 6 +++++- godot/monitor/Player.gd | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 godot/monitor/Player.gd diff --git a/godot/monitor/Monitor.tscn b/godot/monitor/Monitor.tscn index 736faa8..c2280ca 100644 --- a/godot/monitor/Monitor.tscn +++ b/godot/monitor/Monitor.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://monitor/Monitor.gd" type="Script" id=1] +[ext_resource path="res://monitor/Player.gd" type="Script" id=2] [node name="Monitor" type="Node"] script = ExtResource( 1 ) use_development_url = true +[node name="Player" type="Node" parent="."] +script = ExtResource( 2 ) + [node name="HTTPRequest" type="HTTPRequest" parent="."] diff --git a/godot/monitor/Player.gd b/godot/monitor/Player.gd new file mode 100644 index 0000000..ea4456b --- /dev/null +++ b/godot/monitor/Player.gd @@ -0,0 +1,14 @@ +extends Node + + +var player: Dictionary + + +func _ready() -> void: + pass + + +func _on_set_player(player_info: Dictionary) -> void: + player["name"] = player_info["name"] + player["rut"] = player_info["rut"] + player["email"] = player_info["email"]