1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Move set_nodes() logic to parent class ImageEffect

Also fixes a crash when trying to change the affected cels option in image effects that do not have animation options
This commit is contained in:
Emmanouil Papadeas 2023-04-20 22:29:03 +03:00
parent 0fe315d605
commit 118e2e7671
12 changed files with 7 additions and 74 deletions

View file

@ -122,7 +122,12 @@ func commit_action(_cel: Image, _project: Project = Global.current_project) -> v
func set_nodes() -> void:
pass
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
animate_options_container = $VBoxContainer/AnimationOptions
animate_menu = $"%AnimateMenu".get_popup()
initial_button = $"%InitalButton"
func set_animate_menu(elements: int) -> void:

View file

@ -14,12 +14,6 @@ func _ready() -> void:
preview.set_material(sm)
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
var selection_tex := ImageTexture.new()
if selection_checkbox.pressed and project.has_selection:

View file

@ -16,15 +16,6 @@ func _ready() -> void:
preview.set_material(sm)
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
animate_options_container = $VBoxContainer/AnimationOptions
animate_menu = $"%AnimateMenu".get_popup()
initial_button = $"%InitalButton"
func set_animate_menu(_elements) -> void:
# set as in enum
animate_menu.add_check_item("Offset X", Animate.OFFSET_X)

View file

@ -4,12 +4,6 @@ onready var flip_h := $VBoxContainer/FlipOptions/FlipHorizontal as CheckBox
onready var flip_v := $VBoxContainer/FlipOptions/FlipVertical as CheckBox
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
_flip_image(cel, selection_checkbox.pressed, project)

View file

@ -45,12 +45,6 @@ func _ready() -> void:
dithering_option_button.add_item(matrix.name)
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
var selection: Image
var selection_tex := ImageTexture.new()

View file

@ -9,12 +9,6 @@ func _ready() -> void:
preview.set_material(sm)
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
var selection_tex := ImageTexture.new()
if selection_checkbox.pressed and project.has_selection:

View file

@ -19,15 +19,6 @@ func _about_to_show() -> void:
._about_to_show()
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
animate_options_container = $VBoxContainer/AnimationOptions
animate_menu = $"%AnimateMenu".get_popup()
initial_button = $"%InitalButton"
func set_animate_menu(_elements) -> void:
# set as in enum
animate_menu.add_check_item("Hue", Animate.HUE)

View file

@ -14,12 +14,6 @@ func _ready() -> void:
preview.set_material(sm)
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
var selection_tex := ImageTexture.new()
if selection_checkbox.pressed and project.has_selection:

View file

@ -22,15 +22,6 @@ func _ready() -> void:
color = outline_color.color
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
animate_options_container = $VBoxContainer/AnimationOptions
animate_menu = $"%AnimateMenu".get_popup()
initial_button = $"%InitalButton"
func set_animate_menu(_elements) -> void:
# set as in enum
animate_menu.add_check_item("Thickness", Animate.THICKNESS)

View file

@ -11,12 +11,6 @@ func _ready() -> void:
preview.set_material(sm)
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
var selection_tex := ImageTexture.new()
if selection_checkbox.pressed and project.has_selection:

View file

@ -34,15 +34,6 @@ func _ready() -> void:
type_option_button.emit_signal("item_selected", 0)
func set_nodes() -> void:
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
animate_options_container = $VBoxContainer/AnimationOptions
animate_menu = $"%AnimateMenu".get_popup()
initial_button = $"%InitalButton"
func set_animate_menu(_elements) -> void:
# set as in enum
animate_menu.add_check_item("Angle", Animate.ANGLE)

View file

@ -10,7 +10,7 @@ window_title = "Rotate Image"
script = ExtResource( 1 )
[node name="VBoxContainer" parent="." index="3"]
margin_bottom = 458.0
margin_bottom = 416.0
[node name="AspectRatioContainer" parent="VBoxContainer" index="0"]
margin_right = 278.0