Overhauled camera
This commit is contained in:
parent
5fe8f22ccb
commit
da78e7f287
21 changed files with 385 additions and 71 deletions
55
UI/Rules/Rules.gd
Normal file
55
UI/Rules/Rules.gd
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
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_BACK).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
|
||||
|
||||
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 hide_panel() -> void:
|
||||
var tween = get_tree().create_tween()
|
||||
tween.set_parallel(true)
|
||||
tween.tween_method(tween_blur, 1.0, 0.0, 0.5).set_trans(Tween.TRANS_EXPO).set_ease(Tween.EASE_IN_OUT)
|
||||
tween.tween_property(margin_container2, "position:y", 700, 0.5).set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_IN)
|
||||
|
||||
tween.finished.connect(_on_panel_hidden)
|
||||
|
||||
func _on_panel_hidden() -> void:
|
||||
visible = false
|
||||
|
||||
|
||||
func _on_close_button_pressed():
|
||||
hide_panel()
|
||||
Loading…
Add table
Add a link
Reference in a new issue