mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-15 18:13:15 +00:00
Compare commits
3 commits
66f150122a
...
dd8d217dc3
Author | SHA1 | Date | |
---|---|---|---|
|
dd8d217dc3 | ||
|
17d56bb432 | ||
|
e2b54f70f7 |
14 changed files with 83 additions and 72 deletions
|
@ -2,6 +2,5 @@ disable:
|
|||
- no-elif-return
|
||||
- no-else-return
|
||||
- max-returns
|
||||
- private-method-call
|
||||
|
||||
max-file-lines: 2000
|
||||
|
|
|
@ -25,7 +25,7 @@ config/icon="res://assets/graphics/icons/icon.png"
|
|||
config/macos_native_icon="res://assets/graphics/icons/icon.icns"
|
||||
config/windows_native_icon="res://assets/graphics/icons/icon.ico"
|
||||
config/ExtensionsAPI_Version=5
|
||||
config/Pxo_Version=3
|
||||
config/Pxo_Version=4
|
||||
|
||||
[audio]
|
||||
|
||||
|
|
|
@ -278,6 +278,9 @@ func serialize() -> Dictionary:
|
|||
|
||||
func deserialize(dict: Dictionary, zip_reader: ZIPReader = null, file: FileAccess = null) -> void:
|
||||
about_to_deserialize.emit(dict)
|
||||
var pxo_version = dict.get(
|
||||
"pxo_version", ProjectSettings.get_setting("application/config/Pxo_Version")
|
||||
)
|
||||
if dict.has("size_x") and dict.has("size_y"):
|
||||
size.x = dict.size_x
|
||||
size.y = dict.size_y
|
||||
|
@ -327,8 +330,7 @@ func deserialize(dict: Dictionary, zip_reader: ZIPReader = null, file: FileAcces
|
|||
# Don't do anything with it, just read it so that the file can move on
|
||||
file.get_buffer(size.x * size.y * 4)
|
||||
cels.append(Cel3D.new(size, true))
|
||||
if dict.has("pxo_version"):
|
||||
cel["pxo_version"] = dict["pxo_version"]
|
||||
cel["pxo_version"] = pxo_version
|
||||
cels[cel_i].deserialize(cel)
|
||||
_deserialize_metadata(cels[cel_i], cel)
|
||||
cel_i += 1
|
||||
|
@ -348,7 +350,15 @@ func deserialize(dict: Dictionary, zip_reader: ZIPReader = null, file: FileAcces
|
|||
# a layer, so loop again after creating them:
|
||||
for layer_i in dict.layers.size():
|
||||
layers[layer_i].index = layer_i
|
||||
layers[layer_i].deserialize(dict.layers[layer_i])
|
||||
var layer_dict: Dictionary = dict.layers[layer_i]
|
||||
# Ensure that loaded pxo files from v1.0-v1.0.3 have the correct
|
||||
# blend mode, after the addition of the Erase mode in v1.0.4.
|
||||
if pxo_version < 4 and layer_dict.has("blend_mode"):
|
||||
var blend_mode: int = layer_dict.get("blend_mode")
|
||||
if blend_mode >= BaseLayer.BlendModes.ERASE:
|
||||
blend_mode += 1
|
||||
layer_dict["blend_mode"] = blend_mode
|
||||
layers[layer_i].deserialize(layer_dict)
|
||||
_deserialize_metadata(layers[layer_i], dict.layers[layer_i])
|
||||
if dict.has("tags"):
|
||||
for tag in dict.tags:
|
||||
|
|
|
@ -267,11 +267,12 @@ static func create_ui_for_shader_uniforms(
|
|||
var mod_button := Button.new()
|
||||
mod_button.text = "Modify"
|
||||
mod_button.pressed.connect(
|
||||
func(): _modify_texture_resource(
|
||||
_get_loaded_texture(params, u_name),
|
||||
u_name,
|
||||
_shader_update_texture.bind(value_changed, u_name)
|
||||
)
|
||||
func():
|
||||
_modify_texture_resource(
|
||||
_get_loaded_texture(params, u_name),
|
||||
u_name,
|
||||
_shader_update_texture.bind(value_changed, u_name)
|
||||
)
|
||||
)
|
||||
mod_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
mod_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://ubyatap3sylf" path="res://src/Tools/BaseDraw.tscn" id="2"]
|
||||
[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/ValueSlider.tscn" id="3"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_mvrqm"]
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_7w1wt"]
|
||||
resource_name = "rotate"
|
||||
allow_unpress = true
|
||||
|
||||
|
@ -26,14 +26,14 @@ tooltip_text = "Fills the drawn shape with color, instead of drawing a hollow sh
|
|||
mouse_default_cursor_shape = 2
|
||||
text = "Fill Shape"
|
||||
|
||||
[node name="Rotate90" parent="RotationOptions/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_mvrqm")
|
||||
[node name="Rotate90" parent="RotationOptions/GridContainer/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_7w1wt")
|
||||
|
||||
[node name="Rotate180" parent="RotationOptions/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_mvrqm")
|
||||
[node name="Rotate180" parent="RotationOptions/GridContainer/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_7w1wt")
|
||||
|
||||
[node name="Rotate270" parent="RotationOptions/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_mvrqm")
|
||||
[node name="Rotate270" parent="RotationOptions/GridContainer/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_7w1wt")
|
||||
|
||||
[node name="Brush" parent="." index="5"]
|
||||
visible = false
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
[ext_resource type="Script" path="res://src/Tools/DesignTools/Bucket.gd" id="3"]
|
||||
[ext_resource type="Script" path="res://src/UI/Nodes/ValueSlider.gd" id="4_1pngp"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="1"]
|
||||
[sub_resource type="StyleBoxFlat" id="2"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 5
|
||||
|
@ -14,7 +14,7 @@ corner_radius_bottom_right = 5
|
|||
corner_radius_bottom_left = 5
|
||||
anti_aliasing = false
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="2"]
|
||||
[sub_resource type="StyleBoxFlat" id="1"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 5
|
||||
|
@ -38,10 +38,9 @@ text = "Fill area:"
|
|||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_default_cursor_shape = 2
|
||||
item_count = 3
|
||||
selected = 0
|
||||
item_count = 3
|
||||
popup/item_0/text = "Similar area"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Similar colors"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Whole selection"
|
||||
|
@ -71,10 +70,9 @@ text = "Fill with:"
|
|||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_default_cursor_shape = 2
|
||||
item_count = 2
|
||||
selected = 0
|
||||
item_count = 2
|
||||
popup/item_0/text = "Selected color"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Pattern"
|
||||
popup/item_1/id = 1
|
||||
|
||||
|
@ -89,11 +87,11 @@ layout_mode = 2
|
|||
size_flags_horizontal = 0
|
||||
tooltip_text = "Select a brush"
|
||||
mouse_default_cursor_shape = 2
|
||||
theme_override_styles/normal = SubResource("1")
|
||||
theme_override_styles/focus = SubResource("2")
|
||||
theme_override_styles/disabled = SubResource("2")
|
||||
theme_override_styles/hover = SubResource("1")
|
||||
theme_override_styles/pressed = SubResource("1")
|
||||
theme_override_styles/disabled = SubResource("2")
|
||||
theme_override_styles/focus = SubResource("2")
|
||||
theme_override_styles/normal = SubResource("1")
|
||||
|
||||
[node name="Texture2D" type="TextureRect" parent="FillPattern/Type" index="0"]
|
||||
layout_mode = 0
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
[ext_resource type="Script" path="res://src/Tools/DesignTools/CurveTool.gd" id="2_tjnp6"]
|
||||
[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/ValueSlider.tscn" id="3_g0nav"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_ko8wf"]
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_drx24"]
|
||||
resource_name = "rotate"
|
||||
allow_unpress = true
|
||||
|
||||
|
@ -26,14 +26,14 @@ tooltip_text = "Fills the drawn shape with color, instead of drawing a hollow sh
|
|||
mouse_default_cursor_shape = 2
|
||||
text = "Fill Shape"
|
||||
|
||||
[node name="Rotate90" parent="RotationOptions/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_ko8wf")
|
||||
[node name="Rotate90" parent="RotationOptions/GridContainer/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_drx24")
|
||||
|
||||
[node name="Rotate180" parent="RotationOptions/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_ko8wf")
|
||||
[node name="Rotate180" parent="RotationOptions/GridContainer/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_drx24")
|
||||
|
||||
[node name="Rotate270" parent="RotationOptions/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_ko8wf")
|
||||
[node name="Rotate270" parent="RotationOptions/GridContainer/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_drx24")
|
||||
|
||||
[node name="Brush" parent="." index="5"]
|
||||
visible = false
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
[ext_resource type="PackedScene" uid="uid://n40lhf8hm7o1" path="res://src/Tools/BaseShapeDrawer.tscn" id="1"]
|
||||
[ext_resource type="Script" path="res://src/Tools/DesignTools/EllipseTool.gd" id="2"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_q7ttl"]
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_nq4ym"]
|
||||
resource_name = "rotate"
|
||||
allow_unpress = true
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource("1")]
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="Rotate90" parent="RotationOptions/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_q7ttl")
|
||||
[node name="Rotate90" parent="RotationOptions/GridContainer/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_nq4ym")
|
||||
|
||||
[node name="Rotate180" parent="RotationOptions/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_q7ttl")
|
||||
[node name="Rotate180" parent="RotationOptions/GridContainer/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_nq4ym")
|
||||
|
||||
[node name="Rotate270" parent="RotationOptions/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_q7ttl")
|
||||
[node name="Rotate270" parent="RotationOptions/GridContainer/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_nq4ym")
|
||||
|
|
|
@ -4,21 +4,21 @@
|
|||
[ext_resource type="Script" path="res://src/Tools/DesignTools/Eraser.gd" id="2"]
|
||||
[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/ValueSlider.tscn" id="3"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_kkavr"]
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_7k1sb"]
|
||||
resource_name = "rotate"
|
||||
allow_unpress = true
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource("1")]
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="Rotate90" parent="RotationOptions/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_kkavr")
|
||||
[node name="Rotate90" parent="RotationOptions/GridContainer/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_7k1sb")
|
||||
|
||||
[node name="Rotate180" parent="RotationOptions/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_kkavr")
|
||||
[node name="Rotate180" parent="RotationOptions/GridContainer/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_7k1sb")
|
||||
|
||||
[node name="Rotate270" parent="RotationOptions/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_kkavr")
|
||||
[node name="Rotate270" parent="RotationOptions/GridContainer/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_7k1sb")
|
||||
|
||||
[node name="OpacitySlider" parent="." index="5" instance=ExtResource("3")]
|
||||
layout_mode = 2
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
[ext_resource type="Script" path="res://src/Tools/DesignTools/LineTool.gd" id="2"]
|
||||
[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/ValueSlider.tscn" id="3"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_ko8wf"]
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_o5212"]
|
||||
resource_name = "rotate"
|
||||
allow_unpress = true
|
||||
|
||||
|
@ -20,14 +20,14 @@ suffix = "px"
|
|||
global_increment_action = "brush_size_increment"
|
||||
global_decrement_action = "brush_size_decrement"
|
||||
|
||||
[node name="Rotate90" parent="RotationOptions/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_ko8wf")
|
||||
[node name="Rotate90" parent="RotationOptions/GridContainer/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_o5212")
|
||||
|
||||
[node name="Rotate180" parent="RotationOptions/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_ko8wf")
|
||||
[node name="Rotate180" parent="RotationOptions/GridContainer/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_o5212")
|
||||
|
||||
[node name="Rotate270" parent="RotationOptions/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_ko8wf")
|
||||
[node name="Rotate270" parent="RotationOptions/GridContainer/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_o5212")
|
||||
|
||||
[node name="Brush" parent="." index="4"]
|
||||
visible = false
|
||||
|
|
|
@ -4,21 +4,21 @@
|
|||
[ext_resource type="PackedScene" path="res://src/UI/Nodes/ValueSliderV2.tscn" id="2"]
|
||||
[ext_resource type="Script" path="res://src/Tools/DesignTools/Pencil.gd" id="3"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_clato"]
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_e3rs3"]
|
||||
resource_name = "rotate"
|
||||
allow_unpress = true
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource("1")]
|
||||
script = ExtResource("3")
|
||||
|
||||
[node name="Rotate90" parent="RotationOptions/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_clato")
|
||||
[node name="Rotate90" parent="RotationOptions/GridContainer/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_e3rs3")
|
||||
|
||||
[node name="Rotate180" parent="RotationOptions/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_clato")
|
||||
[node name="Rotate180" parent="RotationOptions/GridContainer/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_e3rs3")
|
||||
|
||||
[node name="Rotate270" parent="RotationOptions/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_clato")
|
||||
[node name="Rotate270" parent="RotationOptions/GridContainer/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_e3rs3")
|
||||
|
||||
[node name="Overwrite" type="CheckBox" parent="." index="5"]
|
||||
layout_mode = 2
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
[ext_resource type="PackedScene" uid="uid://n40lhf8hm7o1" path="res://src/Tools/BaseShapeDrawer.tscn" id="1"]
|
||||
[ext_resource type="Script" path="res://src/Tools/DesignTools/RectangleTool.gd" id="2"]
|
||||
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_cyxrj"]
|
||||
[sub_resource type="ButtonGroup" id="ButtonGroup_vkkkg"]
|
||||
resource_name = "rotate"
|
||||
allow_unpress = true
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource("1")]
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="Rotate90" parent="RotationOptions/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_cyxrj")
|
||||
[node name="Rotate90" parent="RotationOptions/GridContainer/Rotate" index="0"]
|
||||
button_group = SubResource("ButtonGroup_vkkkg")
|
||||
|
||||
[node name="Rotate180" parent="RotationOptions/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_cyxrj")
|
||||
[node name="Rotate180" parent="RotationOptions/GridContainer/Rotate" index="1"]
|
||||
button_group = SubResource("ButtonGroup_vkkkg")
|
||||
|
||||
[node name="Rotate270" parent="RotationOptions/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_cyxrj")
|
||||
[node name="Rotate270" parent="RotationOptions/GridContainer/Rotate" index="2"]
|
||||
button_group = SubResource("ButtonGroup_vkkkg")
|
||||
|
|
|
@ -33,7 +33,11 @@ var layer_metadata_texture := ImageTexture.new()
|
|||
func _ready() -> void:
|
||||
material.set_shader_parameter("layers", layer_texture_array)
|
||||
material.set_shader_parameter("metadata", layer_metadata_texture)
|
||||
Global.project_switched.connect(func(): project_changed = true ; queue_redraw())
|
||||
Global.project_switched.connect(
|
||||
func():
|
||||
project_changed = true
|
||||
queue_redraw()
|
||||
)
|
||||
onion_past.type = onion_past.PAST
|
||||
onion_past.blue_red_color = Global.onion_skinning_past_color
|
||||
onion_future.type = onion_future.FUTURE
|
||||
|
|
|
@ -97,9 +97,8 @@ func _on_LayoutSettings_confirmed() -> void:
|
|||
Global.control.main_ui.layout = layout
|
||||
layout_list.add_item(layout_name.text)
|
||||
Global.layouts.sort_custom(
|
||||
func(a: DockableLayout, b: DockableLayout): return (
|
||||
a.resource_path.get_file() < b.resource_path.get_file()
|
||||
)
|
||||
func(a: DockableLayout, b: DockableLayout):
|
||||
return a.resource_path.get_file() < b.resource_path.get_file()
|
||||
)
|
||||
var layout_index := Global.layouts.find(layout)
|
||||
Global.top_menu_container.populate_layouts_submenu()
|
||||
|
|
Loading…
Add table
Reference in a new issue