set current url

This commit is contained in:
Nordup 2023-06-17 21:26:47 +04:00
parent 6d96ff6226
commit bafbc44f1a
2 changed files with 11 additions and 0 deletions

View file

@ -401,6 +401,7 @@ theme_override_font_sizes/normal_font_size = 24
text = "No description"
[node name="Url" type="LineEdit" parent="HBoxContainer/GateInfo"]
visible = false
layout_mode = 2
theme_override_colors/font_uneditable_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 20

View file

@ -4,6 +4,16 @@ extends LineEdit
var url: String
func _ready() -> void:
gate_events.open_gate.connect(set_current_url)
gate_events.exit_gate.connect(set_current_url.bind(""))
func set_current_url(_url: String) -> void:
url = _url
text = url
func _input(event: InputEvent) -> void:
if (has_focus()
and event is InputEventMouseButton