mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-23 08:17:34 -04:00
featured gates api initial
This commit is contained in:
parent
5e9adfb7d4
commit
d86fea31c3
5 changed files with 28 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=17 format=3 uid="uid://ct8gsph3wnepl"]
|
[gd_scene load_steps=18 format=3 uid="uid://ct8gsph3wnepl"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/app.gd" id="1_skc7d"]
|
[ext_resource type="Script" path="res://scripts/app.gd" id="1_skc7d"]
|
||||||
[ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_cdryv"]
|
[ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_cdryv"]
|
||||||
|
@ -16,6 +16,7 @@
|
||||||
[ext_resource type="Script" path="res://scripts/api/discover_gate.gd" id="13_3xhql"]
|
[ext_resource type="Script" path="res://scripts/api/discover_gate.gd" id="13_3xhql"]
|
||||||
[ext_resource type="Script" path="res://scripts/api/analytics/analytics_sender_bookmark.gd" id="13_74yg1"]
|
[ext_resource type="Script" path="res://scripts/api/analytics/analytics_sender_bookmark.gd" id="13_74yg1"]
|
||||||
[ext_resource type="Script" path="res://scripts/api/analytics/analytics_sender_gate.gd" id="13_jout6"]
|
[ext_resource type="Script" path="res://scripts/api/analytics/analytics_sender_gate.gd" id="13_jout6"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/api/featured_gates.gd" id="15_c1fxl"]
|
||||||
|
|
||||||
[node name="App" type="Node" node_paths=PackedStringArray("scenes_root")]
|
[node name="App" type="Node" node_paths=PackedStringArray("scenes_root")]
|
||||||
script = ExtResource("1_skc7d")
|
script = ExtResource("1_skc7d")
|
||||||
|
@ -51,11 +52,16 @@ gate_events = ExtResource("2_cdryv")
|
||||||
script = ExtResource("13_74yg1")
|
script = ExtResource("13_74yg1")
|
||||||
bookmarks = ExtResource("6_rupvx")
|
bookmarks = ExtResource("6_rupvx")
|
||||||
|
|
||||||
[node name="AddGate" type="Node" parent="Api"]
|
[node name="DiscoverGate" type="Node" parent="Api"]
|
||||||
script = ExtResource("13_3xhql")
|
script = ExtResource("13_3xhql")
|
||||||
api = ExtResource("10_04o5h")
|
api = ExtResource("10_04o5h")
|
||||||
gate_events = ExtResource("2_cdryv")
|
gate_events = ExtResource("2_cdryv")
|
||||||
|
|
||||||
|
[node name="FeaturedGates" type="Node" parent="Api"]
|
||||||
|
script = ExtResource("15_c1fxl")
|
||||||
|
api = ExtResource("10_04o5h")
|
||||||
|
bookmarks = ExtResource("6_rupvx")
|
||||||
|
|
||||||
[node name="Debug" parent="." instance=ExtResource("7_3xeb8")]
|
[node name="Debug" parent="." instance=ExtResource("7_3xeb8")]
|
||||||
|
|
||||||
[node name="Window" parent="Debug" index="0"]
|
[node name="Window" parent="Debug" index="0"]
|
||||||
|
|
13
project/scripts/api/featured_gates.gd
Normal file
13
project/scripts/api/featured_gates.gd
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var api: ApiSettings
|
||||||
|
@export var bookmarks: Bookmarks
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
bookmarks.on_ready.connect(on_bookmarks_ready)
|
||||||
|
|
||||||
|
|
||||||
|
func on_bookmarks_ready() -> void:
|
||||||
|
if bookmarks.gates.size() > 0: return
|
||||||
|
# TODO: Get featured gates
|
|
@ -1,6 +1,7 @@
|
||||||
extends Node
|
extends Node
|
||||||
class_name FileTools
|
class_name FileTools
|
||||||
|
|
||||||
|
|
||||||
static func remove_recursive(path: String) -> void:
|
static func remove_recursive(path: String) -> void:
|
||||||
if not DirAccess.dir_exists_absolute(path) and not FileAccess.file_exists(path): return
|
if not DirAccess.dir_exists_absolute(path) and not FileAccess.file_exists(path): return
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,9 @@ var create_user_id: String :
|
||||||
var discover_gate: String :
|
var discover_gate: String :
|
||||||
get: return url + "/api/discover_gate"
|
get: return url + "/api/discover_gate"
|
||||||
|
|
||||||
|
var featured_gates: String :
|
||||||
|
get: return url + "/api/featured_gates"
|
||||||
|
|
||||||
var search: String :
|
var search: String :
|
||||||
get: return url + "/api/search?query="
|
get: return url + "/api/search?query="
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
extends Resource
|
extends Resource
|
||||||
class_name Bookmarks
|
class_name Bookmarks
|
||||||
|
|
||||||
|
signal on_ready()
|
||||||
signal on_star(gate: Gate)
|
signal on_star(gate: Gate)
|
||||||
signal on_unstar(gate: Gate)
|
signal on_unstar(gate: Gate)
|
||||||
signal save_image(gate: Gate)
|
signal save_image(gate: Gate)
|
||||||
|
@ -15,6 +16,8 @@ func ready() -> void:
|
||||||
if gate == null or not Url.is_valid(gate.url): continue
|
if gate == null or not Url.is_valid(gate.url): continue
|
||||||
gates[gate.url] = gate
|
gates[gate.url] = gate
|
||||||
|
|
||||||
|
on_ready.emit()
|
||||||
|
|
||||||
|
|
||||||
func update(gate: Gate) -> void:
|
func update(gate: Gate) -> void:
|
||||||
if not gates.has(gate.url): return
|
if not gates.has(gate.url): return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue