open_link signal

This commit is contained in:
Nordup 2025-08-19 02:27:19 +07:00
parent c868162ed8
commit 1b80249b2b
10 changed files with 29 additions and 8 deletions

Binary file not shown.

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=8 format=3 uid="uid://bj6j3nyldlqjm"] [gd_scene load_steps=9 format=3 uid="uid://bj6j3nyldlqjm"]
[ext_resource type="StyleBox" uid="uid://bllkg32sc4iam" path="res://assets/styles/panel.stylebox" id="2_cxiqp"] [ext_resource type="StyleBox" uid="uid://bllkg32sc4iam" path="res://assets/styles/panel.stylebox" id="2_cxiqp"]
[ext_resource type="FontFile" uid="uid://do40418waa8w3" path="res://assets/fonts/Inter-Regular.otf" id="6_drapp"] [ext_resource type="FontFile" uid="uid://do40418waa8w3" path="res://assets/fonts/Inter-Regular.otf" id="6_drapp"]
[ext_resource type="FontFile" uid="uid://bjeupg0ikc2kv" path="res://assets/fonts/Monospace.ttf" id="7_1pjua"] [ext_resource type="FontFile" uid="uid://bjeupg0ikc2kv" path="res://assets/fonts/Monospace.ttf" id="7_1pjua"]
[ext_resource type="Script" path="res://scripts/ui/search/open_meta_link.gd" id="7_evwvd"] [ext_resource type="Script" path="res://scripts/ui/search/open_meta_link.gd" id="7_evwvd"]
[ext_resource type="Resource" uid="uid://bfg1kjboaitqt" path="res://resources/app_events.res" id="8_06jeu"]
[ext_resource type="FontFile" uid="uid://b3xb1fpllhnf4" path="res://assets/fonts/Inter-Italic.otf" id="8_nluj5"] [ext_resource type="FontFile" uid="uid://b3xb1fpllhnf4" path="res://assets/fonts/Inter-Italic.otf" id="8_nluj5"]
[ext_resource type="FontFile" uid="uid://tfj3o1e1wytn" path="res://assets/fonts/Inter-BoldItalic.otf" id="9_r0w13"] [ext_resource type="FontFile" uid="uid://tfj3o1e1wytn" path="res://assets/fonts/Inter-BoldItalic.otf" id="9_r0w13"]
[ext_resource type="FontFile" uid="uid://c14w1y1r54wgi" path="res://assets/fonts/Inter-Bold.otf" id="10_fe01c"] [ext_resource type="FontFile" uid="uid://c14w1y1r54wgi" path="res://assets/fonts/Inter-Bold.otf" id="10_fe01c"]
@ -49,3 +50,4 @@ The best part? You dont just have to wait for it to grow. You can build your

