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

Compare commits

..

No commits in common. "5c58562d6ba84e654de171cda6054ba2182cc5c1" and "a6060d9ff63462e2b4773b192bdcacc50eb6c59e" have entirely different histories.

17 changed files with 258 additions and 156 deletions

View file

@ -9,7 +9,6 @@ var affect: int = SELECTED_CELS
var selected_cels := Image.create(1, 1, false, Image.FORMAT_RGBA8)
var current_frame := Image.create(1, 1, false, Image.FORMAT_RGBA8)
var preview_image := Image.new()
var aspect_ratio_container: AspectRatioContainer
var preview: TextureRect
var selection_checkbox: CheckBox
var affect_option_button: OptionButton
@ -39,7 +38,7 @@ func _about_to_popup() -> void:
Global.canvas.selection.transform_content_confirm()
prepare_animator(Global.current_project)
set_and_update_preview_image(Global.current_project.current_frame)
aspect_ratio_container.ratio = float(preview_image.get_width()) / preview_image.get_height()
update_transparent_background_size()
# prepares "animate_panel.frames" according to affect
@ -132,7 +131,6 @@ func commit_action(_cel: Image, _project := Global.current_project) -> void:
func set_nodes() -> void:
aspect_ratio_container = $VBoxContainer/AspectRatioContainer
preview = $VBoxContainer/AspectRatioContainer/Preview
selection_checkbox = $VBoxContainer/OptionsContainer/SelectionCheckBox
affect_option_button = $VBoxContainer/OptionsContainer/AffectOptionButton
@ -216,6 +214,22 @@ func update_preview() -> void:
preview.texture = ImageTexture.create_from_image(preview_image)
func update_transparent_background_size() -> void:
if !preview:
return
var image_size_y := preview.size.y
var image_size_x := preview.size.x
if preview_image.get_size().x > preview_image.get_size().y:
var scale_ratio := preview_image.get_size().x / image_size_x
image_size_y = preview_image.get_size().y / scale_ratio
else:
var scale_ratio := preview_image.get_size().y / image_size_y
image_size_x = preview_image.get_size().x / scale_ratio
preview.get_node("TransparentChecker").size.x = image_size_x
preview.get_node("TransparentChecker").size.y = image_size_y
func _visibility_changed() -> void:
if visible:
return

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://dbylw5k04ulp8"]
[gd_scene load_steps=21 format=3 uid="uid://dbylw5k04ulp8"]
[ext_resource type="Theme" uid="uid://cngbvfpwjoimv" path="res://assets/themes/dark/theme.tres" id="1"]
[ext_resource type="Script" path="res://src/Main.gd" id="2"]
@ -6,14 +6,19 @@
[ext_resource type="PackedScene" uid="uid://c8dsi6ggkqa7a" path="res://src/UI/UI.tscn" id="4"]
[ext_resource type="PackedScene" uid="uid://d1jyt8wleg8ft" path="res://src/UI/Buttons/PatternsPopup.tscn" id="5"]
[ext_resource type="PackedScene" uid="uid://c5x85ysdouh4t" path="res://src/UI/Buttons/BrushesPopup.tscn" id="6"]
[ext_resource type="PackedScene" uid="uid://cfihuvhy4ocx7" path="res://src/UI/Dialogs/ImageEffects/ImageEffects.tscn" id="7"]
[ext_resource type="PackedScene" uid="uid://cltlo2whtiejd" path="res://src/UI/Dialogs/SaveSpriteHTML5.tscn" id="8"]
[ext_resource type="PackedScene" uid="uid://bs3dnnvnxyp68" path="res://src/UI/Timeline/FrameProperties.tscn" id="9"]
[ext_resource type="PackedScene" uid="uid://bcdt0pa7rojy5" path="res://src/UI/Dialogs/WindowOpacityDialog.tscn" id="10"]
[ext_resource type="PackedScene" uid="uid://d4euwo633u33b" path="res://src/UI/Dialogs/SaveSprite.tscn" id="11"]
[ext_resource type="PackedScene" uid="uid://b3aeqj2k58wdk" path="res://src/UI/Dialogs/OpenSprite.tscn" id="12"]
[ext_resource type="PackedScene" uid="uid://d1phd84dk4t5e" path="res://src/UI/Dialogs/ManageLayouts.tscn" id="13"]
[ext_resource type="PackedScene" uid="uid://c0nuukjakmai2" path="res://src/UI/Dialogs/TileModeOffsetsDialog.tscn" id="14"]
[ext_resource type="PackedScene" uid="uid://clbjfkdupw52l" path="res://src/UI/Timeline/CelProperties.tscn" id="17_ucs64"]
[ext_resource type="PackedScene" uid="uid://bnpb1aip3wdvw" path="res://src/UI/Dialogs/SplashDialog.tscn" id="27"]
[ext_resource type="PackedScene" uid="uid://btjf3lj873q1t" path="res://src/UI/Dialogs/CreateNewImage.tscn" id="28"]
[ext_resource type="PackedScene" uid="uid://b3hkjj3s6pe4x" path="res://src/Preferences/PreferencesDialog.tscn" id="32"]
[ext_resource type="PackedScene" uid="uid://w1v6plnv6ppt" path="res://src/UI/Dialogs/AboutDialog.tscn" id="34"]
[ext_resource type="PackedScene" uid="uid://clgu8wb5o6oup" path="res://src/UI/Dialogs/ExportDialog.tscn" id="39"]
[node name="Control" type="Control"]
@ -42,12 +47,16 @@ layout_mode = 2
anchors_preset = 0
mouse_filter = 2
[node name="ImageEffects" parent="Dialogs" instance=ExtResource("7")]
[node name="BrushesPopup" parent="Dialogs" instance=ExtResource("6")]
[node name="PatternsPopup" parent="Dialogs" instance=ExtResource("5")]
[node name="SplashDialog" parent="Dialogs" instance=ExtResource("27")]
[node name="CreateNewImage" parent="Dialogs" instance=ExtResource("28")]
[node name="OpenSprite" parent="Dialogs" instance=ExtResource("12")]
[node name="SaveSprite" parent="Dialogs" instance=ExtResource("11")]
@ -58,6 +67,11 @@ mouse_filter = 2
[node name="PreferencesDialog" parent="Dialogs" instance=ExtResource("32")]
[node name="ManageLayouts" parent="Dialogs" instance=ExtResource("13")]
[node name="AboutDialog" parent="Dialogs" instance=ExtResource("34")]
position = Vector2i(0, 24)
[node name="UnsavedCanvasDialog" type="ConfirmationDialog" parent="Dialogs"]
title = "Unsaved Image"
exclusive = false
@ -90,6 +104,8 @@ dialog_autowrap = true
[node name="FrameProperties" parent="Dialogs" instance=ExtResource("9")]
[node name="WindowOpacityDialog" parent="Dialogs" instance=ExtResource("10")]
[node name="TileModeOffsetsDialog" parent="Dialogs" instance=ExtResource("14")]
[node name="Extensions" type="Control" parent="."]
@ -102,6 +118,7 @@ visible = false
visible = false
[connection signal="visibility_changed" from="Dialogs/SplashDialog" to="." method="_can_draw_true"]
[connection signal="visibility_changed" from="Dialogs/CreateNewImage" to="." method="_can_draw_true"]
[connection signal="files_selected" from="Dialogs/OpenSprite" to="." method="_on_OpenSprite_files_selected"]
[connection signal="visibility_changed" from="Dialogs/OpenSprite" to="." method="_on_open_sprite_visibility_changed"]
[connection signal="file_selected" from="Dialogs/SaveSprite" to="." method="_on_SaveSprite_file_selected"]

