-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEXIT_TO_MENUButton.gd
47 lines (34 loc) · 1.57 KB
/
EXIT_TO_MENUButton.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
35
36
37
38
39
40
41
42
43
44
45
46
47
extends Button
var rootNode = null
func _pressed():
ui_reset()
# Called when the node enters the scene tree for the first time.
func _ready():
rootNode = get_tree().get_root()
process_mode = Node.PROCESS_MODE_ALWAYS
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
pass
func ui_reset():
rootNode = get_tree().get_root()
rootNode.get_node("CellSpawner/UI/ExtraPanel/FpsCounter").text = "-1" # Toggles FpsCounter off
rootNode.get_node("CellSpawner/UI/ExtraPanel/TimeCounter").text = "-1" # Toggles TimeCounter off
rootNode.get_node("CellSpawner/UI/MenuPanel").visible = false
rootNode.get_node("CellSpawner/UI/MenuPanel/ExitMenuButton").from_main_menu = false
rootNode.get_node("CellSpawner/UI/StatsPanel").visible = false
rootNode.get_node("CellSpawner/UI/NavBar").visible = false
rootNode.get_node("CellSpawner/UI/BarPanel").visible = true
rootNode.get_node("CellSpawner/UI/CellSelectPanel").visible = false
rootNode.get_node("CellSpawner/UI/ExtraPanel").visible = false
var speed_display = rootNode.get_node("CellSpawner/UI/NavBar/SpeedControlPanel/SpeedDisplay")
speed_display.toggle_display()
var cell_cam = rootNode.get_node("CellSpawner/UI_Cam") # clear any selections
cell_cam.clear_selection()
var spawner = rootNode.get_node("CellSpawner")
var zones = rootNode.get_node("CellSpawner/CellEnvironment")
spawner.remove_all_cells()
for i in range(spawner.get_num_cells()):
spawner.spawn_cell(1)
zones.remove_all_nutrient_zones()
for i in range(zones.get_n_nutrient_zones()):
zones.spawn_nutrient_zone()