🤍 Start creating here: [url=https://thegates-docs.super.site]thegates-docs[/url]" 
🤍 Start creating here: [url=https://thegates-docs.super.site]thegates-docs[/url]"
scroll_active = false scroll_active = false
script = ExtResource("7_evwvd") script = ExtResource("7_evwvd")
app_events = ExtResource("8_06jeu")

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=27 format=3 uid="uid://5btb7nvgmfhl"] [gd_scene load_steps=28 format=3 uid="uid://5btb7nvgmfhl"]
[ext_resource type="Script" path="res://scripts/ui/menu/menu_navigation.gd" id="1_7anvm"] [ext_resource type="Script" path="res://scripts/ui/menu/menu_navigation.gd" id="1_7anvm"]
[ext_resource type="Script" path="res://scripts/ui/menu/menu.gd" id="1_o6vga"] [ext_resource type="Script" path="res://scripts/ui/menu/menu.gd" id="1_o6vga"]
@ -17,6 +17,7 @@
[ext_resource type="Texture2D" uid="uid://yn1l3ybpr7qv" path="res://assets/textures/menu.svg" id="13_ncruo"] [ext_resource type="Texture2D" uid="uid://yn1l3ybpr7qv" path="res://assets/textures/menu.svg" id="13_ncruo"]
[ext_resource type="Texture2D" uid="uid://mgtj316adcja" path="res://assets/textures/home.svg" id="14_gbcfo"] [ext_resource type="Texture2D" uid="uid://mgtj316adcja" path="res://assets/textures/home.svg" id="14_gbcfo"]
[ext_resource type="Texture2D" uid="uid://casdqby073onf" path="res://assets/textures/flag.svg" id="17_b36tf"] [ext_resource type="Texture2D" uid="uid://casdqby073onf" path="res://assets/textures/flag.svg" id="17_b36tf"]
[ext_resource type="Resource" uid="uid://bfg1kjboaitqt" path="res://resources/app_events.res" id="18_xgfab"]
[ext_resource type="Script" path="res://scripts/ui/menu/help_button.gd" id="19_h4fgg"] [ext_resource type="Script" path="res://scripts/ui/menu/help_button.gd" id="19_h4fgg"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pveoh"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pveoh"]
@ -237,6 +238,7 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_ogb6s")
icon = ExtResource("17_b36tf") icon = ExtResource("17_b36tf")
script = ExtResource("19_h4fgg") script = ExtResource("19_h4fgg")
url = "https://forms.gle/1NmJeCQnQh7Yc1KP8" url = "https://forms.gle/1NmJeCQnQh7Yc1KP8"
app_events = ExtResource("18_xgfab")
[node name="Options" parent="VBoxContainer/Top/VBoxContainer/Navigation/MenuNavigation/HBoxContainer2" instance=ExtResource("6_gxcmo")] [node name="Options" parent="VBoxContainer/Top/VBoxContainer/Navigation/MenuNavigation/HBoxContainer2" instance=ExtResource("6_gxcmo")]
visible = false visible = false

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=22 format=3 uid="uid://ca647gp63bshc"] [gd_scene load_steps=23 format=3 uid="uid://ca647gp63bshc"]
[ext_resource type="Texture2D" uid="uid://bw1cffhlt112i" path="res://assets/textures/icon_round.svg" id="1_dh3vr"] [ext_resource type="Texture2D" uid="uid://bw1cffhlt112i" path="res://assets/textures/icon_round.svg" id="1_dh3vr"]
[ext_resource type="Script" path="res://scripts/ui/menu/bookmark_container.gd" id="1_g38mt"] [ext_resource type="Script" path="res://scripts/ui/menu/bookmark_container.gd" id="1_g38mt"]
@ -10,6 +10,7 @@
[ext_resource type="PackedScene" uid="uid://xagbhqfidf2" path="res://scenes/components/round_button.tscn" id="7_bbq84"] [ext_resource type="PackedScene" uid="uid://xagbhqfidf2" path="res://scenes/components/round_button.tscn" id="7_bbq84"]
[ext_resource type="Texture2D" uid="uid://dy5lmm2egk4w1" path="res://assets/textures/help.svg" id="8_3cxe2"] [ext_resource type="Texture2D" uid="uid://dy5lmm2egk4w1" path="res://assets/textures/help.svg" id="8_3cxe2"]
[ext_resource type="Script" path="res://scripts/ui/menu/help_button.gd" id="10_ant0e"] [ext_resource type="Script" path="res://scripts/ui/menu/help_button.gd" id="10_ant0e"]
[ext_resource type="Resource" uid="uid://bfg1kjboaitqt" path="res://resources/app_events.res" id="11_2td0u"]
[ext_resource type="PackedScene" uid="uid://b5tbn17l1pfs1" path="res://scenes/components/onboarding/onboarding.tscn" id="11_kyh0m"] [ext_resource type="PackedScene" uid="uid://b5tbn17l1pfs1" path="res://scenes/components/onboarding/onboarding.tscn" id="11_kyh0m"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kmpb2"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kmpb2"]
@ -250,6 +251,7 @@ theme_override_styles/normal = SubResource("StyleBoxFlat_37fyt")
icon = ExtResource("8_3cxe2") icon = ExtResource("8_3cxe2")
script = ExtResource("10_ant0e") script = ExtResource("10_ant0e")
url = "https://forms.gle/1NmJeCQnQh7Yc1KP8" url = "https://forms.gle/1NmJeCQnQh7Yc1KP8"
app_events = ExtResource("11_2td0u")
[node name="Onboarding" parent="." instance=ExtResource("11_kyh0m")] [node name="Onboarding" parent="." instance=ExtResource("11_kyh0m")]
visible = false visible = false

View file

