[gd_scene load_steps=10 format=2]

[ext_resource path="res://Actors/Objects/PowerStorage/PowerStorage.gd" type="Script" id=1]
[ext_resource path="res://Graphics/tgstation/smes.png" type="Texture" id=2]
[ext_resource path="res://Actors/Components/ActivationRange.gd" type="Script" id=3]
[ext_resource path="res://Actors/Objects/PowerStorage/UI/PowerUI.tscn" type="PackedScene" id=4]
[ext_resource path="res://Actors/Components/PowerManager.gd" type="Script" id=5]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 16, 16 )

[sub_resource type="Animation" id=2]
length = 0.2
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath("Control:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
}
tracks/1/type = "bezier"
tracks/1/path = NodePath("Control:position:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"points": PoolRealArray( 10, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.2 )
}

[sub_resource type="Animation" id=3]
length = 0.2
tracks/0/type = "value"
tracks/0/path = NodePath("Control:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
}
tracks/1/type = "bezier"
tracks/1/path = NodePath("Control:position:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 10, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.2 )
}

[sub_resource type="CircleShape2D" id=4]
radius = 56.0

[node name="StaticBody2D" type="StaticBody2D"]
input_pickable = true
script = ExtResource( 1 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 16, 16 )
shape = SubResource( 1 )

[node name="smes" type="Sprite" parent="."]
texture = ExtResource( 2 )
centered = false

[node name="UIAnimation" type="AnimationPlayer" parent="."]
anims/fadein = SubResource( 2 )
anims/fadeout = SubResource( 3 )

[node name="PowerManager" type="Node" parent="."]
script = ExtResource( 5 )

[node name="Control" type="Node2D" parent="."]
position = Vector2( 16, 0 )
z_index = 999

[node name="PowerUI" parent="Control" instance=ExtResource( 4 )]
visible = false
margin_left = -50.0
margin_top = -85.0
margin_right = 150.0
margin_bottom = 57.0
rect_scale = Vector2( 0.5, 0.5 )

[node name="ActivationRange" type="Area2D" parent="."]
visible = false
position = Vector2( 16, 16 )
input_pickable = false
script = ExtResource( 3 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="ActivationRange"]
shape = SubResource( 4 )
[connection signal="mouse_entered" from="Control/PowerUI" to="." method="_ui_focus_changed" binds= [ true ]]
[connection signal="mouse_exited" from="Control/PowerUI" to="." method="_ui_focus_changed" binds= [ false ]]
[connection signal="player_left" from="ActivationRange" to="." method="_force_close_ui"]
