mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-24 02:17:27 -04:00
gd: open_gate
This commit is contained in:
parent
0eda5b758d
commit
a8c212ab1a
3 changed files with 5 additions and 23 deletions
|
@ -1,21 +0,0 @@
|
||||||
extends Node
|
|
||||||
|
|
||||||
@export var gate_events: GateEvents
|
|
||||||
|
|
||||||
var gate_jump: String = "gate_jump"
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
gate_events.gate_entered.connect(connect_to_gate_signals)
|
|
||||||
|
|
||||||
|
|
||||||
func connect_to_gate_signals() -> void:
|
|
||||||
var root_node = get_child(0)
|
|
||||||
if root_node == null: Debug.logerr("Gate root node is null"); return
|
|
||||||
if root_node.has_signal(gate_jump):
|
|
||||||
root_node.connect(gate_jump, on_gate_jump)
|
|
||||||
|
|
||||||
|
|
||||||
func on_gate_jump(url: String) -> void:
|
|
||||||
url = Url.join(gate_events.current_gate_url, url)
|
|
||||||
gate_events.open_gate_emit(url)
|
|
|
@ -17,7 +17,6 @@ func create_process(_gate: Gate) -> void:
|
||||||
|
|
||||||
var sandbox_path = "/home/nordup/projects/godot/the-gates-folder/the-gates/bin/godot.linuxbsd.editor.dev.sandbox.x86_64.llvm"
|
var sandbox_path = "/home/nordup/projects/godot/the-gates-folder/the-gates/bin/godot.linuxbsd.editor.dev.sandbox.x86_64.llvm"
|
||||||
var pack_file = ProjectSettings.globalize_path(gate.resource_pack)
|
var pack_file = ProjectSettings.globalize_path(gate.resource_pack)
|
||||||
var main_pid = OS.get_process_id()
|
|
||||||
|
|
||||||
var args = [
|
var args = [
|
||||||
"--main-pack", pack_file,
|
"--main-pack", pack_file,
|
||||||
|
|
|
@ -9,7 +9,7 @@ func _ready() -> void:
|
||||||
execute_function = _execute_function
|
execute_function = _execute_function
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(_delta: float) -> void:
|
||||||
receive_commands()
|
receive_commands()
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@ func _execute_function(command: Command) -> Variant:
|
||||||
"set_mouse_mode":
|
"set_mouse_mode":
|
||||||
if command.args.size() != 1: push_error("Arg count should be 1"); return ""
|
if command.args.size() != 1: push_error("Arg count should be 1"); return ""
|
||||||
command_events.set_mouse_mode_emit(command.args[0])
|
command_events.set_mouse_mode_emit(command.args[0])
|
||||||
|
"open_gate":
|
||||||
|
if command.args.size() != 1: push_error("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])
|
print("Command %s not implemented" % [command.name])
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue