mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-08 03:19:49 +00:00
637662dee4
* Updated PixelLayerButton's LinkButton's hint_tooltip to be more accurate * Don't automatically link the current frame's cel when enabling new_cels_linked on a layer * Mostly added new system * renamed link group to link set * Enable drag and drop of linked cels on the same layer * formatted CelButton.gd * serialize/deserialize * Copy frames w/ new linked cels system. Removed copy_cel from layer classes * Removed commented out code from AnimationTimeline.copy_frames * Removed Project.duplicate_layers * Removed unlink_cel in favour of using null with link cel (as the first part of that method was the same) * Disabled show_behind_parent on PixelCelButton's LinkedIndicator, as it wasn't enough to improve visibility of selection * Moved BaseLayer.copy out of the Methods to Override section * Added optional texture param to Cel's set_content method (needed for use when deserializing, and otherwise helpful * set textures with set_content where needed * open_image_as_spritesheet_layer new_cels_linked part updated * clone layer with linked cels implemented. Removed copy_all_cels from layer classes * weaked how copied layers names are updated * Merge layers works with new linked cels now * Fixed texture on cel buttons not being updated on button setup * fixed bug where using set_content with new image texture would result in an empty texture * Open old .pxo with new linked cels * simplified backwards compatiblity * removed linked_cels * better linked cels backwards compatibility * Removed some old TODO comments * fixed linked_cels conversion bug when linked_cels is empty * Added undo for linking the previous cel when creating new cels with new_cels_linked enabled * Removed TODOs * Cleaned up some method variable naming * Cleaned up deserialization * combined matching for loops * Inlined BaseLayer.copy() where its used * gdformat * Fixed Translations,pot Co-authored-by: MrTriPie <MrTriPie>
38 lines
807 B
GDScript
38 lines
807 B
GDScript
class_name PixelLayer
|
|
extends BaseLayer
|
|
# A class for standard pixel layer properties.
|
|
|
|
|
|
func _init(_project, _name := "") -> void:
|
|
project = _project
|
|
name = _name
|
|
|
|
|
|
# Overridden Methods:
|
|
|
|
|
|
func serialize() -> Dictionary:
|
|
var dict = .serialize()
|
|
dict["type"] = Global.LayerTypes.PIXEL
|
|
dict["new_cels_linked"] = new_cels_linked
|
|
return dict
|
|
|
|
|
|
func deserialize(dict: Dictionary) -> void:
|
|
.deserialize(dict)
|
|
new_cels_linked = dict.new_cels_linked
|
|
|
|
|
|
func new_empty_cel() -> BaseCel:
|
|
var image := Image.new()
|
|
image.create(project.size.x, project.size.y, false, Image.FORMAT_RGBA8)
|
|
return PixelCel.new(image)
|
|
|
|
|
|
func can_layer_get_drawn() -> bool:
|
|
return is_visible_in_hierarchy() && !is_locked_in_hierarchy()
|
|
|
|
|
|
func instantiate_layer_button() -> Node:
|
|
return Global.pixel_layer_button_node.instance()
|