1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Made "ImageEffects" node a separate scene

The ImageEffects node is the parent of all image effect dialogs
This commit is contained in:
OverloadedOrama 2020-07-29 20:06:20 +03:00
parent bedede5970
commit 30cd607c65
15 changed files with 70 additions and 41 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=22 format=2]
[gd_scene load_steps=16 format=2]
[ext_resource path="res://assets/themes/dark/theme.tres" type="Theme" id=1]
[ext_resource path="res://src/Main.gd" type="Script" id=2]
@ -6,21 +6,15 @@
[ext_resource path="res://src/UI/UI.tscn" type="PackedScene" id=4]
[ext_resource path="res://src/UI/PatternsPopup.tscn" type="PackedScene" id=5]
[ext_resource path="res://src/UI/BrushesPopup.tscn" type="PackedScene" id=6]
[ext_resource path="res://src/UI/Dialogs/ResizeCanvas.tscn" type="PackedScene" id=7]
[ext_resource path="res://src/UI/Dialogs/ImageEffects.tscn" type="PackedScene" id=7]
[ext_resource path="res://src/UI/Dialogs/SaveSpriteHTML5.tscn" type="PackedScene" id=8]
[ext_resource path="res://src/UI/Dialogs/GradientDialog.tscn" type="PackedScene" id=9]
[ext_resource path="res://src/UI/Dialogs/ShaderEffect.tscn" type="PackedScene" id=10]
[ext_resource path="res://src/UI/Dialogs/SaveSprite.tscn" type="PackedScene" id=11]
[ext_resource path="res://src/UI/Dialogs/OpenSprite.tscn" type="PackedScene" id=12]
[ext_resource path="res://src/UI/Dialogs/SplashDialog.tscn" type="PackedScene" id=27]
[ext_resource path="res://src/UI/Dialogs/CreateNewImage.tscn" type="PackedScene" id=28]
[ext_resource path="res://src/UI/Dialogs/ScaleImage.tscn" type="PackedScene" id=31]
[ext_resource path="res://src/Preferences/PreferencesDialog.tscn" type="PackedScene" id=32]
[ext_resource path="res://src/UI/Dialogs/OutlineDialog.tscn" type="PackedScene" id=33]
[ext_resource path="res://src/UI/Dialogs/AboutDialog.tscn" type="PackedScene" id=34]
[ext_resource path="res://src/UI/Dialogs/RotateImage.tscn" type="PackedScene" id=38]
[ext_resource path="res://src/UI/Dialogs/ExportDialog.tscn" type="PackedScene" id=39]
[ext_resource path="res://src/UI/Dialogs/HSVDialog.tscn" type="PackedScene" id=44]
[node name="Control" type="Control"]
anchor_right = 1.0
@ -51,31 +45,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="ImageEffects" type="Control" parent="Dialogs"]
mouse_filter = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ScaleImage" parent="Dialogs/ImageEffects" instance=ExtResource( 31 )]
margin_bottom = 127.0
[node name="ResizeCanvas" parent="Dialogs/ImageEffects" instance=ExtResource( 7 )]
margin_right = 216.0
margin_bottom = 392.0
[node name="RotateImage" parent="Dialogs/ImageEffects" instance=ExtResource( 38 )]
[node name="OutlineDialog" parent="Dialogs/ImageEffects" instance=ExtResource( 33 )]
margin_right = 217.0
margin_bottom = 106.0
[node name="HSVDialog" parent="Dialogs/ImageEffects" instance=ExtResource( 44 )]
[node name="GradientDialog" parent="Dialogs/ImageEffects" instance=ExtResource( 9 )]
margin_bottom = 214.0
[node name="ShaderEffect" parent="Dialogs/ImageEffects" instance=ExtResource( 10 )]
[node name="ImageEffects" parent="Dialogs" instance=ExtResource( 7 )]
[node name="BrushesPopup" parent="Dialogs" instance=ExtResource( 6 )]
@ -146,12 +116,6 @@ visible = false
visible = false
[node name="ModulateTween" type="Tween" parent="."]
[connection signal="popup_hide" from="Dialogs/ImageEffects/ScaleImage" to="." method="_can_draw_true"]
[connection signal="popup_hide" from="Dialogs/ImageEffects/ResizeCanvas" to="." method="_can_draw_true"]
[connection signal="popup_hide" from="Dialogs/ImageEffects/RotateImage" to="." method="_can_draw_true"]
[connection signal="popup_hide" from="Dialogs/ImageEffects/OutlineDialog" to="." method="_can_draw_true"]
[connection signal="popup_hide" from="Dialogs/ImageEffects/HSVDialog" to="." method="_can_draw_true"]
[connection signal="popup_hide" from="Dialogs/ImageEffects/GradientDialog" to="." method="_can_draw_true"]
[connection signal="popup_hide" from="Dialogs/SplashDialog" to="." method="_can_draw_true"]
[connection signal="popup_hide" from="Dialogs/CreateNewImage" to="." method="_can_draw_true"]
[connection signal="file_selected" from="Dialogs/OpenSprite" to="." method="_on_OpenSprite_file_selected"]