View file

@ -14,7 +14,7 @@ var theme_button_group := ButtonGroup.new()
]
@onready var buttons_container: BoxContainer = $ThemeButtons
@onready var colors_container: BoxContainer = $ThemeColors
@onready var colors_container: BoxContainer = $ThemeColorsSpacer/ThemeColors
@onready var theme_color_preview_scene := preload("res://src/Preferences/ThemeColorPreview.tscn")
@ -62,8 +62,8 @@ func add_theme(theme: Theme) -> void:
func remove_theme(theme: Theme) -> void:
var index := themes.find(theme)
var theme_button := buttons_container.get_child(index)
var color_previews := colors_container.get_child(index)
var theme_button = buttons_container.get_child(index)
var color_previews = colors_container.get_child(index)
buttons_container.remove_child(theme_button)
theme_button.queue_free()
colors_container.remove_child(color_previews)

View file

@ -256,10 +256,16 @@ script = ExtResource("5")
layout_mode = 2
size_flags_horizontal = 3
[node name="ThemeColors" type="VBoxContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/Themes"]
[node name="ThemeColorsSpacer" type="VBoxContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/Themes"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 16
[node name="Control" type="Control" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/Themes/ThemeColorsSpacer"]
layout_mode = 2
[node name="ThemeColors" type="VBoxContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/Themes/ThemeColorsSpacer"]
layout_mode = 2
theme_override_constants/separation = 12
[node name="ButtonHeader" type="HBoxContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface"]
layout_mode = 2

View file

@ -6,7 +6,7 @@
[ext_resource type="Script" path="res://src/UI/CanvasPreviewContainer/CanvasPreviewContainer.gd" id="4"]
[ext_resource type="PackedScene" uid="uid://c546tskdu53j1" path="res://src/UI/Canvas/CanvasPreview.tscn" id="5"]
[ext_resource type="Texture2D" uid="uid://c7smxwfa8826j" path="res://assets/graphics/timeline/play.png" id="6"]
[ext_resource type="Script" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="7_o7sn3"]
[ext_resource type="PackedScene" uid="uid://cii2hpylme60s" path="res://src/UI/Nodes/CollapsibleContainer.tscn" id="7"]
[ext_resource type="Script" path="res://src/UI/Nodes/ValueSlider.gd" id="8"]
[sub_resource type="ShaderMaterial" id="1"]
@ -131,11 +131,9 @@ popup/item_0/id = 0
popup/item_1/text = "Current frame as spritesheet"
popup/item_1/id = 1
[node name="Options" type="VBoxContainer" parent="VBox/Animation/VBoxContainer"]
[node name="Options" parent="VBox/Animation/VBoxContainer" instance=ExtResource("7")]
visible = false
layout_mode = 2
theme_type_variation = &"CollapsibleContainer"
script = ExtResource("7_o7sn3")
text = "Spritesheet options"
[node name="GridContainer" type="GridContainer" parent="VBox/Animation/VBoxContainer/Options"]

View file

@ -219,8 +219,3 @@ func switch_width_height() -> void:
width_value.value_changed.connect(_on_SizeValue_value_changed)
height_value.value_changed.connect(_on_SizeValue_value_changed)
func _on_visibility_changed() -> void:
if not visible:
Global.dialog_open(false)

View file

@ -218,7 +218,6 @@ color = Color(0, 0, 0, 0)
[connection signal="about_to_popup" from="." to="." method="_on_CreateNewImage_about_to_show"]
[connection signal="confirmed" from="." to="." method="_on_CreateNewImage_confirmed"]
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
[connection signal="item_selected" from="VBoxContainer/VBoxContainer/Templates/TemplatesContainer/TemplatesOptions" to="." method="_on_TemplatesOptions_item_selected"]
[connection signal="value_changed" from="VBoxContainer/VBoxContainer/Templates/SizeContainer/VBoxContainer/WidthContainer/WidthValue" to="." method="_on_SizeValue_value_changed"]
[connection signal="value_changed" from="VBoxContainer/VBoxContainer/Templates/SizeContainer/VBoxContainer/HeightContainer/HeightValue" to="." method="_on_SizeValue_value_changed"]

View file

@ -0,0 +1,49 @@
[gd_scene load_steps=15 format=3 uid="uid://cfihuvhy4ocx7"]
[ext_resource type="PackedScene" uid="uid://c7hnynip21y6u" path="res://src/UI/Dialogs/ImageEffects/FlipImageDialog.tscn" id="1"]
[ext_resource type="PackedScene" uid="uid://bl1t33abu7kl8" path="res://src/UI/Dialogs/ImageEffects/InvertColorsDialog.tscn" id="2"]
[ext_resource type="PackedScene" uid="uid://5gqka7tkg17k" path="res://src/UI/Dialogs/ImageEffects/DesaturateDialog.tscn" id="3"]
[ext_resource type="PackedScene" uid="uid://duse1w3q7whmm" path="res://src/UI/Dialogs/ImageEffects/DropShadowDialog.tscn" id="4"]
[ext_resource type="PackedScene" uid="uid://cjd5sjemyea4a" path="res://src/UI/Dialogs/ImageEffects/GradientMapDialog.tscn" id="5"]
[ext_resource type="PackedScene" uid="uid://cnryslyvxv4ye" path="res://src/UI/Dialogs/ImageEffects/Posterize.tscn" id="6"]
[ext_resource type="PackedScene" uid="uid://q355qqjvuajs" path="res://src/UI/Dialogs/ImageEffects/OffsetImage.tscn" id="7"]
[ext_resource type="PackedScene" uid="uid://birggxam3fjnb" path="res://src/UI/Dialogs/ImageEffects/ResizeCanvas.tscn" id="8"]
[ext_resource type="PackedScene" uid="uid://bvr6j8sohxob3" path="res://src/UI/Dialogs/ImageEffects/RotateImage.tscn" id="9"]
[ext_resource type="PackedScene" uid="uid://bkr47ocij684y" path="res://src/UI/Dialogs/ImageEffects/ShaderEffect.tscn" id="10"]
[ext_resource type="PackedScene" uid="uid://oq036vr10yvk" path="res://src/UI/Dialogs/ImageEffects/HSVDialog.tscn" id="11"]
[ext_resource type="PackedScene" uid="uid://u0y5xogg636e" path="res://src/UI/Dialogs/ImageEffects/GradientDialog.tscn" id="12"]
[ext_resource type="PackedScene" uid="uid://ci2qpf6t3dyyr" path="res://src/UI/Dialogs/ImageEffects/OutlineDialog.tscn" id="13"]
[ext_resource type="PackedScene" uid="uid://omm7xmtf5kbj" path="res://src/UI/Dialogs/ImageEffects/ScaleImage.tscn" id="14"]
[node name="ImageEffects" type="Control"]
layout_mode = 3
anchors_preset = 0
mouse_filter = 2
[node name="OffsetImage" parent="." instance=ExtResource("7")]
[node name="ScaleImage" parent="." instance=ExtResource("14")]
[node name="ResizeCanvas" parent="." instance=ExtResource("8")]
[node name="RotateImage" parent="." instance=ExtResource("9")]
[node name="FlipImageDialog" parent="." instance=ExtResource("1")]
[node name="InvertColorsDialog" parent="." instance=ExtResource("2")]
[node name="DesaturateDialog" parent="." instance=ExtResource("3")]
[node name="OutlineDialog" parent="." instance=ExtResource("13")]
[node name="DropShadowDialog" parent="." instance=ExtResource("4")]
[node name="HSVDialog" parent="." instance=ExtResource("11")]
[node name="GradientDialog" parent="." instance=ExtResource("12")]
[node name="GradientMapDialog" parent="." instance=ExtResource("5")]
[node name="Posterize" parent="." instance=ExtResource("6")]
[node name="ShaderEffect" parent="." instance=ExtResource("10")]

View file

@ -10,7 +10,6 @@ var image := Image.create(1, 1, false, Image.FORMAT_RGBA8)
@onready var height_spinbox: SpinBox = $VBoxContainer/OptionsContainer/HeightValue
@onready var x_spinbox: SpinBox = $VBoxContainer/OptionsContainer/XSpinBox
@onready var y_spinbox: SpinBox = $VBoxContainer/OptionsContainer/YSpinBox
@onready var aspect_ratio_container: AspectRatioContainer = $VBoxContainer/AspectRatioContainer
@onready var preview_rect: TextureRect = $VBoxContainer/AspectRatioContainer/Preview
@ -83,7 +82,21 @@ func update_preview() -> void:
image, Rect2i(Vector2i.ZERO, Global.current_project.size), Vector2i(offset_x, offset_y)
)
preview_rect.texture = ImageTexture.create_from_image(preview_image)
aspect_ratio_container.ratio = float(preview_image.get_width()) / preview_image.get_height()
update_transparent_background_size(preview_image)
func update_transparent_background_size(preview_image: Image) -> void:
var image_size_y := preview_rect.size.y
var image_size_x := preview_rect.size.x
if preview_image.get_size().x > preview_image.get_size().y:
var scale_ratio := preview_image.get_size().x / image_size_x
image_size_y = preview_image.get_size().y / scale_ratio
else:
var scale_ratio := preview_image.get_size().y / image_size_y
image_size_x = preview_image.get_size().x / scale_ratio
preview_rect.get_node("TransparentChecker").size.x = image_size_x
preview_rect.get_node("TransparentChecker").size.y = image_size_y
func _on_visibility_changed() -> void:

View file

@ -3,7 +3,7 @@
[ext_resource type="Script" path="res://src/UI/Dialogs/ImportPreviewDialog.gd" id="1_r16hn"]
[ext_resource type="Script" path="res://src/UI/Dialogs/HelperScripts/RowColumnLines.gd" id="2_yokw4"]
[ext_resource type="Script" path="res://src/UI/Dialogs/HelperScripts/SmartSlicePreview.gd" id="3_aeccv"]
[ext_resource type="Script" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="4_7dy5o"]
[ext_resource type="PackedScene" uid="uid://cii2hpylme60s" path="res://src/UI/Nodes/CollapsibleContainer.tscn" id="4_6ispq"]
[ext_resource type="Script" path="res://src/UI/Nodes/ValueSlider.gd" id="4_nmo33"]
[node name="ImportPreviewDialog" type="ConfirmationDialog"]
@ -91,10 +91,8 @@ layout_mode = 2
size_flags_vertical = 0
mouse_default_cursor_shape = 2
[node name="ImportOptionsContainer" type="VBoxContainer" parent="VBoxContainer"]
[node name="ImportOptionsContainer" parent="VBoxContainer" instance=ExtResource("4_6ispq")]
layout_mode = 2
theme_type_variation = &"CollapsibleContainer"
script = ExtResource("4_7dy5o")
text = "Import Options"
[node name="ImportOptions" type="VBoxContainer" parent="VBoxContainer/ImportOptionsContainer"]

View file

@ -127,7 +127,6 @@ func _on_DeleteConfirmation_confirmed() -> void:
func refresh_preview() -> void:
for tab in mimic_ui.get_tabs():
mimic_ui.remove_child(tab)
tab.queue_free()
for item in Global.control.main_ui.get_tabs():
var box := TextEdit.new()
box.name = item.name

View file

@ -13,8 +13,11 @@ func _ready() -> void:
func _on_WindowOpacityDialog_about_to_show() -> void:
get_tree().root.transparent = true
get_tree().root.transparent_bg = true
slider.editable = not is_fullscreen()
fullscreen_warning.visible = not slider.editable
slider.editable = !(
(get_window().mode == Window.MODE_EXCLUSIVE_FULLSCREEN)
or (get_window().mode == Window.MODE_FULLSCREEN)
)
fullscreen_warning.visible = !slider.editable
func _recalculate_opacity() -> void:
@ -22,9 +25,13 @@ func _recalculate_opacity() -> void:
func set_window_opacity(value: float) -> void:
if is_fullscreen():
if (
(get_window().mode == Window.MODE_EXCLUSIVE_FULLSCREEN)
or (get_window().mode == Window.MODE_FULLSCREEN)
):
value = 100.0
slider.value = value
value = value / 100.0
# Find the TabContainer that has the Main Canvas panel
for container: Control in Global.control.main_ui._panel_container.get_children():
@ -37,10 +44,3 @@ func set_window_opacity(value: float) -> void:
func _on_visibility_changed() -> void:
Global.dialog_open(false)
func is_fullscreen() -> bool:
return (
(get_parent().get_window().mode == Window.MODE_EXCLUSIVE_FULLSCREEN)
or (get_parent().get_window().mode == Window.MODE_FULLSCREEN)
)

View file

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://cii2hpylme60s"]
[ext_resource type="Script" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="2"]
[node name="CollapsibleContainer" type="VBoxContainer"]
offset_right = 40.0
offset_bottom = 20.0
theme_type_variation = &"CollapsibleContainer"
script = ExtResource("2")

View file

@ -10,8 +10,6 @@ anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1013.0
offset_bottom = -510.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
@ -47,6 +45,9 @@ text = "Tracker Lines"
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
layout_mode = 2
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"]
layout_mode = 2
[node name="Content" type="ScrollContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3

View file

@ -27,7 +27,7 @@ func _set_visible(press: bool) -> void:
if press:
$TextureRect.rotation = 0
else:
$TextureRect.rotation = -PI / 2
$TextureRect.rotation = -90
content.visible = press

View file

@ -1,137 +1,169 @@
[gd_scene load_steps=6 format=3 uid="uid://calecly82t1aw"]
[gd_scene load_steps=6 format=2]
[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/ValueSlider.tscn" id="1"]
[ext_resource type="Script" path="res://src/UI/PerspectiveEditor/VanishingPoint.gd" id="2"]
[ext_resource type="Texture2D" uid="uid://ct8wn8m6x4m54" path="res://assets/graphics/misc/value_arrow.svg" id="4"]
[ext_resource type="Script" path="res://src/UI/PerspectiveEditor/PointCollapseContainer.gd" id="5"]
[ext_resource type="Script" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="5_xveuc"]
[ext_resource path="res://src/UI/Nodes/ValueSlider.tscn" type="PackedScene" id=1]
[ext_resource path="res://src/UI/PerspectiveEditor/VanishingPoint.gd" type="Script" id=2]
[ext_resource path="res://src/UI/Nodes/CollapsibleContainer.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/graphics/misc/value_arrow.svg" type="Texture2D" id=4]
[ext_resource path="res://src/UI/PerspectiveEditor/PointCollapseContainer.gd" type="Script" id=5]
[node name="VanishingPoint" type="VBoxContainer" groups=["Entry"]]
offset_right = 261.0
offset_bottom = 145.0
script = ExtResource("2")
script = ExtResource( 2 )
[node name="TitleContainer" type="HBoxContainer" parent="."]
layout_mode = 2
offset_right = 261.0
offset_bottom = 20.0
[node name="PointCollapseContainer" type="Button" parent="TitleContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
offset_right = 207.0
offset_bottom = 20.0
mouse_default_cursor_shape = 2
theme_type_variation = &"CollapsibleCheckBox"
size_flags_horizontal = 3
theme_type_variation = "CollapsibleCheckBox"
toggle_mode = true
script = ExtResource("5")
script = ExtResource( 5 )
[node name="TextureRect" type="TextureRect" parent="TitleContainer/PointCollapseContainer" groups=["UIButtons"]]
layout_mode = 0
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 2.0
offset_top = -6.0
offset_right = 14.0
offset_bottom = 6.0
pivot_offset = Vector2(6, 6)
texture = ExtResource("4")
rotation = -90.0
pivot_offset = Vector2( 6, 6 )
texture = ExtResource( 4 )
[node name="Label" type="Label" parent="TitleContainer/PointCollapseContainer"]
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 14.0
theme_type_variation = &"HeaderSmall"
valign = 1
[node name="ColorPickerButton" type="ColorPickerButton" parent="TitleContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
offset_left = 211.0
offset_right = 261.0
offset_bottom = 20.0
custom_minimum_size = Vector2( 50, 0 )
[node name="Content" type="HBoxContainer" parent="."]
unique_name_in_owner = true
layout_mode = 2
offset_top = 24.0
offset_right = 261.0
offset_bottom = 130.0
[node name="Spacer" type="Control" parent="Content"]
custom_minimum_size = Vector2(5, 0)
layout_mode = 2
offset_right = 5.0
offset_bottom = 106.0
custom_minimum_size = Vector2( 5, 0 )
[node name="BoundaryL" type="ColorRect" parent="Content"]
custom_minimum_size = Vector2(2, 0)
layout_mode = 2
offset_left = 9.0
offset_right = 11.0
offset_bottom = 106.0
custom_minimum_size = Vector2( 2, 0 )
[node name="VBoxContainer" type="VBoxContainer" parent="Content"]
layout_mode = 2
offset_left = 15.0
offset_right = 255.0
offset_bottom = 106.0
size_flags_horizontal = 3
[node name="PointInfo" type="HBoxContainer" parent="Content/VBoxContainer"]
layout_mode = 2
offset_right = 240.0
offset_bottom = 52.0
[node name="Label" type="Label" parent="Content/VBoxContainer/PointInfo"]
layout_mode = 2
offset_right = 56.0
offset_bottom = 52.0
size_flags_vertical = 5
text = "Position:"
[node name="Position" type="VBoxContainer" parent="Content/VBoxContainer/PointInfo"]
layout_mode = 2
offset_left = 60.0
offset_right = 240.0
offset_bottom = 52.0
size_flags_horizontal = 3
[node name="X" parent="Content/VBoxContainer/PointInfo/Position" instance=ExtResource("1")]
[node name="X" parent="Content/VBoxContainer/PointInfo/Position" instance=ExtResource( 1 )]
unique_name_in_owner = true
layout_mode = 2
offset_right = 180.0
step = 0.5
allow_greater = true
allow_lesser = true
prefix = "X :"
[node name="Y" parent="Content/VBoxContainer/PointInfo/Position" instance=ExtResource("1")]
[node name="Y" parent="Content/VBoxContainer/PointInfo/Position" instance=ExtResource( 1 )]
unique_name_in_owner = true
layout_mode = 2
offset_top = 28.0
offset_right = 180.0
offset_bottom = 52.0
step = 0.5
allow_greater = true
allow_lesser = true
prefix = "Y :"
[node name="CollapsibleContainer" type="VBoxContainer" parent="Content/VBoxContainer"]
layout_mode = 2
theme_type_variation = &"CollapsibleContainer"
script = ExtResource("5_xveuc")
[node name="CollapsibleContainer" parent="Content/VBoxContainer" instance=ExtResource( 3 )]
offset_top = 56.0
offset_right = 240.0
offset_bottom = 76.0
text = "Lines"
[node name="HBoxContainer" type="HBoxContainer" parent="Content/VBoxContainer/CollapsibleContainer"]
visible = false
layout_mode = 2
offset_top = 24.0
offset_right = 261.0
offset_bottom = 44.0
[node name="Spacer" type="Control" parent="Content/VBoxContainer/CollapsibleContainer/HBoxContainer"]
custom_minimum_size = Vector2(20, 0)
layout_mode = 2
offset_right = 20.0
offset_bottom = 20.0
custom_minimum_size = Vector2( 20, 0 )
[node name="VSeparator" type="VSeparator" parent="Content/VBoxContainer/CollapsibleContainer/HBoxContainer"]
layout_mode = 2
offset_right = 4.0
offset_bottom = 40.0
[node name="LinesContainer" type="VBoxContainer" parent="Content/VBoxContainer/CollapsibleContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
offset_left = 24.0
offset_right = 261.0
offset_bottom = 20.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="AddLine" type="Button" parent="Content/VBoxContainer/CollapsibleContainer/HBoxContainer/LinesContainer"]
layout_mode = 2
offset_right = 237.0
offset_bottom = 20.0
text = "Add Line"
[node name="Delete" type="Button" parent="Content/VBoxContainer"]
custom_minimum_size = Vector2(40, 0)
layout_mode = 2
offset_top = 80.0
offset_right = 240.0
offset_bottom = 100.0
custom_minimum_size = Vector2( 40, 0 )
text = "Delete Point"
[node name="BoundaryB" type="ColorRect" parent="Content/VBoxContainer"]
custom_minimum_size = Vector2(0, 2)
layout_mode = 2
offset_top = 104.0
offset_right = 240.0
offset_bottom = 106.0
custom_minimum_size = Vector2( 0, 2 )
[node name="BoundaryR" type="ColorRect" parent="Content"]
custom_minimum_size = Vector2(2, 0)
layout_mode = 2
offset_left = 259.0
offset_right = 261.0
offset_bottom = 106.0
custom_minimum_size = Vector2( 2, 0 )
[node name="HSeparator" type="HSeparator" parent="."]
layout_mode = 2
offset_top = 134.0
offset_right = 261.0
offset_bottom = 144.0
theme_override_constants/separation = 10
[connection signal="toggled" from="TitleContainer/PointCollapseContainer" to="TitleContainer/PointCollapseContainer" method="_on_Button_toggled"]

View file

@ -13,26 +13,6 @@ var recent_projects := []
var selected_layout := 0
var zen_mode := false
# Dialogs
var new_image_dialog := Dialog.new("res://src/UI/Dialogs/CreateNewImage.tscn")
var offset_image_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/OffsetImage.tscn")
var scale_image_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/ScaleImage.tscn")
var resize_canvas_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/ResizeCanvas.tscn")
var mirror_image_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/FlipImageDialog.tscn")
var rotate_image_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/RotateImage.tscn")
var invert_colors_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/InvertColorsDialog.tscn")
var desaturate_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/DesaturateDialog.tscn")
var outline_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/OutlineDialog.tscn")
var drop_shadow_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/DropShadowDialog.tscn")
var hsv_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/HSVDialog.tscn")
var gradient_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/GradientDialog.tscn")
var gradient_map_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/GradientMapDialog.tscn")
var posterize_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/Posterize.tscn")
var shader_effect_dialog := Dialog.new("res://src/UI/Dialogs/ImageEffects/ShaderEffect.tscn")
var manage_layouts_dialog := Dialog.new("res://src/UI/Dialogs/ManageLayouts.tscn")
var window_opacity_dialog := Dialog.new("res://src/UI/Dialogs/WindowOpacityDialog.tscn")
var about_dialog := Dialog.new("res://src/UI/Dialogs/AboutDialog.tscn")
@onready var main_ui := Global.control.find_child("DockableContainer") as DockableContainer
@onready var ui_elements := main_ui.get_children()
@onready var file_menu: PopupMenu = $MenuBar/File
@ -44,6 +24,8 @@ var about_dialog := Dialog.new("res://src/UI/Dialogs/AboutDialog.tscn")
@onready var help_menu: PopupMenu = $MenuBar/Help
@onready var greyscale_vision: ColorRect = main_ui.find_child("GreyscaleVision")
@onready var new_image_dialog: ConfirmationDialog = Global.control.find_child("CreateNewImage")
@onready var window_opacity_dialog: AcceptDialog = Global.control.find_child("WindowOpacityDialog")
@onready var tile_mode_submenu := PopupMenu.new()
@onready var snap_to_submenu := PopupMenu.new()
@onready var panels_submenu := PopupMenu.new()
@ -51,30 +33,6 @@ var about_dialog := Dialog.new("res://src/UI/Dialogs/AboutDialog.tscn")
@onready var recent_projects_submenu := PopupMenu.new()
class Dialog:
## This class is used to help with lazy loading dialog scenes in order to
## reduce Pixelorama's initial loading time, by only loading each dialog
## scene when it's actually needed.
var scene_path := ""
var node: Window
func _init(_scene_path: String) -> void:
scene_path = _scene_path
func popup(dialog_size := Vector2i.ZERO) -> void:
if not is_instance_valid(node):
var scene := load(scene_path)
if not scene is PackedScene:
return
node = scene.instantiate()
if not is_instance_valid(node):
return
Global.control.get_node("Dialogs").add_child(node)
node.popup_centered(dialog_size)
var is_file_dialog := node is FileDialog
Global.dialog_open(true, is_file_dialog)
func _ready() -> void:
_setup_file_menu()
_setup_edit_menu()
@ -425,7 +383,7 @@ func _popup_dialog(dialog: Window, dialog_size := Vector2i.ZERO) -> void:
func file_menu_id_pressed(id: int) -> void:
match id:
Global.FileMenu.NEW:
new_image_dialog.popup()
_popup_dialog(new_image_dialog)
Global.FileMenu.OPEN:
_open_project_file()
Global.FileMenu.OPEN_LAST_PROJECT:
@ -508,7 +466,7 @@ func edit_menu_id_pressed(id: int) -> void:
func view_menu_id_pressed(id: int) -> void:
match id:
Global.ViewMenu.TILE_MODE_OFFSETS:
_popup_dialog(Global.tile_mode_offset_dialog)
_popup_dialog(Global.control.get_node("Dialogs/TileModeOffsetsDialog"))
Global.ViewMenu.GREYSCALE_VIEW:
_toggle_greyscale_view()
Global.ViewMenu.MIRROR_VIEW:
@ -534,7 +492,7 @@ func view_menu_id_pressed(id: int) -> void:
func window_menu_id_pressed(id: int) -> void:
match id:
Global.WindowMenu.WINDOW_OPACITY:
window_opacity_dialog.popup()
_popup_dialog(window_opacity_dialog)
Global.WindowMenu.MOVABLE_PANELS:
main_ui.tabs_visible = !main_ui.tabs_visible
window_menu.set_item_checked(id, main_ui.tabs_visible)
@ -582,7 +540,7 @@ func _panels_submenu_id_pressed(id: int) -> void:
func _layouts_submenu_id_pressed(id: int) -> void:
if id == 0:
manage_layouts_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ManageLayouts"))
else:
set_layout(id - 1)
@ -682,49 +640,63 @@ func _toggle_zen_mode() -> void:
func _toggle_fullscreen() -> void:
var is_fullscreen := (
get_window().mode = (
Window.MODE_EXCLUSIVE_FULLSCREEN
if (!(
(get_window().mode == Window.MODE_EXCLUSIVE_FULLSCREEN)
or (get_window().mode == Window.MODE_FULLSCREEN)
))
else Window.MODE_WINDOWED
)
window_menu.set_item_checked(
Global.WindowMenu.FULLSCREEN_MODE,
(
(get_window().mode == Window.MODE_EXCLUSIVE_FULLSCREEN)
or (get_window().mode == Window.MODE_FULLSCREEN)
)
)
if (
(get_window().mode == Window.MODE_EXCLUSIVE_FULLSCREEN)
or (get_window().mode == Window.MODE_FULLSCREEN)
)
get_window().mode = Window.MODE_EXCLUSIVE_FULLSCREEN if !is_fullscreen else Window.MODE_WINDOWED
is_fullscreen = not is_fullscreen
window_menu.set_item_checked(Global.WindowMenu.FULLSCREEN_MODE, is_fullscreen)
): # If window is fullscreen then reset transparency
window_opacity_dialog.set_window_opacity(100.0)
func image_menu_id_pressed(id: int) -> void:
match id:
Global.ImageMenu.SCALE_IMAGE:
scale_image_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/ScaleImage"))
Global.ImageMenu.OFFSET_IMAGE:
offset_image_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/OffsetImage"))
Global.ImageMenu.CROP_TO_SELECTION:
DrawingAlgos.crop_to_selection()
Global.ImageMenu.CROP_TO_CONTENT:
DrawingAlgos.crop_to_content()
Global.ImageMenu.RESIZE_CANVAS:
resize_canvas_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/ResizeCanvas"))
Global.ImageMenu.FLIP:
mirror_image_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/FlipImageDialog"))
Global.ImageMenu.ROTATE:
rotate_image_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/RotateImage"))
Global.ImageMenu.INVERT_COLORS:
invert_colors_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/InvertColorsDialog"))
Global.ImageMenu.DESATURATION:
desaturate_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/DesaturateDialog"))
Global.ImageMenu.OUTLINE:
outline_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/OutlineDialog"))
Global.ImageMenu.DROP_SHADOW:
drop_shadow_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/DropShadowDialog"))
Global.ImageMenu.HSV:
hsv_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/HSVDialog"))
Global.ImageMenu.GRADIENT:
gradient_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/GradientDialog"))
Global.ImageMenu.GRADIENT_MAP:
gradient_map_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/GradientMapDialog"))
Global.ImageMenu.POSTERIZE:
posterize_dialog.popup()
#Global.ImageMenu.SHADER:
#shader_effect_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/ImageEffects/Posterize"))
# Global.ImageMenu.SHADER:
# _popup_dialog(Global.control.get_node("Dialogs/ImageEffects/ShaderEffect"))
_:
_handle_metadata(id, image_menu)
@ -760,7 +732,7 @@ func help_menu_id_pressed(id: int) -> void:
Global.HelpMenu.CHANGELOG:
OS.shell_open(CHANGELOG_URL)
Global.HelpMenu.ABOUT_PIXELORAMA:
about_dialog.popup()
_popup_dialog(Global.control.get_node("Dialogs/AboutDialog"))
Global.HelpMenu.SUPPORT_PIXELORAMA:
OS.shell_open(SUPPORT_URL)
_: