diff --git a/project/the_gates/scripts/debug-log/debug.gd b/project/the_gates/scripts/debug-log/debug.gd index c3988fb..690ce9f 100644 --- a/project/the_gates/scripts/debug-log/debug.gd +++ b/project/the_gates/scripts/debug-log/debug.gd @@ -18,3 +18,5 @@ func logclr(msg, color: Color) -> void: var rich_clr = "[color=%s]%s[/color]" % [color.to_html(), str(msg)] print_rich(rich_clr) logged.emit(rich_clr) + +# TODO: log category with defined color diff --git a/project/the_gates/scripts/sandbox/command_sync.gd b/project/the_gates/scripts/sandbox/command_sync.gd index c4e356f..4618045 100644 --- a/project/the_gates/scripts/sandbox/command_sync.gd +++ b/project/the_gates/scripts/sandbox/command_sync.gd @@ -14,17 +14,17 @@ func _physics_process(_delta: float) -> void: func _execute_function(command: Command) -> Variant: - print("Recieved command: " + command.name) + Debug.logclr("Recieved command: " + command.name, Color.SANDY_BROWN) match command.name: "send_filehandle": command_events.send_filehandle_emit() "set_mouse_mode": - if command.args.size() != 1: push_error("Arg count should be 1"); return "" + if command.args.size() != 1: Debug.logerr("Arg count should be 1"); return "" command_events.set_mouse_mode_emit(command.args[0]) "open_gate": - if command.args.size() != 1: push_error("Arg count should be 1"); return "" + if command.args.size() != 1: Debug.logerr("Arg count should be 1"); return "" var url = Url.join(gate_events.current_gate_url, command.args[0]) gate_events.open_gate_emit(url) _: - print("Command %s not implemented" % [command.name]) + Debug.logerr("Command %s not implemented" % [command.name]) return "" diff --git a/project/the_gates/scripts/sandbox/render_result.gd b/project/the_gates/scripts/sandbox/render_result.gd index 58838ad..9d8eb8a 100644 --- a/project/the_gates/scripts/sandbox/render_result.gd +++ b/project/the_gates/scripts/sandbox/render_result.gd @@ -54,12 +54,12 @@ func create_external_texture() -> void: func send_filehandle() -> void: - print("Sending send_filehandle...") + Debug.logr("Sending send_filehandle...") var sent = false while not sent: sent = ext_texure.send_filehandle(fd_path) await get_tree().create_timer(0.1).timeout - print("fd was sent") + Debug.logr("filehandle was sent") func _process(_delta: float) -> void: