mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-23 17:17:31 -04:00
add license, move folders
This commit is contained in:
parent
185cc74060
commit
271c4a46a1
132 changed files with 21 additions and 0 deletions
31
app/scripts/sandbox/command_sync.gd
Normal file
31
app/scripts/sandbox/command_sync.gd
Normal file
|
@ -0,0 +1,31 @@
|
|||
extends CommandSync
|
||||
|
||||
@export var gate_events: GateEvents
|
||||
@export var command_events: CommandEvents
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
gate_events.gate_entered.connect(bind)
|
||||
execute_function = _execute_function
|
||||
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
receive_commands()
|
||||
|
||||
|
||||
func _execute_function(command: Command) -> Variant:
|
||||
Debug.logclr("Recieved command: " + command.name + ". Args: " + str(command.args), Color.SANDY_BROWN)
|
||||
match command.name:
|
||||
"send_filehandle":
|
||||
if command.args.size() != 1: Debug.logerr("Arg count should be 1"); return ""
|
||||
command_events.send_filehandle_emit(command.args[0])
|
||||
"set_mouse_mode":
|
||||
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: 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)
|
||||
_:
|
||||
Debug.logerr("Command %s not implemented" % [command.name])
|
||||
return ""
|
Loading…
Add table
Add a link
Reference in a new issue