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

Merged "Scripts" and "Prefabs" folders into "src"

Made a new "src" folder that will contain the source code files, like all the GDScript and scene files. Please read this for more details: https://www.gdquest.com/docs/guidelines/best-practices/godot-gdscript/

It made no sense to keep scenes separate from their scripts. More file organizing will follow soon.
This commit is contained in:
OverloadedOrama 2020-05-01 22:17:05 +03:00
parent 5a54235604
commit 646fc19a70
63 changed files with 135 additions and 113 deletions

View file

@ -12,32 +12,32 @@ _global_script_classes=[ {
"base": "Node2D", "base": "Node2D",
"class": "Canvas", "class": "Canvas",
"language": "GDScript", "language": "GDScript",
"path": "res://Scripts/Canvas.gd" "path": "res://src/Canvas.gd"
}, { }, {
"base": "Line2D", "base": "Line2D",
"class": "Guide", "class": "Guide",
"language": "GDScript", "language": "GDScript",
"path": "res://Scripts/Rulers/Guides.gd" "path": "res://src/Rulers/Guides.gd"
}, { }, {
"base": "Button", "base": "Button",
"class": "LayerContainer", "class": "LayerButton",
"language": "GDScript", "language": "GDScript",
"path": "res://Scripts/LayerContainer.gd" "path": "res://src/LayerButton.gd"
}, { }, {
"base": "Reference", "base": "Reference",
"class": "Palette", "class": "Palette",
"language": "GDScript", "language": "GDScript",
"path": "res://Scripts/Palette/Palette.gd" "path": "res://src/Palette/Palette.gd"
}, { }, {
"base": "Reference", "base": "Reference",
"class": "PaletteColor", "class": "PaletteColor",
"language": "GDScript", "language": "GDScript",
"path": "res://Scripts/Palette/PaletteColor.gd" "path": "res://src/Palette/PaletteColor.gd"
} ] } ]
_global_script_class_icons={ _global_script_class_icons={
"Canvas": "", "Canvas": "",
"Guide": "", "Guide": "",
"LayerContainer": "", "LayerButton": "",
"Palette": "", "Palette": "",
"PaletteColor": "" "PaletteColor": ""
} }
@ -46,7 +46,7 @@ _global_script_class_icons={
config/name="Pixelorama" config/name="Pixelorama"
config/description="A free & open-source 2D sprite editor" config/description="A free & open-source 2D sprite editor"
run/main_scene="res://Main.tscn" run/main_scene="res://src/Main.tscn"
run/low_processor_mode=true run/low_processor_mode=true
boot_splash/image="res://splash.png" boot_splash/image="res://splash.png"
boot_splash/bg_color=Color( 0.145098, 0.145098, 0.164706, 1 ) boot_splash/bg_color=Color( 0.145098, 0.145098, 0.164706, 1 )
@ -57,9 +57,9 @@ config/Version="v0.7"
[autoload] [autoload]
Global="*res://Scripts/Global.gd" Global="*res://src/Autoload/Global.gd"
Import="*res://Scripts/Import.gd" Import="*res://src/Autoload/Import.gd"
OpenSave="*res://Scripts/OpenSave.gd" OpenSave="*res://src/Autoload/OpenSave.gd"
[debug] [debug]

View file

@ -22,7 +22,7 @@ func _h_scroll_changed(value : float) -> void:
func add_frame() -> void: func add_frame() -> void:
var new_canvas : Canvas = load("res://Prefabs/Canvas.tscn").instance() var new_canvas : Canvas = load("res://src/Canvas.tscn").instance()
new_canvas.size = Global.canvas.size new_canvas.size = Global.canvas.size
new_canvas.frame = Global.canvases.size() new_canvas.frame = Global.canvases.size()
@ -119,7 +119,7 @@ func _on_CopyFrame_pressed(frame := -1) -> void:
frame = Global.current_frame frame = Global.current_frame
var canvas : Canvas = Global.canvases[frame] var canvas : Canvas = Global.canvases[frame]
var new_canvas : Canvas = load("res://Prefabs/Canvas.tscn").instance() var new_canvas : Canvas = load("res://src/Canvas.tscn").instance()
new_canvas.size = Global.canvas.size new_canvas.size = Global.canvas.size
new_canvas.frame = Global.canvases.size() new_canvas.frame = Global.canvases.size()

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=51 format=2] [gd_scene load_steps=51 format=2]
[ext_resource path="res://Scripts/AnimationTimeline.gd" type="Script" id=1] [ext_resource path="res://src/AnimationTimeline.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer.png" type="Texture" id=2] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer_Hover.png" type="Texture" id=3] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer_Hover.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer.png" type="Texture" id=4] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer.png" type="Texture" id=4]
@ -17,7 +17,7 @@
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down.png" type="Texture" id=15] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down.png" type="Texture" id=15]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Hover.png" type="Texture" id=16] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Hover.png" type="Texture" id=16]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Disabled.png" type="Texture" id=17] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Disabled.png" type="Texture" id=17]
[ext_resource path="res://Prefabs/LayerContainer.tscn" type="PackedScene" id=18] [ext_resource path="res://src/LayerButton.tscn" type="PackedScene" id=18]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/new_frame.png" type="Texture" id=19] [ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/new_frame.png" type="Texture" id=19]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/remove_frame.png" type="Texture" id=20] [ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/remove_frame.png" type="Texture" id=20]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/go_to_first_frame.png" type="Texture" id=21] [ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/go_to_first_frame.png" type="Texture" id=21]
@ -31,7 +31,11 @@
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/onion_skinning_off.png" type="Texture" id=29] [ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/onion_skinning_off.png" type="Texture" id=29]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/expandable.png" type="Texture" id=30] [ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/expandable.png" type="Texture" id=30]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/loop.png" type="Texture" id=31] [ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/loop.png" type="Texture" id=31]
[ext_resource path="res://Prefabs/Dialogs/FrameTagDialog.tscn" type="PackedScene" id=42] [ext_resource path="res://src/Dialogs/FrameTagDialog.tscn" type="PackedScene" id=42]
[sub_resource type="InputEventKey" id=1] [sub_resource type="InputEventKey" id=1]
control = true control = true

