1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-30 23:19:49 +00:00

Remove unneeded cel properties for audio cels

This commit is contained in:
Emmanouil Papadeas 2024-12-10 01:42:22 +02:00
parent 04f5a162c0
commit a1764f3323
4 changed files with 18 additions and 18 deletions

View file

@ -15,18 +15,18 @@ func _on_visibility_changed() -> void:
Global.dialog_open(visible)
var first_cel := Global.current_project.frames[cel_indices[0][0]].cels[cel_indices[0][1]]
if visible:
var first_layer := Global.current_project.layers[cel_indices[0][1]]
if cel_indices.size() == 1:
var layer := Global.current_project.layers[cel_indices[0][1]]
frame_num.text = str(cel_indices[0][0] + 1)
layer_num.text = layer.name
layer_num.text = first_layer.name
else:
var first_layer := Global.current_project.layers[cel_indices[0][1]]
var last_layer := Global.current_project.layers[cel_indices[-1][1]]
frame_num.text = "[%s...%s]" % [cel_indices[0][0] + 1, cel_indices[-1][0] + 1]
layer_num.text = "[%s...%s]" % [first_layer.name, last_layer.name]
opacity_slider.value = first_cel.opacity * 100.0
z_index_slider.value = first_cel.z_index
user_data_text_edit.text = first_cel.user_data
get_tree().set_group(&"VisualCels", "visible", first_layer is not AudioLayer)
else:
cel_indices = []

View file

@ -33,12 +33,12 @@ layout_mode = 2
text = "1"
horizontal_alignment = 1
[node name="OpacityLabel" type="Label" parent="GridContainer"]
[node name="OpacityLabel" type="Label" parent="GridContainer" groups=["VisualCels"]]
layout_mode = 2
size_flags_horizontal = 3
text = "Opacity:"
[node name="OpacitySlider" type="TextureProgressBar" parent="GridContainer"]
[node name="OpacitySlider" type="TextureProgressBar" parent="GridContainer" groups=["VisualCels"]]
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
@ -52,12 +52,12 @@ stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("1_85pb7")
[node name="ZIndexLabel" type="Label" parent="GridContainer"]
[node name="ZIndexLabel" type="Label" parent="GridContainer" groups=["VisualCels"]]
layout_mode = 2
size_flags_horizontal = 3
text = "Z-Index:"
[node name="ZIndexSlider" type="TextureProgressBar" parent="GridContainer"]
[node name="ZIndexSlider" type="TextureProgressBar" parent="GridContainer" groups=["VisualCels"]]
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
@ -76,11 +76,13 @@ script = ExtResource("1_85pb7")
[node name="UserDataLabel" type="Label" parent="GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 0
text = "User data:"
[node name="UserDataTextEdit" type="TextEdit" parent="GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
scroll_fit_content_height = true
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]

View file

@ -29,9 +29,7 @@ func _on_visibility_changed() -> void:
play_at_frame_slider.value = first_layer.playback_frame + 1
play_at_frame_slider.max_value = project.frames.size()
user_data_text_edit.text = first_layer.user_data
for child in grid_container.get_children():
if not child.is_in_group(&"AllLayers"):
child.visible = first_layer is not AudioLayer
get_tree().set_group(&"VisualLayers", "visible", first_layer is not AudioLayer)
get_tree().set_group(&"TilemapLayers", "visible", first_layer is LayerTileMap)
get_tree().set_group(&"AudioLayers", "visible", first_layer is AudioLayer)
tileset_option_button.clear()

View file

@ -15,21 +15,21 @@ offset_right = 292.0
offset_bottom = 186.0
columns = 2
[node name="NameLabel" type="Label" parent="GridContainer" groups=["AllLayers"]]
[node name="NameLabel" type="Label" parent="GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Name:"
[node name="NameLineEdit" type="LineEdit" parent="GridContainer" groups=["AllLayers"]]
[node name="NameLineEdit" type="LineEdit" parent="GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="OpacityLabel" type="Label" parent="GridContainer"]
[node name="OpacityLabel" type="Label" parent="GridContainer" groups=["VisualLayers"]]
layout_mode = 2
size_flags_horizontal = 3
text = "Opacity:"
[node name="OpacitySlider" type="TextureProgressBar" parent="GridContainer"]
[node name="OpacitySlider" type="TextureProgressBar" parent="GridContainer" groups=["VisualLayers"]]
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
@ -42,12 +42,12 @@ stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("2_bwpwc")
[node name="BlendModeLabel" type="Label" parent="GridContainer"]
[node name="BlendModeLabel" type="Label" parent="GridContainer" groups=["VisualLayers"]]
layout_mode = 2
size_flags_horizontal = 3
text = "Blend mode:"
[node name="BlendModeOptionButton" type="OptionButton" parent="GridContainer"]
[node name="BlendModeOptionButton" type="OptionButton" parent="GridContainer" groups=["VisualLayers"]]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
@ -71,13 +71,13 @@ stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("2_bwpwc")
[node name="UserDataLabel" type="Label" parent="GridContainer" groups=["AllLayers"]]
[node name="UserDataLabel" type="Label" parent="GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 0
text = "User data:"
[node name="UserDataTextEdit" type="TextEdit" parent="GridContainer" groups=["AllLayers"]]
[node name="UserDataTextEdit" type="TextEdit" parent="GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
scroll_fit_content_height = true