54 lines
1.7 KiB
GDScript3
54 lines
1.7 KiB
GDScript3
|
|
extends Control
|
||
|
|
|
||
|
|
@onready var category_label = $Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/CategoryLabel
|
||
|
|
@onready var margin_container = $Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer
|
||
|
|
@onready var panel_container = $PanelContainer
|
||
|
|
|
||
|
|
@onready var general = $Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/General
|
||
|
|
|
||
|
|
@onready var margin_container2 = $Pivot/MarginContainer
|
||
|
|
|
||
|
|
var mat: ShaderMaterial
|
||
|
|
|
||
|
|
func show_panel() -> void:
|
||
|
|
margin_container2.position.y = 700
|
||
|
|
mat.set_shader_parameter("lod", 0)
|
||
|
|
|
||
|
|
visible = true
|
||
|
|
|
||
|
|
var tween = get_tree().create_tween()
|
||
|
|
tween.set_parallel(true)
|
||
|
|
tween.tween_method(tween_blur, 0.0, 1.0, 0.5).set_trans(Tween.TRANS_EXPO).set_ease(Tween.EASE_IN_OUT)
|
||
|
|
tween.tween_property(margin_container2, "position:y", 0.0, 0.5).set_trans(Tween.TRANS_SPRING).set_ease(Tween.EASE_OUT)
|
||
|
|
|
||
|
|
# Called when the node enters the scene tree for the first time.
|
||
|
|
func _ready():
|
||
|
|
mat = panel_container.material
|
||
|
|
pass # Replace with function body.
|
||
|
|
|
||
|
|
func tween_blur(val: float) -> void:
|
||
|
|
mat.set_shader_parameter("lod", val)
|
||
|
|
pass
|
||
|
|
|
||
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
|
func _process(delta):
|
||
|
|
pass
|
||
|
|
|
||
|
|
|
||
|
|
func _on_button_pressed(label: NodePath, category: String = ""):
|
||
|
|
for child in margin_container.get_children():
|
||
|
|
child.visible = false
|
||
|
|
|
||
|
|
category_label.text = category
|
||
|
|
|
||
|
|
# hacky
|
||
|
|
general.get_node(label).visible = true
|
||
|
|
|
||
|
|
|
||
|
|
func _on_ant_pressed(extra_arg_0, extra_arg_1):
|
||
|
|
pass # Replace with function body.
|
||
|
|
|
||
|
|
|
||
|
|
func _on_close_button_pressed():
|
||
|
|
visible = false
|