-
Notifications
You must be signed in to change notification settings - Fork 1
/
Global.gd
34 lines (28 loc) · 918 Bytes
/
Global.gd
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
extends Node
# Convenience variables for accessing UI elements. We simply search for the
# needed nodes at runtime and store their references, allowing the UI tree
# to be freely manipulated, controls can be moved around whever, but no code
# changes are ever required (assuming all the ui elements we need to access
# have unique names and we don't change them).
var tiley # root node; will be set by Tiley.gd _init()
var controls = {} # nodes of ui controls that we need to access
func _init():
OS.window_maximized = true
randomize()
func _ready():
# the list of controls we want direct access to
var global_controls = [
"GenerOption",
"GenerInspector",
"GenerDescription",
"GridSize",
"TileySize",
"TileyScale",
"Colors",
"Background",
"PaletteOption",
"SaveDialog",
]
# go find 'em all!
for control in global_controls:
controls[control] = tiley.find_node("*" + control)