View file

@ -51,3 +51,7 @@ func _on_GradientDialog_confirmed() -> void:
Global.canvas.handle_undo("Draw")
DrawingAlgos.generate_gradient(current_cel, [color1.color, color2.color], steps.value, direction.selected)
Global.canvas.handle_redo("Draw")
func _on_GradientDialog_popup_hide() -> void:
Global.dialog_open(false)

View file

@ -101,6 +101,7 @@ items = [ "Top to Bottom", null, false, 0, null, "Bottom to Top", null, false, 1
selected = 0
[connection signal="about_to_show" from="." to="." method="_on_GradientDialog_about_to_show"]
[connection signal="confirmed" from="." to="." method="_on_GradientDialog_confirmed"]
[connection signal="popup_hide" from="." to="." method="_on_GradientDialog_popup_hide"]
[connection signal="color_changed" from="VBoxContainer/ColorsContainer/ColorPickerButton" to="." method="_on_ColorPickerButton_color_changed"]
[connection signal="color_changed" from="VBoxContainer/ColorsContainer/ColorPickerButton2" to="." method="_on_ColorPickerButton2_color_changed"]
[connection signal="value_changed" from="VBoxContainer/StepsContainer/StepSpinBox" to="." method="_on_StepSpinBox_value_changed"]

View file

@ -145,3 +145,7 @@ func _on_SelectionCheckBox_toggled(button_pressed : bool) -> void:
func _on_AffectOptionButton_item_selected(index : int) -> void:
affect = index
func _on_HSVDialog_popup_hide() -> void:
Global.dialog_open(false)

View file

@ -177,6 +177,7 @@ mouse_default_cursor_shape = 2
size_flags_horizontal = 3
text = "Cancel"
[connection signal="about_to_show" from="." to="." method="_on_HSVDialog_about_to_show"]
[connection signal="popup_hide" from="." to="." method="_on_HSVDialog_popup_hide"]
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer/Sliders/Hue" to="." method="_on_Hue_value_changed"]
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer/Sliders/Saturation" to="." method="_on_Saturation_value_changed"]
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer/Sliders/Value" to="." method="_on_Value_value_changed"]

View file

@ -0,0 +1,35 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://src/UI/Dialogs/ResizeCanvas.tscn" type="PackedScene" id=8]
[ext_resource path="res://src/UI/Dialogs/RotateImage.tscn" type="PackedScene" id=9]
[ext_resource path="res://src/UI/Dialogs/ShaderEffect.tscn" type="PackedScene" id=10]
[ext_resource path="res://src/UI/Dialogs/HSVDialog.tscn" type="PackedScene" id=11]
[ext_resource path="res://src/UI/Dialogs/GradientDialog.tscn" type="PackedScene" id=12]
[ext_resource path="res://src/UI/Dialogs/OutlineDialog.tscn" type="PackedScene" id=13]
[ext_resource path="res://src/UI/Dialogs/ScaleImage.tscn" type="PackedScene" id=14]
[node name="ImageEffects" type="Control"]
mouse_filter = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ScaleImage" parent="." instance=ExtResource( 14 )]
margin_bottom = 127.0
[node name="ResizeCanvas" parent="." instance=ExtResource( 8 )]
margin_right = 216.0
margin_bottom = 392.0
[node name="RotateImage" parent="." instance=ExtResource( 9 )]
[node name="OutlineDialog" parent="." instance=ExtResource( 13 )]
margin_right = 217.0
margin_bottom = 106.0
[node name="HSVDialog" parent="." instance=ExtResource( 11 )]
[node name="GradientDialog" parent="." instance=ExtResource( 12 )]
margin_bottom = 214.0
[node name="ShaderEffect" parent="." instance=ExtResource( 10 )]

View file

@ -108,3 +108,7 @@ func update_preview() -> void:
func _on_AffectOptionButton_item_selected(index : int) -> void:
affect = index
func _on_OutlineDialog_popup_hide() -> void:
Global.dialog_open(false)

View file

@ -99,6 +99,7 @@ items = [ "Current cel", null, false, 0, null, "Current frame", null, false, 1,
selected = 0
[connection signal="about_to_show" from="." to="." method="_on_OutlineDialog_about_to_show"]
[connection signal="confirmed" from="." to="." method="_on_OutlineDialog_confirmed"]
[connection signal="popup_hide" from="." to="." method="_on_OutlineDialog_popup_hide"]
[connection signal="value_changed" from="VBoxContainer/OptionsContainer/ThickValue" to="." method="_on_ThickValue_value_changed"]
[connection signal="color_changed" from="VBoxContainer/OptionsContainer/OutlineColor" to="." method="_on_OutlineColor_color_changed"]
[connection signal="toggled" from="VBoxContainer/OptionsContainer/DiagonalCheckBox" to="." method="_on_DiagonalCheckBox_toggled"]

View file

@ -101,3 +101,7 @@ func update_transparent_background_size(preview_image : Image) -> void:
preview_rect.get_node("TransparentChecker").rect_size.x = image_size_x
preview_rect.get_node("TransparentChecker").rect_size.y = image_size_y
func _on_ResizeCanvas_popup_hide() -> void:
Global.dialog_open(false)

View file

@ -126,6 +126,7 @@ stretch_mode = 5
show_behind_parent = true
[connection signal="about_to_show" from="." to="." method="_on_ResizeCanvas_about_to_show"]
[connection signal="confirmed" from="." to="." method="_on_ResizeCanvas_confirmed"]
[connection signal="popup_hide" from="." to="." method="_on_ResizeCanvas_popup_hide"]
[connection signal="value_changed" from="VBoxContainer/OptionsContainer/WidthValue" to="." method="_on_WidthValue_value_changed"]
[connection signal="value_changed" from="VBoxContainer/OptionsContainer/HeightValue" to="." method="_on_HeightValue_value_changed"]
[connection signal="value_changed" from="VBoxContainer/OptionsContainer/XSpinBox" to="." method="_on_XSpinBox_value_changed"]

View file

@ -58,3 +58,7 @@ func _on_OptionButton_item_selected(_id) -> void:
func _on_RotateImage_about_to_show() -> void:
$VBoxContainer/HBoxContainer/HSlider.value = 0
func _on_RotateImage_popup_hide() -> void:
Global.dialog_open(false)

View file

@ -80,6 +80,7 @@ max_value = 359.0
suffix = "°"
[connection signal="about_to_show" from="." to="." method="_on_RotateImage_about_to_show"]
[connection signal="confirmed" from="." to="." method="_on_RotateImage_confirmed"]
[connection signal="popup_hide" from="." to="." method="_on_RotateImage_popup_hide"]
[connection signal="item_selected" from="VBoxContainer/HBoxContainer2/OptionButton" to="." method="_on_OptionButton_item_selected"]
[connection signal="value_changed" from="VBoxContainer/HBoxContainer/HSlider" to="." method="_on_HSlider_value_changed"]
[connection signal="value_changed" from="VBoxContainer/HBoxContainer/SpinBox" to="." method="_on_SpinBox_value_changed"]

View file

@ -6,3 +6,7 @@ func _on_ScaleImage_confirmed() -> void:
var height : int = $VBoxContainer/OptionsContainer/HeightValue.value
var interpolation : int = $VBoxContainer/OptionsContainer/InterpolationType.selected
DrawingAlgos.scale_image(width, height, interpolation)
func _on_ScaleImage_popup_hide() -> void:
Global.dialog_open(false)

View file

@ -74,3 +74,4 @@ text = "Nearest"
items = [ "Nearest", null, false, 0, null, "Bilinear", null, false, 1, null, "Cubic", null, false, 2, null, "Trilinear", null, false, 3, null, "Lanczos", null, false, 4, null ]
selected = 0
[connection signal="confirmed" from="." to="." method="_on_ScaleImage_confirmed"]
[connection signal="popup_hide" from="." to="." method="_on_ScaleImage_popup_hide"]

View file

@ -81,9 +81,9 @@ func change_shader(shader : Shader, name : String) -> void:
u_value = uniform_split[1].replace(";", "").strip_edges()
var u_left_side = uniform_split[0].split(":")
var u_hint := ""
var _u_hint := ""
if u_left_side.size() > 1:
u_hint = u_left_side[1].strip_edges()
_u_hint = u_left_side[1].strip_edges()
var u_init = u_left_side[0].split(" ")
var u_type = u_init[1]