Cow_Life_Sim_RPG/Objects/Museum/AshBarrel/AshBarrel.gd

24 lines
507 B
GDScript

extends Node2D
func _ready():
update_ash()
func show_ash_barrel_window():
%AshBarrelWindow.popup_centered()
%AshBarrelWindow.opened()
func update_ash():
var ash_count = %AshBarrelWindow.get_ash_count()
if ash_count > 0:
%AshBottom.visible = true
%AshBottom.self_modulate = %AshBarrelWindow.get_ash_color()
else:
%AshBottom.visible = false
%AshBar.value = ash_count
var newStyleBox = %AshBar.get("theme_override_styles/fill")
newStyleBox.bg_color = %AshBarrelWindow.get_ash_color()