@ -78,7 +78,7 @@ size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
theme_override_constants/margin_left = 0 theme_override_constants/margin_left = 0
theme_override_constants/margin_top = 0 theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 899 theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0 theme_override_constants/margin_bottom = 0
script = ExtResource("1_scp2i") script = ExtResource("1_scp2i")
limit = Vector2(1015, -1) limit = Vector2(1015, -1)

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=42 format=3 uid="uid://kywrsqro3d5i"] [gd_scene load_steps=43 format=3 uid="uid://kywrsqro3d5i"]
[ext_resource type="Script" path="res://scripts/loading/gate_loader.gd" id="1_uxhy6"] [ext_resource type="Script" path="res://scripts/loading/gate_loader.gd" id="1_uxhy6"]
[ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_q7cvi"] [ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_q7cvi"]
@ -15,6 +15,7 @@
[ext_resource type="Resource" uid="uid://cjcdum6fm4ta0" path="res://resources/api_settings.tres" id="10_vhc7k"] [ext_resource type="Resource" uid="uid://cjcdum6fm4ta0" path="res://resources/api_settings.tres" id="10_vhc7k"]
[ext_resource type="Script" path="res://scripts/sandbox/process_checker.gd" id="11_72cjp"] [ext_resource type="Script" path="res://scripts/sandbox/process_checker.gd" id="11_72cjp"]
[ext_resource type="Script" path="res://scripts/ui/world/world_ui.gd" id="12_jdwjt"] [ext_resource type="Script" path="res://scripts/ui/world/world_ui.gd" id="12_jdwjt"]
[ext_resource type="Resource" uid="uid://bfg1kjboaitqt" path="res://resources/app_events.res" id="13_5np0h"]
[ext_resource type="Script" path="res://scripts/ui/world/foreground.gd" id="17_6e5v3"] [ext_resource type="Script" path="res://scripts/ui/world/foreground.gd" id="17_6e5v3"]
[ext_resource type="PackedScene" uid="uid://c7571vjq7l0jp" path="res://scenes/components/not_responding.tscn" id="17_kwbm3"] [ext_resource type="PackedScene" uid="uid://c7571vjq7l0jp" path="res://scenes/components/not_responding.tscn" id="17_kwbm3"]
[ext_resource type="Script" path="res://scripts/ui/world/gate_info.gd" id="18_q06xu"] [ext_resource type="Script" path="res://scripts/ui/world/gate_info.gd" id="18_q06xu"]
@ -162,6 +163,7 @@ render_result = NodePath("../WorldCanvas/RenderResult")
[node name="CommandSync" type="CommandSync" parent="."] [node name="CommandSync" type="CommandSync" parent="."]
script = ExtResource("10_cqo55") script = ExtResource("10_cqo55")
app_events = ExtResource("13_5np0h")
gate_events = ExtResource("2_q7cvi") gate_events = ExtResource("2_q7cvi")
command_events = ExtResource("6_18mgg") command_events = ExtResource("6_18mgg")

View file

@ -0,0 +1,9 @@
extends Resource
class_name AppEvents
signal open_link(uri: String)
func open_link_emit(uri: String) -> void:
OS.shell_open(uri) # TODO: move somewhere else
open_link.emit(uri)

View file

@ -1,5 +1,6 @@
extends CommandSync extends CommandSync
@export var app_events: AppEvents
@export var gate_events: GateEvents @export var gate_events: GateEvents
@export var command_events: CommandEvents @export var command_events: CommandEvents
@ -47,7 +48,7 @@ func _execute_function(command: Command) -> Variant:
"open_link": "open_link":
if wrong_args_count(command, 1): return ERR_INVALID_PARAMETER if wrong_args_count(command, 1): return ERR_INVALID_PARAMETER
OS.shell_open(command.args[0]) app_events.open_link_emit(command.args[0])
_: _:
Debug.logerr("Command %s not implemented" % [command.name]) Debug.logerr("Command %s not implemented" % [command.name])

View file

@ -1,6 +1,7 @@
extends RoundButton extends RoundButton
@export var url: String @export var url: String
@export var app_events: AppEvents
func _ready() -> void: func _ready() -> void:
@ -10,4 +11,4 @@ func _ready() -> void:
func open_help_url() -> void: func open_help_url() -> void:
OS.shell_open(url) app_events.open_link_emit(url)

View file

@ -1,9 +1,11 @@
extends RichTextLabel extends RichTextLabel
@export var app_events: AppEvents
func _ready() -> void: func _ready() -> void:
meta_clicked.connect(on_meta_clicked) meta_clicked.connect(on_meta_clicked)
func on_meta_clicked(meta) -> void: func on_meta_clicked(meta) -> void:
OS.shell_open(str(meta)) app_events.open_link_emit(str(meta))