-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.gd
More file actions
48 lines (44 loc) · 970 Bytes
/
project.gd
File metadata and controls
48 lines (44 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class_name ConstellationPage extends Resource
const HEADER:Dictionary = {
"format": "particle",
"title": "My Site",
"content": []
}
const PARAGRAPH:Dictionary = {
"type": "paragraph",
"text": "This is a paragraph of text."
}
const BUTTON:Dictionary = {
"type": "button",
"label": "New Button",
"action": "/"
}
const LIST:Dictionary = {
"type": "list",
"items": []
}
const BLOCKQUOTE:Dictionary = {
"type": "blockquote",
"text": "Indented paragraph."
}
const SEPARATOR:Dictionary = {
"type": "separator"
}
const IMAGE:Dictionary = {
"type": "image",
"width": 100,
"height": 60,
"pixels": ""
}
var name:String
var pages:Dictionary = {
"My Site" = "index.json",
}
func new_page(name:String, directory:String) -> void:
var template:Dictionary = HEADER.duplicate(true)
var content:Array = template["content"]
content.append(PARAGRAPH)
ParticleParser.save_json_to_file(
JSON.stringify(HEADER),
String("user://" + directory + name + ".json")
)