-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_create.gd
More file actions
38 lines (37 loc) · 2.03 KB
/
main_create.gd
File metadata and controls
38 lines (37 loc) · 2.03 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
extends PanelContainer
func _ready() -> void:
pass
func _process(_delta: float) -> void:
pass
func _gui_input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
if Rect2(Vector2.ZERO, size).has_point(event.position):
add_theme_stylebox_override("panel", preload("res://button_pressed_stylebox.tres"))
else:
add_theme_stylebox_override("panel", preload("res://button_stylebox.tres"))
elif event is InputEventMouseButton and event.button_index == MouseButton.MOUSE_BUTTON_LEFT:
if event.is_pressed():
add_theme_stylebox_override("panel", preload("res://button_pressed_stylebox.tres"))
elif event.is_released():
add_theme_stylebox_override("panel", preload("res://button_stylebox.tres"))
if Rect2(Vector2.ZERO, size).has_point(event.position):
var fd = FileDialog.new()
fd.use_native_dialog = true
fd.access = FileDialog.Access.ACCESS_FILESYSTEM
fd.file_mode = FileDialog.FileMode.FILE_MODE_OPEN_FILE
fd.filters = PackedStringArray(["audio/*"])
fd.show()
await fd.file_selected
Global.music = fd.current_path
fd.clear_filters()
fd.filters = PackedStringArray(["image/*"])
fd.show()
await fd.file_selected
Global.illustration = fd.current_path
$"../../../../ChartInfo/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/LineEdits/Chart".text = Global.music.get_file().substr(0, Global.music.get_file().rfind("."))
$"../../../../ChartInfo/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/LineEdits/Artist".text = ""
$"../../../../ChartInfo/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/LineEdits/Illustrator".text = ""
$"../../../../ChartInfo/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/LineEdits/Version".text = "SP Lv.?"
$"../../../../ChartInfo/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/LineEdits/Author".text = ""
$"../../../../ChartInfo/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/LineEdits/Path".text = String.num_int64(RandomNumberGenerator.new().randi())
$"../../../../ChartInfo".visible = true