@@ -31,13 +31,18 @@ static func can_send_message() -> bool:
3131
3232static func world_init (world : World ) -> bool :
3333 if can_send_message ():
34- EngineDebugger .send_message (Msg .WORLD_INIT , [world .get_instance_id (), world .get_path ()])
34+ EngineDebugger .send_message (Msg .WORLD_INIT ,[world .get_instance_id (),
35+ world .get_path ()
36+ ])
3537 return true
3638
3739static func system_metric (system : System , time : float ) -> bool :
3840 if can_send_message ():
3941 EngineDebugger .send_message (
40- Msg .SYSTEM_METRIC , [system .get_instance_id (), system .name , time ]
42+ Msg .SYSTEM_METRIC ,[system .get_instance_id (),
43+ system .name ,
44+ time
45+ ]
4146 )
4247 return true
4348
@@ -57,7 +62,10 @@ static func system_last_run_data(system: System, last_run_data: Dictionary) -> b
5762static func set_world (world : World ) -> bool :
5863 if can_send_message ():
5964 EngineDebugger .send_message (
60- Msg .SET_WORLD , [world .get_instance_id (), world .get_path ()] if world else []
65+ Msg .SET_WORLD ,[world .get_instance_id (),
66+ world .get_path ()
67+ ] if world else [
68+ ]
6169 )
6270 return true
6371
@@ -118,7 +126,13 @@ static func _get_type_name_for_debugger(obj) -> String:
118126 if obj is Resource or obj is Node :
119127 var script = obj .get_script ()
120128 if script :
121- return script .get_class ()
129+ # Try to get class_name first
130+ var type_name = script .get_class ()
131+ if type_name and type_name != "GDScript" :
132+ return type_name
133+ # Otherwise use the resource path (e.g., "res://components/C_Health.gd")
134+ if script .resource_path :
135+ return script .resource_path # Returns "C_Health"
122136 return obj .get_class ()
123137 elif obj is Object :
124138 return obj .get_class ()
@@ -141,7 +155,9 @@ static func entity_component_added(ent: Entity, comp: Resource) -> bool:
141155static func entity_component_removed (ent : Entity , comp : Resource ) -> bool :
142156 if can_send_message ():
143157 EngineDebugger .send_message (
144- Msg .ENTITY_COMPONENT_REMOVED , [ent .get_instance_id (), comp .get_instance_id ()]
158+ Msg .ENTITY_COMPONENT_REMOVED ,[ent .get_instance_id (),
159+ comp .get_instance_id ()
160+ ]
145161 )
146162 return true
147163
@@ -151,20 +167,60 @@ static func entity_component_property_changed(
151167 if can_send_message ():
152168 EngineDebugger .send_message (
153169 Msg .COMPONENT_PROPERTY_CHANGED ,
154- [ent .get_instance_id (), comp .get_instance_id (), property_name , old_value , new_value ]
170+ [ent .get_instance_id (),
171+ comp .get_instance_id (),
172+ property_name ,
173+ old_value ,
174+ new_value
175+ ]
155176 )
156177 return true
157178
158179static func entity_relationship_added (ent : Entity , rel : Relationship ) -> bool :
159180 if can_send_message ():
181+ # Serialize relationship data for debugger display
182+ var rel_data = {
183+ "relation_type" : _get_type_name_for_debugger (rel .relation ) if rel .relation else "null" ,
184+ "relation_data" : rel .relation .serialize () if rel .relation else {},
185+ "target_type" : "" ,
186+ "target_data" : {}
187+ }
188+
189+ # Format target based on type
190+ if rel .target == null :
191+ rel_data ["target_type" ] = "null"
192+ elif rel .target is Entity :
193+ rel_data ["target_type" ] = "Entity"
194+ rel_data ["target_data" ] = {
195+ "id" : rel .target .get_instance_id (),
196+ "path" : str (rel .target .get_path ())
197+ }
198+ elif rel .target is Component :
199+ rel_data ["target_type" ] = "Component"
200+ rel_data ["target_data" ] = {
201+ "type" : _get_type_name_for_debugger (rel .target ),
202+ "data" : rel .target .serialize ()
203+ }
204+ elif rel .target is Script :
205+ rel_data ["target_type" ] = "Archetype"
206+ rel_data ["target_data" ] = {
207+ "script_path" : rel .target .resource_path
208+ }
209+
160210 EngineDebugger .send_message (
161- Msg .ENTITY_RELATIONSHIP_ADDED , [ent .get_instance_id (), rel .get_instance_id ()]
211+ Msg .ENTITY_RELATIONSHIP_ADDED ,
212+ [ent .get_instance_id (),
213+ rel .get_instance_id (),
214+ rel_data
215+ ]
162216 )
163217 return true
164218
165219static func entity_relationship_removed (ent : Entity , rel : Relationship ) -> bool :
166220 if can_send_message ():
167221 EngineDebugger .send_message (
168- Msg .ENTITY_RELATIONSHIP_REMOVED , [ent .get_instance_id (), rel .get_instance_id ()]
222+ Msg .ENTITY_RELATIONSHIP_REMOVED ,[ent .get_instance_id (),
223+ rel .get_instance_id ()
224+ ]
169225 )
170226 return true
0 commit comments