View file

@ -7,7 +7,7 @@ enum Brush_Types {PIXEL, CIRCLE, FILLED_CIRCLE, FILE, RANDOM_FILE, CUSTOM}
var root_directory := "." var root_directory := "."
var window_title := "" setget title_changed # Why doesn't Godot have get_window_title()? var window_title := "" setget title_changed # Why doesn't Godot have get_window_title()?
var config_cache := ConfigFile.new() var config_cache := ConfigFile.new()
var XDGDataPaths = preload("res://Scripts/XDGDataPaths.gd") var XDGDataPaths = preload("res://src/XDGDataPaths.gd")
var directory_module : Node var directory_module : Node
# Stuff for arrowkey-based canvas movements nyaa ^.^ # Stuff for arrowkey-based canvas movements nyaa ^.^
@ -412,7 +412,7 @@ func find_node_by_name(root, node_name) -> Node:
func notification_label(text : String) -> void: func notification_label(text : String) -> void:
var notification : Label = load("res://Prefabs/NotificationLabel.tscn").instance() var notification : Label = load("res://src/NotificationLabel.tscn").instance()
notification.text = tr(text) notification.text = tr(text)
notification.rect_position = Vector2(240, OS.window_size.y - animation_timeline.rect_size.y - 20) notification.rect_position = Vector2(240, OS.window_size.y - animation_timeline.rect_size.y - 20)
notification.theme = control.theme notification.theme = control.theme
@ -525,12 +525,12 @@ func canvases_changed(value : Array) -> void:
frame_ids.add_child(label) frame_ids.add_child(label)
for i in range(layers.size() - 1, -1, -1): for i in range(layers.size() - 1, -1, -1):
var frame_button = load("res://Prefabs/FrameButton.tscn").instance() var cel_button = load("res://src/CelButton.tscn").instance()
frame_button.frame = j cel_button.frame = j
frame_button.layer = i cel_button.layer = i
frame_button.get_child(0).texture = Global.canvases[j].layers[i][1] cel_button.get_child(0).texture = Global.canvases[j].layers[i][1]
layers[i][3].add_child(frame_button) layers[i][3].add_child(cel_button)
# This is useful in case tagged frames get deleted DURING the animation is playing # This is useful in case tagged frames get deleted DURING the animation is playing
# otherwise, this code is useless in this context, since these values are being set # otherwise, this code is useless in this context, since these values are being set
@ -581,7 +581,7 @@ func layers_changed(value : Array) -> void:
frames_container.remove_child(container) frames_container.remove_child(container)
for i in range(layers.size() - 1, -1, -1): for i in range(layers.size() - 1, -1, -1):
var layer_container = load("res://Prefabs/LayerContainer.tscn").instance() var layer_container = load("res://src/LayerButton.tscn").instance()
layer_container.i = i layer_container.i = i
if !layers[i][0]: if !layers[i][0]:
layers[i][0] = tr("Layer") + " %s" % i layers[i][0] = tr("Layer") + " %s" % i
@ -592,12 +592,12 @@ func layers_changed(value : Array) -> void:
frames_container.add_child(layers[i][3]) frames_container.add_child(layers[i][3])
for j in range(canvases.size()): for j in range(canvases.size()):
var frame_button = load("res://Prefabs/FrameButton.tscn").instance() var cel_button = load("res://src/CelButton.tscn").instance()
frame_button.frame = j cel_button.frame = j
frame_button.layer = i cel_button.layer = i
frame_button.get_child(0).texture = Global.canvases[j].layers[i][1] cel_button.get_child(0).texture = Global.canvases[j].layers[i][1]
layers[i][3].add_child(frame_button) layers[i][3].add_child(cel_button)
var layer_button = layers_container.get_child(layers_container.get_child_count() - 1 - current_layer) var layer_button = layers_container.get_child(layers_container.get_child_count() - 1 - current_layer)
layer_button.pressed = true layer_button.pressed = true
@ -698,7 +698,7 @@ func animation_tags_changed(value : Array) -> void:
child.queue_free() child.queue_free()
for tag in animation_tags: for tag in animation_tags:
var tag_c : Container = load("res://Prefabs/AnimationTag.tscn").instance() var tag_c : Container = load("res://src/AnimationTag.tscn").instance()
tag_container.add_child(tag_c) tag_container.add_child(tag_c)
var tag_position := tag_container.get_child_count() - 1 var tag_position := tag_container.get_child_count() - 1
tag_container.move_child(tag_c, tag_position) tag_container.move_child(tag_c, tag_position)
@ -807,7 +807,7 @@ Hold %s to make a line""") % [InputMap.get_action_list("left_eraser_tool")[0].as
func create_brush_button(brush_img : Image, brush_type := Brush_Types.CUSTOM, hint_tooltip := "") -> void: func create_brush_button(brush_img : Image, brush_type := Brush_Types.CUSTOM, hint_tooltip := "") -> void:
var brush_container var brush_container
var brush_button = load("res://Prefabs/BrushButton.tscn").instance() var brush_button = load("res://src/BrushButton.tscn").instance()
brush_button.brush_type = brush_type brush_button.brush_type = brush_type
brush_button.custom_brush_index = custom_brushes.size() - 1 brush_button.custom_brush_index = custom_brushes.size() - 1
if brush_type == Brush_Types.FILE || brush_type == Brush_Types.RANDOM_FILE: if brush_type == Brush_Types.FILE || brush_type == Brush_Types.RANDOM_FILE:

View file

@ -237,7 +237,7 @@ func import_patterns(priority_ordered_search_path: Array) -> void:
image.convert(Image.FORMAT_RGBA8) image.convert(Image.FORMAT_RGBA8)
Global.patterns.append(image) Global.patterns.append(image)
var pattern_button : BaseButton = load("res://Prefabs/PatternButton.tscn").instance() var pattern_button : BaseButton = load("res://src/PatternButton.tscn").instance()
pattern_button.image = image pattern_button.image = image
var pattern_tex := ImageTexture.new() var pattern_tex := ImageTexture.new()
pattern_tex.create_from_image(image, 0) pattern_tex.create_from_image(image, 0)

View file

@ -55,7 +55,7 @@ func open_pxo_file(path : String, untitled_backup : bool = false) -> void:
var frame_line := file.get_line() var frame_line := file.get_line()
Global.clear_canvases() Global.clear_canvases()
while frame_line == "--": # Load frames while frame_line == "--": # Load frames
var canvas : Canvas = load("res://Prefabs/Canvas.tscn").instance() var canvas : Canvas = load("res://src/Canvas.tscn").instance()
Global.canvas = canvas Global.canvas = canvas
var width := file.get_16() var width := file.get_16()
var height := file.get_16() var height := file.get_16()

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=5 format=2]
[ext_resource path="res://Assets/Graphics/Brush_button.png" type="Texture" id=1] [ext_resource path="res://Assets/Graphics/Brush_button.png" type="Texture" id=1]
[ext_resource path="res://Scripts/BrushButton.gd" type="Script" id=2] [ext_resource path="res://src/BrushButton.gd" type="Script" id=2]
[sub_resource type="Image" id=3] [sub_resource type="Image" id=3]
data = { data = {

View file

@ -605,7 +605,7 @@ func update_texture(layer_index : int) -> void:
layers[layer_index][1].create_from_image(layers[layer_index][0], 0) layers[layer_index][1].create_from_image(layers[layer_index][0], 0)
var frame_texture_rect : TextureRect var frame_texture_rect : TextureRect
frame_texture_rect = Global.find_node_by_name(Global.layers[layer_index][3].get_child(frame),"FrameTexture") frame_texture_rect = Global.find_node_by_name(Global.layers[layer_index][3].get_child(frame), "CelTexture")
frame_texture_rect.texture = layers[layer_index][1] frame_texture_rect.texture = layers[layer_index][1]

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/Canvas.gd" type="Script" id=1] [ext_resource path="res://src/Canvas.gd" type="Script" id=1]
[node name="Canvas" type="Node2D"] [node name="Canvas" type="Node2D"]
script = ExtResource( 1 ) script = ExtResource( 1 )

View file

@ -18,7 +18,7 @@ func _ready() -> void:
popup_menu.set_item_metadata(4, "Link Cel") popup_menu.set_item_metadata(4, "Link Cel")
func _on_FrameButton_pressed() -> void: func _on_CelButton_pressed() -> void:
if Input.is_action_just_released("left_mouse"): if Input.is_action_just_released("left_mouse"):
Global.current_frame = frame Global.current_frame = frame
Global.current_layer = layer Global.current_layer = layer
@ -118,3 +118,4 @@ func change_frame_order(rate : int) -> void:
Global.undo_redo.add_undo_method(Global, "undo", [Global.canvases[frame]]) Global.undo_redo.add_undo_method(Global, "undo", [Global.canvases[frame]])
Global.undo_redo.add_do_method(Global, "redo", [Global.canvases[frame]]) Global.undo_redo.add_do_method(Global, "redo", [Global.canvases[frame]])
Global.undo_redo.commit_action() Global.undo_redo.commit_action()

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/FrameButton.gd" type="Script" id=1] [ext_resource path="res://src/CelButton.gd" type="Script" id=1]
[node name="FrameButton" type="Button"] [node name="CelButton" type="Button"]
margin_top = 18.0 margin_top = 18.0
margin_right = 36.0 margin_right = 36.0
margin_bottom = 54.0 margin_bottom = 54.0
@ -17,7 +17,7 @@ __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="FrameTexture" type="TextureRect" parent="."] [node name="CelTexture" type="TextureRect" parent="."]
margin_left = 2.0 margin_left = 2.0
margin_top = 1.78536 margin_top = 1.78536
margin_right = 34.0 margin_right = 34.0
@ -43,5 +43,5 @@ color = Color( 0.0627451, 0.741176, 0.215686, 1 )
invert_enable = true invert_enable = true
invert_border = 1.0 invert_border = 1.0
polygon = PoolVector2Array( 0, 0, 36, 0, 36, 36, 0, 36 ) polygon = PoolVector2Array( 0, 0, 36, 0, 36, 36, 0, 36 )
[connection signal="pressed" from="." to="." method="_on_FrameButton_pressed"] [connection signal="pressed" from="." to="." method="_on_CelButton_pressed"]
[connection signal="id_pressed" from="PopupMenu" to="." method="_on_PopupMenu_id_pressed"] [connection signal="id_pressed" from="PopupMenu" to="." method="_on_PopupMenu_id_pressed"]

View file

@ -1,11 +1,12 @@
[gd_scene load_steps=6 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://Scripts/Dialogs/AboutDialog.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/AboutDialog.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/icon_64x64.png" type="Texture" id=2] [ext_resource path="res://Assets/Graphics/icon_64x64.png" type="Texture" id=2]
[ext_resource path="res://Assets/Fonts/Roboto-Italic.tres" type="DynamicFont" id=3] [ext_resource path="res://Assets/Fonts/Roboto-Italic.tres" type="DynamicFont" id=3]
[ext_resource path="res://Assets/Graphics/orama_64x64.png" type="Texture" id=4] [ext_resource path="res://Assets/Graphics/orama_64x64.png" type="Texture" id=4]
[ext_resource path="res://Assets/Fonts/Roboto-Small.tres" type="DynamicFont" id=5] [ext_resource path="res://Assets/Fonts/Roboto-Small.tres" type="DynamicFont" id=5]
[node name="AboutDialog" type="WindowDialog"] [node name="AboutDialog" type="WindowDialog"]
margin_right = 512.0 margin_right = 512.0
margin_bottom = 288.0 margin_bottom = 288.0

View file

@ -77,7 +77,7 @@ func _on_CreateNewImage_confirmed() -> void:
# Store [Layer name (0), Layer visibility boolean (1), Layer lock boolean (2), Frame container (3), # Store [Layer name (0), Layer visibility boolean (1), Layer lock boolean (2), Frame container (3),
# will new frames be linked boolean (4), Array of linked frames (5)] # will new frames be linked boolean (4), Array of linked frames (5)]
Global.layers.append([tr("Layer") + " 0", true, false, HBoxContainer.new(), false, []]) Global.layers.append([tr("Layer") + " 0", true, false, HBoxContainer.new(), false, []])
Global.canvas = load("res://Prefabs/Canvas.tscn").instance() Global.canvas = load("res://src/Canvas.tscn").instance()
Global.canvas.size = Vector2(width, height).floor() Global.canvas.size = Vector2(width, height).floor()
Global.canvases.append(Global.canvas) Global.canvases.append(Global.canvas)

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/Dialogs/CreateNewImage.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/CreateNewImage.gd" type="Script" id=1]
[node name="CreateNewImage" type="ConfirmationDialog"] [node name="CreateNewImage" type="ConfirmationDialog"]
margin_right = 300.0 margin_right = 300.0

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://Scripts/Dialogs/ExportDialog.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/ExportDialog.gd" type="Script" id=1]
[ext_resource path="res://addons/godot-gifexporter/src/GifExporter.gd" type="Script" id=2] [ext_resource path="res://addons/godot-gifexporter/src/GifExporter.gd" type="Script" id=2]
[node name="ExportDialog" type="AcceptDialog"] [node name="ExportDialog" type="AcceptDialog"]
margin_right = 532.0 margin_right = 532.0
margin_bottom = 530.0 margin_bottom = 530.0

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://Scripts/Dialogs/FrameTagDialog.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/FrameTagDialog.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/new_frame.png" type="Texture" id=2] [ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/new_frame.png" type="Texture" id=2]
[node name="FrameTagDialog" type="AcceptDialog"] [node name="FrameTagDialog" type="AcceptDialog"]
margin_right = 83.0 margin_right = 83.0
margin_bottom = 58.0 margin_bottom = 58.0

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/Dialogs/HSVDialog.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/HSVDialog.gd" type="Script" id=1]
[node name="HSVDialog" type="WindowDialog"] [node name="HSVDialog" type="WindowDialog"]
margin_left = 1.0 margin_left = 1.0

View file

@ -54,7 +54,7 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void:
Global.error_dialog.popup_centered() Global.error_dialog.popup_centered()
continue continue
var canvas : Canvas = load("res://Prefabs/Canvas.tscn").instance() var canvas : Canvas = load("res://src/Canvas.tscn").instance()
canvas.size = image.get_size() canvas.size = image.get_size()
image.convert(Image.FORMAT_RGBA8) image.convert(Image.FORMAT_RGBA8)
image.lock() image.lock()
@ -106,7 +106,7 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void:
var frame_height := image.get_size().y / spritesheet_vertical var frame_height := image.get_size().y / spritesheet_vertical
for yy in range(spritesheet_vertical): for yy in range(spritesheet_vertical):
for xx in range(spritesheet_horizontal): for xx in range(spritesheet_horizontal):
var canvas : Canvas = load("res://Prefabs/Canvas.tscn").instance() var canvas : Canvas = load("res://src/Canvas.tscn").instance()
var cropped_image := Image.new() var cropped_image := Image.new()
cropped_image = image.get_rect(Rect2(frame_width * xx, frame_height * yy, frame_width, frame_height)) cropped_image = image.get_rect(Rect2(frame_width * xx, frame_height * yy, frame_width, frame_height))
canvas.size = cropped_image.get_size() canvas.size = cropped_image.get_size()

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/Dialogs/ImportSprites.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/ImportSprites.gd" type="Script" id=1]
[node name="ImportSprites" type="FileDialog"] [node name="ImportSprites" type="FileDialog"]
margin_right = 515.0 margin_right = 515.0

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/Dialogs/OutlineDialog.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/OutlineDialog.gd" type="Script" id=1]
[node name="OutlineDialog" type="ConfirmationDialog"] [node name="OutlineDialog" type="ConfirmationDialog"]
visible = true visible = true

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://Scripts/Dialogs/PreferencesDialog.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/PreferencesDialog.gd" type="Script" id=1]
[ext_resource path="res://Assets/Fonts/Roboto-Regular.tres" type="DynamicFont" id=2] [ext_resource path="res://Assets/Fonts/Roboto-Regular.tres" type="DynamicFont" id=2]
[ext_resource path="res://Assets/Fonts/CJK/NotoSansCJKtc-Regular.tres" type="DynamicFont" id=3] [ext_resource path="res://Assets/Fonts/CJK/NotoSansCJKtc-Regular.tres" type="DynamicFont" id=3]
[node name="PreferencesDialog" type="AcceptDialog"] [node name="PreferencesDialog" type="AcceptDialog"]
margin_left = -3.0 margin_left = -3.0
margin_top = 9.0 margin_top = 9.0

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://Prefabs/Dialogs/RotateImage.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/RotateImage.gd" type="Script" id=1]
[node name="RotateImage" type="ConfirmationDialog"] [node name="RotateImage" type="ConfirmationDialog"]
margin_right = 245.0 margin_right = 245.0

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/Dialogs/ScaleImage.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/ScaleImage.gd" type="Script" id=1]
[node name="ScaleImage" type="ConfirmationDialog"] [node name="ScaleImage" type="ConfirmationDialog"]
margin_right = 200.0 margin_right = 200.0

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=12 format=2] [gd_scene load_steps=12 format=2]
[ext_resource path="res://Scripts/Dialogs/SplashDialog.gd" type="Script" id=1] [ext_resource path="res://src/Dialogs/SplashDialog.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/Pixelorama Logo.png" type="Texture" id=2] [ext_resource path="res://Assets/Graphics/Pixelorama Logo.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/Become a patron.png" type="Texture" id=3] [ext_resource path="res://Assets/Graphics/Become a patron.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/Become a patron_Hover.png" type="Texture" id=4] [ext_resource path="res://Assets/Graphics/Become a patron_Hover.png" type="Texture" id=4]
@ -12,6 +12,7 @@
[ext_resource path="res://Assets/Graphics/GitHub-32px.png" type="Texture" id=10] [ext_resource path="res://Assets/Graphics/GitHub-32px.png" type="Texture" id=10]
[ext_resource path="res://Assets/Graphics/Patreon_Mark_White.png" type="Texture" id=11] [ext_resource path="res://Assets/Graphics/Patreon_Mark_White.png" type="Texture" id=11]
[node name="SplashDialog" type="WindowDialog"] [node name="SplashDialog" type="WindowDialog"]
margin_right = 614.0 margin_right = 614.0
margin_bottom = 590.0 margin_bottom = 590.0

View file

@ -1,4 +1,4 @@
class_name LayerContainer class_name LayerButton
extends Button extends Button
var i := 0 var i := 0

View file

@ -1,12 +1,12 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=8 format=2]
[ext_resource path="res://Scripts/LayerContainer.gd" type="Script" id=1] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlinked_Layer.png" type="Texture" id=1]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Layer_Visible.png" type="Texture" id=2] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlock_Hover.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Layer_Visible_Hover.png" type="Texture" id=3] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlock.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlock_Hover.png" type="Texture" id=4] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlinked_Layer_Hover.png" type="Texture" id=4]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlock.png" type="Texture" id=5] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Layer_Visible.png" type="Texture" id=5]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlinked_Layer_Hover.png" type="Texture" id=6] [ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Layer_Visible_Hover.png" type="Texture" id=6]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlinked_Layer.png" type="Texture" id=7] [ext_resource path="res://src/LayerButton.gd" type="Script" id=7]
[node name="LayerContainer" type="Button"] [node name="LayerContainer" type="Button"]
margin_right = 210.0 margin_right = 210.0
@ -15,7 +15,7 @@ rect_min_size = Vector2( 212, 36 )
size_flags_horizontal = 0 size_flags_horizontal = 0
toggle_mode = true toggle_mode = true
action_mode = 0 action_mode = 0
script = ExtResource( 1 ) script = ExtResource( 7 )
__meta__ = { __meta__ = {
"_edit_horizontal_guides_": [ ], "_edit_horizontal_guides_": [ ],
"_edit_use_anchors_": false "_edit_use_anchors_": false
@ -44,8 +44,8 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 4 size_flags_vertical = 4
texture_normal = ExtResource( 2 ) texture_normal = ExtResource( 5 )
texture_hover = ExtResource( 3 ) texture_hover = ExtResource( 6 )
[node name="LockButton" type="TextureButton" parent="HBoxContainer/LayerButtons" groups=[ [node name="LockButton" type="TextureButton" parent="HBoxContainer/LayerButtons" groups=[
"UIButtons", "UIButtons",
@ -59,8 +59,8 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 4 size_flags_vertical = 4
texture_normal = ExtResource( 5 ) texture_normal = ExtResource( 3 )
texture_hover = ExtResource( 4 ) texture_hover = ExtResource( 2 )
[node name="LinkButton" type="TextureButton" parent="HBoxContainer/LayerButtons" groups=[ [node name="LinkButton" type="TextureButton" parent="HBoxContainer/LayerButtons" groups=[
"UIButtons", "UIButtons",
@ -76,8 +76,8 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 4 size_flags_vertical = 4
texture_normal = ExtResource( 7 ) texture_normal = ExtResource( 1 )
texture_hover = ExtResource( 6 ) texture_hover = ExtResource( 4 )
[node name="LayerName" type="HBoxContainer" parent="HBoxContainer"] [node name="LayerName" type="HBoxContainer" parent="HBoxContainer"]
margin_left = 108.0 margin_left = 108.0

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=59 format=2] [gd_scene load_steps=59 format=2]
[ext_resource path="res://Themes & Styles/Dark Theme/Dark Theme.tres" type="Theme" id=1] [ext_resource path="res://Themes & Styles/Dark Theme/Dark Theme.tres" type="Theme" id=1]
[ext_resource path="res://Scripts/Main.gd" type="Script" id=2] [ext_resource path="res://src/Main.gd" type="Script" id=2]
[ext_resource path="res://Themes & Styles/Dark Theme/DarkTopMenuStyle.tres" type="StyleBox" id=3] [ext_resource path="res://Themes & Styles/Dark Theme/DarkTopMenuStyle.tres" type="StyleBox" id=3]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/RectSelect.png" type="Texture" id=4] [ext_resource path="res://Assets/Graphics/Dark Themes/Tools/RectSelect.png" type="Texture" id=4]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/ColorPicker.png" type="Texture" id=5] [ext_resource path="res://Assets/Graphics/Dark Themes/Tools/ColorPicker.png" type="Texture" id=5]
@ -13,40 +13,40 @@
[ext_resource path="res://Assets/Graphics/Dark Themes/Misc/Color defaults.png" type="Texture" id=11] [ext_resource path="res://Assets/Graphics/Dark Themes/Misc/Color defaults.png" type="Texture" id=11]
[ext_resource path="res://Assets/Graphics/Brush_button.png" type="Texture" id=12] [ext_resource path="res://Assets/Graphics/Brush_button.png" type="Texture" id=12]
[ext_resource path="res://Themes & Styles/Dark Theme/DarkRulerStyle.tres" type="StyleBox" id=13] [ext_resource path="res://Themes & Styles/Dark Theme/DarkRulerStyle.tres" type="StyleBox" id=13]
[ext_resource path="res://Scripts/Rulers/HorizontalRuler.gd" type="Script" id=14] [ext_resource path="res://src/Rulers/HorizontalRuler.gd" type="Script" id=14]
[ext_resource path="res://Scripts/Rulers/VerticalRuler.gd" type="Script" id=15] [ext_resource path="res://src/Rulers/VerticalRuler.gd" type="Script" id=15]
[ext_resource path="res://Prefabs/Canvas.tscn" type="PackedScene" id=16] [ext_resource path="res://src/Canvas.tscn" type="PackedScene" id=16]
[ext_resource path="res://Scripts/CameraMovement.gd" type="Script" id=17] [ext_resource path="res://src/CameraMovement.gd" type="Script" id=17]
[ext_resource path="res://Scripts/SelectionRectangle.gd" type="Script" id=18] [ext_resource path="res://src/SelectionRectangle.gd" type="Script" id=18]
[ext_resource path="res://Scripts/SecondViewport.gd" type="Script" id=19] [ext_resource path="res://src/SecondViewport.gd" type="Script" id=19]
[ext_resource path="res://Prefabs/AnimationTimeline.tscn" type="PackedScene" id=20] [ext_resource path="res://src/AnimationTimeline.tscn" type="PackedScene" id=20]
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Add_Palette.png" type="Texture" id=21] [ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Add_Palette.png" type="Texture" id=21]
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Add_Palette_Hover.png" type="Texture" id=22] [ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Add_Palette_Hover.png" type="Texture" id=22]
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Edit_Palette.png" type="Texture" id=23] [ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Edit_Palette.png" type="Texture" id=23]
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Edit_Palette_Hover.png" type="Texture" id=24] [ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Edit_Palette_Hover.png" type="Texture" id=24]
[ext_resource path="res://Scripts/Palette/PaletteContainer.gd" type="Script" id=25] [ext_resource path="res://src/Palette/PaletteContainer.gd" type="Script" id=25]
[ext_resource path="res://Prefabs/BrushButton.tscn" type="PackedScene" id=26] [ext_resource path="res://src/BrushButton.tscn" type="PackedScene" id=26]
[ext_resource path="res://Prefabs/Dialogs/SplashDialog.tscn" type="PackedScene" id=27] [ext_resource path="res://src/Dialogs/SplashDialog.tscn" type="PackedScene" id=27]
[ext_resource path="res://Prefabs/Dialogs/CreateNewImage.tscn" type="PackedScene" id=28] [ext_resource path="res://src/Dialogs/CreateNewImage.tscn" type="PackedScene" id=28]
[ext_resource path="res://Prefabs/Dialogs/ImportSprites.tscn" type="PackedScene" id=29] [ext_resource path="res://src/Dialogs/ImportSprites.tscn" type="PackedScene" id=29]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Horizontal_Mirror_Off.png" type="Texture" id=30] [ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Horizontal_Mirror_Off.png" type="Texture" id=30]
[ext_resource path="res://Prefabs/Dialogs/ScaleImage.tscn" type="PackedScene" id=31] [ext_resource path="res://src/Dialogs/ScaleImage.tscn" type="PackedScene" id=31]
[ext_resource path="res://Prefabs/Dialogs/PreferencesDialog.tscn" type="PackedScene" id=32] [ext_resource path="res://src/Dialogs/PreferencesDialog.tscn" type="PackedScene" id=32]
[ext_resource path="res://Prefabs/Dialogs/OutlineDialog.tscn" type="PackedScene" id=33] [ext_resource path="res://src/Dialogs/OutlineDialog.tscn" type="PackedScene" id=33]
[ext_resource path="res://Prefabs/Dialogs/AboutDialog.tscn" type="PackedScene" id=34] [ext_resource path="res://src/Dialogs/AboutDialog.tscn" type="PackedScene" id=34]
[ext_resource path="res://Prefabs/EditPalettePopup.tscn" type="PackedScene" id=35] [ext_resource path="res://src/Palette/EditPalettePopup.tscn" type="PackedScene" id=35]
[ext_resource path="res://Prefabs/NewPaletteDialog.tscn" type="PackedScene" id=36] [ext_resource path="res://src/Palette/NewPaletteDialog.tscn" type="PackedScene" id=36]
[ext_resource path="res://Prefabs/PaletteImportFileDialog.tscn" type="PackedScene" id=37] [ext_resource path="res://src/Palette/PaletteImportFileDialog.tscn" type="PackedScene" id=37]
[ext_resource path="res://Prefabs/Dialogs/RotateImage.tscn" type="PackedScene" id=38] [ext_resource path="res://src/Dialogs/RotateImage.tscn" type="PackedScene" id=38]
[ext_resource path="res://Prefabs/Dialogs/ExportDialog.tscn" type="PackedScene" id=39] [ext_resource path="res://src/Dialogs/ExportDialog.tscn" type="PackedScene" id=39]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Horizontal_Mirror_On.png" type="Texture" id=40] [ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Horizontal_Mirror_On.png" type="Texture" id=40]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Vertical_Mirror_On.png" type="Texture" id=41] [ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Vertical_Mirror_On.png" type="Texture" id=41]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Vertical_Mirror_Off.png" type="Texture" id=42] [ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Vertical_Mirror_Off.png" type="Texture" id=42]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Zoom.png" type="Texture" id=43] [ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Zoom.png" type="Texture" id=43]
[ext_resource path="res://Prefabs/Dialogs/HSVDialog.tscn" type="PackedScene" id=44] [ext_resource path="res://src/Dialogs/HSVDialog.tscn" type="PackedScene" id=44]
[ext_resource path="res://Scripts/TransparentChecker.gd" type="Script" id=45] [ext_resource path="res://src/TransparentChecker.gd" type="Script" id=45]
[ext_resource path="res://Prefabs/Dialogs/OpenLastProjectAlertDialog.tscn" type="PackedScene" id=46] [ext_resource path="res://src/Dialogs/OpenLastProjectAlertDialog.tscn" type="PackedScene" id=46]
[ext_resource path="res://Prefabs/Dialogs/NoProjectEditedOrCreatedAlertDialog.tscn" type="PackedScene" id=47] [ext_resource path="res://src/Dialogs/NoProjectEditedOrCreatedAlertDialog.tscn" type="PackedScene" id=47]
[sub_resource type="Shader" id=1] [sub_resource type="Shader" id=1]
code = "shader_type canvas_item; code = "shader_type canvas_item;

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=2 format=2]
[ext_resource path="res://Scripts/NotificationLabel.gd" type="Script" id=2] [ext_resource path="res://src/NotificationLabel.gd" type="Script" id=2]
[node name="NotificationLabel" type="Label"] [node name="NotificationLabel" type="Label"]
margin_right = 116.0 margin_right = 116.0

View file

@ -1,6 +1,6 @@
extends WindowDialog extends WindowDialog
var palette_button = preload("res://Prefabs/PaletteButton.tscn") var palette_button = preload("res://src/Palette/PaletteButton.tscn")
var current_palette : String var current_palette : String
var current_swatch := -1 var current_swatch := -1

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=5 format=2]
[ext_resource path="res://Scripts/Palette/EditPalettePopup.gd" type="Script" id=1] [ext_resource path="res://src/Palette/EditPalettePopup.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/new_frame.png" type="Texture" id=2] [ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/new_frame.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/remove_frame.png" type="Texture" id=3] [ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/remove_frame.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/Palette/palette_button_fill.png" type="Texture" id=6] [ext_resource path="res://Assets/Graphics/Palette/palette_button_fill.png" type="Texture" id=6]
@ -28,8 +28,10 @@ margin_bottom = 462.0
size_flags_vertical = 3 size_flags_vertical = 3
[node name="EditPaletteColorPicker" type="ColorPicker" parent="VBoxContainer/HBoxContainer"] [node name="EditPaletteColorPicker" type="ColorPicker" parent="VBoxContainer/HBoxContainer"]
margin_right = 308.0 margin_left = 4.0
margin_bottom = 462.0 margin_top = 4.0
margin_right = 4.0
margin_bottom = 4.0
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
margin_left = 312.0 margin_left = 312.0

View file

@ -1,10 +1,10 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=8 format=2]
[ext_resource path="res://Themes & Styles/StyleBoxes/palette_stylebox_hover.tres" type="StyleBox" id=1] [ext_resource path="res://Themes & Styles/StyleBoxes/palette_stylebox_pressedr.tres" type="StyleBox" id=1]
[ext_resource path="res://Themes & Styles/StyleBoxes/palette_stylebox_pressedr.tres" type="StyleBox" id=2] [ext_resource path="res://Themes & Styles/StyleBoxes/palette_stylebox_hover.tres" type="StyleBox" id=2]
[ext_resource path="res://Themes & Styles/StyleBoxes/palette_stylebox_focus.tres" type="StyleBox" id=3] [ext_resource path="res://src/Palette/PaletteButton.gd" type="Script" id=3]
[ext_resource path="res://Themes & Styles/StyleBoxes/palette_stylebox_normal.tres" type="StyleBox" id=4] [ext_resource path="res://Themes & Styles/StyleBoxes/palette_stylebox_focus.tres" type="StyleBox" id=4]
[ext_resource path="res://Scripts/Palette/PaletteButton.gd" type="Script" id=5] [ext_resource path="res://Themes & Styles/StyleBoxes/palette_stylebox_normal.tres" type="StyleBox" id=5]
[ext_resource path="res://Assets/Graphics/Palette/palette_button_fill.png" type="Texture" id=6] [ext_resource path="res://Assets/Graphics/Palette/palette_button_fill.png" type="Texture" id=6]
[sub_resource type="ImageTexture" id=1] [sub_resource type="ImageTexture" id=1]
@ -14,14 +14,14 @@ margin_right = 26.0
margin_bottom = 26.0 margin_bottom = 26.0
rect_min_size = Vector2( 26, 26 ) rect_min_size = Vector2( 26, 26 )
hint_tooltip = "Color Name" hint_tooltip = "Color Name"
custom_styles/hover = ExtResource( 1 ) custom_styles/hover = ExtResource( 2 )
custom_styles/pressed = ExtResource( 2 ) custom_styles/pressed = ExtResource( 1 )
custom_styles/focus = ExtResource( 3 ) custom_styles/focus = ExtResource( 4 )
custom_styles/normal = ExtResource( 4 ) custom_styles/normal = ExtResource( 5 )
action_mode = 0 action_mode = 0
button_mask = 3 button_mask = 3
icon = SubResource( 1 ) icon = SubResource( 1 )
script = ExtResource( 5 ) script = ExtResource( 3 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }

View file

@ -1,6 +1,6 @@
extends GridContainer extends GridContainer
const palette_button = preload("res://Prefabs/PaletteButton.tscn") const palette_button = preload("res://src/Palette/PaletteButton.tscn")
var current_palette = "Default" var current_palette = "Default"
var from_palette : Palette var from_palette : Palette

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://Assets/Graphics/Brush_button.png" type="Texture" id=1] [ext_resource path="res://Assets/Graphics/Brush_button.png" type="Texture" id=1]
[ext_resource path="res://Prefabs/PatternButton.gd" type="Script" id=2] [ext_resource path="res://src/PatternButton.gd" type="Script" id=2]
[node name="PatternButton" type="TextureButton"] [node name="PatternButton" type="TextureButton"]
margin_right = 32.0 margin_right = 32.0