[gd_scene load_steps=4 format=2]

[ext_resource path="res://src/UI/Dialogs/ImageEffects/RotateImage.gd" type="Script" id=1]
[ext_resource path="res://src/UI/TransparentChecker.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/UI/Nodes/ValueSlider.tscn" type="PackedScene" id=3]

[node name="RotateImage" type="ConfirmationDialog"]
margin_right = 342.0
margin_bottom = 450.0
rect_min_size = Vector2( 342, 450 )
window_title = "Rotate Image"
resizable = true
script = ExtResource( 1 )

[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 8.0
margin_top = 8.0
margin_right = -8.0
margin_bottom = -36.0

[node name="AspectRatioContainer" type="AspectRatioContainer" parent="VBoxContainer"]
margin_right = 326.0
margin_bottom = 222.0
size_flags_vertical = 3

[node name="Preview" type="TextureRect" parent="VBoxContainer/AspectRatioContainer"]
margin_left = 52.0
margin_right = 274.0
margin_bottom = 222.0
rect_min_size = Vector2( 200, 200 )
expand = true
stretch_mode = 5

[node name="TransparentChecker" parent="VBoxContainer/AspectRatioContainer/Preview" instance=ExtResource( 2 )]
show_behind_parent = true
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = 0.0
margin_bottom = 0.0

[node name="Indicator" type="Control" parent="VBoxContainer/AspectRatioContainer"]
margin_left = 52.0
margin_right = 274.0
margin_bottom = 222.0
mouse_default_cursor_shape = 2

[node name="LiveSettings" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 226.0
margin_right = 326.0
margin_bottom = 250.0
alignment = 1

[node name="LiveCheckbox" type="CheckBox" parent="VBoxContainer/LiveSettings"]
margin_left = 109.0
margin_right = 217.0
margin_bottom = 24.0
mouse_default_cursor_shape = 2
pressed = true
text = "Live Preview"

[node name="WaitTime" parent="VBoxContainer" instance=ExtResource( 3 )]
visible = false
margin_top = 232.0
margin_right = 326.0
margin_bottom = 256.0
min_value = 1.0
max_value = 1000.0
value = 200.0
editable = false
prefix = "Preview delay:"
suffix = "ms"

[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 254.0
margin_right = 326.0
margin_bottom = 274.0

[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2"]
margin_top = 3.0
margin_right = 34.0
margin_bottom = 17.0
text = "Type:"

[node name="TypeOptionButton" type="OptionButton" parent="VBoxContainer/HBoxContainer2"]
margin_left = 38.0
margin_right = 326.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
margin_top = 278.0
margin_right = 326.0
margin_bottom = 282.0

[node name="PivotOptions" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 286.0
margin_right = 326.0
margin_bottom = 310.0

[node name="XPivot" parent="VBoxContainer/PivotOptions" instance=ExtResource( 3 )]
margin_right = 132.0
step = 0.5
allow_greater = true
allow_lesser = true
prefix = "Pivot x:"

[node name="YPivot" parent="VBoxContainer/PivotOptions" instance=ExtResource( 3 )]
margin_left = 136.0
margin_right = 268.0
step = 0.5
allow_greater = true
allow_lesser = true
prefix = "Pivot y:"

[node name="Centre" type="Button" parent="VBoxContainer/PivotOptions"]
margin_left = 272.0
margin_right = 326.0
margin_bottom = 24.0
hint_tooltip = "Places the pivot at the center of the image, or at the center of the selection, if it is present."
mouse_default_cursor_shape = 2
text = "Center"

[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"]
margin_top = 314.0
margin_right = 326.0
margin_bottom = 318.0

[node name="AngleSlider" parent="VBoxContainer" instance=ExtResource( 3 )]
margin_top = 322.0
margin_right = 326.0
margin_bottom = 346.0
max_value = 359.0
prefix = "Angle:"
suffix = "°"
snap_step = 45.0

[node name="QuickRotations" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 350.0
margin_right = 326.0
margin_bottom = 370.0
alignment = 1

[node name="Deduct90" type="Button" parent="VBoxContainer/QuickRotations"]
margin_right = 62.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
text = "-90"

[node name="Deduct45" type="Button" parent="VBoxContainer/QuickRotations"]
margin_left = 66.0
margin_right = 128.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
text = "-45"

[node name="Zero" type="Button" parent="VBoxContainer/QuickRotations"]
margin_left = 132.0
margin_right = 194.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
text = "0"

[node name="Add45" type="Button" parent="VBoxContainer/QuickRotations"]
margin_left = 198.0
margin_right = 260.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
text = "+45"

[node name="Add90" type="Button" parent="VBoxContainer/QuickRotations"]
margin_left = 264.0
margin_right = 326.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
text = "+90"

[node name="SmearOptions" type="VBoxContainer" parent="VBoxContainer"]
visible = false
margin_top = 352.0
margin_right = 326.0
margin_bottom = 430.0

[node name="HSeparator" type="HSeparator" parent="VBoxContainer/SmearOptions"]
margin_right = 326.0
margin_bottom = 4.0

[node name="Label" type="Label" parent="VBoxContainer/SmearOptions"]
margin_top = 8.0
margin_right = 326.0
margin_bottom = 22.0
text = "Smear options:"

[node name="ToleranceSlider" parent="VBoxContainer/SmearOptions" instance=ExtResource( 3 )]
margin_top = 26.0
margin_right = 326.0
margin_bottom = 50.0
max_value = 255.0
value = 100.0
prefix = "Tolerance:"

[node name="InitialAngleSlider" parent="VBoxContainer/SmearOptions" instance=ExtResource( 3 )]
margin_top = 54.0
margin_right = 326.0
margin_bottom = 78.0
max_value = 359.0
value = 359.0
prefix = "Initial angle:"
suffix = "°"
snap_step = 45.0

[node name="HSeparator3" type="HSeparator" parent="VBoxContainer"]
margin_top = 374.0
margin_right = 326.0
margin_bottom = 378.0

[node name="OptionsContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 382.0
margin_right = 326.0
margin_bottom = 406.0

[node name="SelectionCheckBox" type="CheckBox" parent="VBoxContainer/OptionsContainer"]
margin_right = 161.0
margin_bottom = 24.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
pressed = true
text = "Only affect selection"

[node name="AffectOptionButton" type="OptionButton" parent="VBoxContainer/OptionsContainer"]
margin_left = 165.0
margin_right = 326.0
margin_bottom = 24.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
text = "Selected cels"
items = [ "Selected cels", null, false, 0, null, "Current frame", null, false, 1, null, "All frames", null, false, 2, null, "All projects", null, false, 3, null ]
selected = 0

[node name="WaitApply" type="Timer" parent="."]

[connection signal="draw" from="VBoxContainer/AspectRatioContainer/Indicator" to="." method="_on_Indicator_draw"]
[connection signal="gui_input" from="VBoxContainer/AspectRatioContainer/Indicator" to="." method="_on_Indicator_gui_input"]
[connection signal="toggled" from="VBoxContainer/LiveSettings/LiveCheckbox" to="." method="_on_LiveCheckbox_toggled"]
[connection signal="value_changed" from="VBoxContainer/WaitTime" to="." method="_on_WaitTime_value_changed"]
[connection signal="item_selected" from="VBoxContainer/HBoxContainer2/TypeOptionButton" to="." method="_on_TypeOptionButton_item_selected"]
[connection signal="value_changed" from="VBoxContainer/PivotOptions/XPivot" to="." method="_on_Pivot_value_changed" binds= [ true ]]
[connection signal="value_changed" from="VBoxContainer/PivotOptions/YPivot" to="." method="_on_Pivot_value_changed" binds= [ false ]]
[connection signal="pressed" from="VBoxContainer/PivotOptions/Centre" to="." method="_on_Centre_pressed"]
[connection signal="value_changed" from="VBoxContainer/AngleSlider" to="." method="_on_AngleSlider_value_changed"]
[connection signal="pressed" from="VBoxContainer/QuickRotations/Deduct90" to="." method="_on_quick_change_angle_pressed" binds= [ -90 ]]
[connection signal="pressed" from="VBoxContainer/QuickRotations/Deduct45" to="." method="_on_quick_change_angle_pressed" binds= [ -45 ]]
[connection signal="pressed" from="VBoxContainer/QuickRotations/Zero" to="." method="_on_quick_change_angle_pressed" binds= [ 0 ]]
[connection signal="pressed" from="VBoxContainer/QuickRotations/Add45" to="." method="_on_quick_change_angle_pressed" binds= [ 45 ]]
[connection signal="pressed" from="VBoxContainer/QuickRotations/Add90" to="." method="_on_quick_change_angle_pressed" binds= [ 90 ]]
[connection signal="value_changed" from="VBoxContainer/SmearOptions/ToleranceSlider" to="." method="_on_ToleranceSlider_value_changed"]
[connection signal="value_changed" from="VBoxContainer/SmearOptions/InitialAngleSlider" to="." method="_on_InitialAngleSlider_value_changed"]
[connection signal="timeout" from="WaitApply" to="." method="_on_WaitApply_timeout"]
