-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.gd
More file actions
55 lines (39 loc) · 1.26 KB
/
Copy pathgui.gd
File metadata and controls
55 lines (39 loc) · 1.26 KB
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
49
50
51
52
53
54
55
extends HSplitContainer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
pass
func _on_test_code_pressed() -> void:
#ParseGcode.parseCode(get_node("Panel/TextEdit").text)
pass
func hideAll() -> void:
get_tree().root.get_node("World/stockEdit").visible = false
get_tree().root.get_node("World/spindle_edit").visible = false
get_node("VBoxContainer/FileDialog").visible = false
func _on_edit_stock_pressed() -> void:
var node = get_tree().root.get_node("World/stockEdit")
if node.visible == true:
hideAll()
else:
hideAll()
node.visible = true
func _on_edit_spindle_pressed() -> void:
var node = get_tree().root.get_node("World/spindle_edit")
if node.visible == true:
hideAll()
else:
hideAll()
node.visible = true
func _on_load_gcode_pressed() -> void:
var node = get_node("VBoxContainer/FileDialog")
if node.visible == true:
hideAll()
else:
hideAll()
node.visible = true
func _on_file_dialog_file_selected(path: String) -> void:
var file = FileAccess.open(path, FileAccess.READ)
var content = file.get_as_text()
get_node("Panel/TextEdit").text = content