Sound FX, major work on set schedule, and some new concepts for items and portraits
This commit is contained in:
34
scripts/set_shifts.gd
Normal file
34
scripts/set_shifts.gd
Normal file
@@ -0,0 +1,34 @@
|
||||
extends Control
|
||||
|
||||
@onready var shift_cycle_template = preload("res://templates/shift_cycle.tscn")
|
||||
@onready var cycle_list : ReorderableVBox = %CycleList
|
||||
@onready var delete_bin : PanelContainer = %DeleteBin
|
||||
var delete_tween : Tween
|
||||
|
||||
func _ready() -> void:
|
||||
delete_tween = delete_bin.create_tween()
|
||||
delete_tween.tween_property(delete_bin, "self_modulate", Color.WHITE, .3)
|
||||
delete_tween.tween_property(delete_bin, "self_modulate", Color.DIM_GRAY, .3)
|
||||
delete_tween.set_loops(-1)
|
||||
delete_tween.pause()
|
||||
delete_bin.self_modulate = Color.DIM_GRAY
|
||||
|
||||
func _on_drag_stopped(cycle : ShiftCycle):
|
||||
cycle.drop()
|
||||
if(delete_bin.get_global_rect().has_point(get_global_mouse_position())
|
||||
and len(cycle_list.get_children()) > 1):
|
||||
delete_tween.pause()
|
||||
delete_bin.self_modulate = Color.DIM_GRAY
|
||||
cycle.queue_free()
|
||||
|
||||
func _on_drag_started(cycle : ShiftCycle):
|
||||
cycle.lift()
|
||||
pass
|
||||
|
||||
func _on_add_shift_button_pressed() -> void:
|
||||
var cycle = shift_cycle_template.instantiate()
|
||||
cycle_list.add_child(cycle)
|
||||
|
||||
|
||||
func _on_accept_button_pressed() -> void:
|
||||
pass # Replace with function body.
|
||||
Reference in New Issue
Block a user