Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View Export dimensions #686

Merged
merged 20 commits into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/UI/Dialogs/ExportDialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func show_tab() -> void:
animation_options_direction.selected = Export.direction
animation_options.show()
set_preview()
update_dimensions_label()
tabs.current_tab = Export.current_tab


Expand Down Expand Up @@ -208,6 +209,14 @@ func create_frame_tag_list() -> void:
spritesheet_frames.add_item(item.name)


func update_dimensions_label():
var dimension_label: Label = $VBoxContainer/Dimensions/DimensionLabel
dimension_label.text = "Export Dimensions : "
if Export.processed_images.size() > 0:
var new_size: Vector2 = Export.processed_images[0].get_size() * (Export.resize / 100.0)
dimension_label.text += str(new_size.x, "x", new_size.y)


func open_path_validation_alert_popup(path_or_name: int = -1) -> void:
# 0 is invalid path, 1 is invalid name
if path_or_name == 0:
Expand Down Expand Up @@ -286,12 +295,14 @@ func _on_Orientation_item_selected(id: int) -> void:
spritesheet_lines_count_label.text = "Rows:"
spritesheet_lines_count.value = Export.frames_divided_by_spritesheet_lines()
Export.process_spritesheet()
update_dimensions_label()
set_preview()


func _on_LinesCount_value_changed(value: float) -> void:
Export.lines_count = value
Export.process_spritesheet()
update_dimensions_label()
set_preview()


Expand All @@ -315,6 +326,7 @@ func _on_Direction_item_selected(id: int) -> void:

func _on_Resize_value_changed(value: float) -> void:
Export.resize = value
update_dimensions_label()


func _on_Interpolation_item_selected(id: int) -> void:
Expand Down
47 changes: 32 additions & 15 deletions src/UI/Dialogs/ExportDialog.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ margin_right = 524.0
margin_bottom = 494.0
rect_min_size = Vector2( 330, 0 )
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Tabs" type="Tabs" parent="VBoxContainer"]
margin_right = 516.0
Expand All @@ -45,7 +42,7 @@ text = "Preview:"
[node name="PreviewPanel" type="Panel" parent="VBoxContainer"]
margin_top = 54.0
margin_right = 516.0
margin_bottom = 278.0
margin_bottom = 260.0
size_flags_horizontal = 3
size_flags_vertical = 3

Expand All @@ -66,7 +63,7 @@ __meta__ = {

[node name="Previews" type="GridContainer" parent="VBoxContainer/PreviewPanel/PreviewScroll"]
margin_right = 516.0
margin_bottom = 224.0
margin_bottom = 206.0
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 3
Expand Down Expand Up @@ -101,9 +98,9 @@ rounded = true
align = 2

[node name="SpritesheetOptions" type="VBoxContainer" parent="VBoxContainer"]
margin_top = 282.0
margin_top = 264.0
margin_right = 516.0
margin_bottom = 330.0
margin_bottom = 312.0

[node name="Frames" type="HBoxContainer" parent="VBoxContainer/SpritesheetOptions"]
margin_right = 516.0
Expand Down Expand Up @@ -169,9 +166,9 @@ value = 1.0
align = 2

[node name="AnimationOptions" type="VBoxContainer" parent="VBoxContainer"]
margin_top = 334.0
margin_top = 316.0
margin_right = 516.0
margin_bottom = 386.0
margin_bottom = 368.0

[node name="AnimationType" type="OptionButton" parent="VBoxContainer/AnimationOptions"]
margin_right = 516.0
Expand Down Expand Up @@ -219,14 +216,14 @@ __meta__ = {
}

[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"]
margin_top = 390.0
margin_top = 372.0
margin_right = 516.0
margin_bottom = 394.0
margin_bottom = 376.0

[node name="Options" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 398.0
margin_top = 380.0
margin_right = 516.0
margin_bottom = 422.0
margin_bottom = 404.0

[node name="ResizeLabel" type="Label" parent="VBoxContainer/Options"]
margin_top = 5.0
Expand Down Expand Up @@ -269,6 +266,25 @@ align = 2
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

[node name="Dimensions" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 408.0
margin_right = 516.0
margin_bottom = 422.0

[node name="DimensionLabel" type="Label" parent="VBoxContainer/Dimensions"]
margin_right = 256.0
margin_bottom = 14.0
size_flags_horizontal = 3
text = "Export Dimensions : "
align = 1
valign = 1

[node name="Spacer" type="Control" parent="VBoxContainer/Dimensions"]
margin_left = 260.0
margin_right = 516.0
margin_bottom = 14.0
size_flags_horizontal = 3

[node name="HSeparator3" type="HSeparator" parent="VBoxContainer"]
margin_top = 426.0
margin_right = 516.0
Expand Down Expand Up @@ -345,8 +361,8 @@ window_title = "Open a Directory"
resizable = true
mode = 2
access = 2
current_dir = "/Users"
current_path = "/Users/"
current_dir = "/home/variable/Documents/Godot/Godot projects/Pixelorama-play_improvements"
current_path = "/home/variable/Documents/Godot/Godot projects/Pixelorama-play_improvements/"

[node name="PathValidationAlert" type="AcceptDialog" parent="Popups"]
margin_left = 8.0
Expand Down Expand Up @@ -411,6 +427,7 @@ __meta__ = {
__meta__ = {
"_editor_description_": "Timer to advance animation frames in animation preview."
}

[connection signal="about_to_show" from="." to="." method="_on_ExportDialog_about_to_show"]
[connection signal="confirmed" from="." to="." method="_on_ExportDialog_confirmed"]
[connection signal="custom_action" from="." to="." method="_on_ExportDialog_custom_action"]
Expand Down