mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 08:54:44 -04:00
Cel unlinking now works properly
Undo/redo can have some weird behavior right now
This commit is contained in:
parent
0ec3af30f4
commit
9ca564cfe1
3 changed files with 18 additions and 7 deletions
|
@ -9,10 +9,10 @@ func _ready() -> void:
|
|||
hint_tooltip = "Frame: %s, Layer: %s" % [frame, layer]
|
||||
if Global.canvases[frame] in Global.layers[layer][5]:
|
||||
get_node("LinkedIndicator").visible = true
|
||||
popup_menu.set_item_disabled(4, false) # Unlink cell
|
||||
popup_menu.set_item_disabled(4, false) # Unlink cel
|
||||
else:
|
||||
get_node("LinkedIndicator").visible = false
|
||||
popup_menu.set_item_disabled(4, true) # Unlink cell
|
||||
popup_menu.set_item_disabled(4, true) # Unlink cel
|
||||
|
||||
func _on_FrameButton_pressed() -> void:
|
||||
if Input.is_action_just_released("left_mouse"):
|
||||
|
@ -87,11 +87,19 @@ func _on_PopupMenu_id_pressed(ID : int) -> void:
|
|||
change_frame_order(-1)
|
||||
3: # Move Right
|
||||
change_frame_order(1)
|
||||
4: # Unlink Cell
|
||||
var cell_index : int = Global.layers[layer][5].find(Global.canvases[frame])
|
||||
Global.layers[layer][5].remove(cell_index)
|
||||
4: # Unlink Cel
|
||||
var cel_index : int = Global.layers[layer][5].find(Global.canvases[frame])
|
||||
Global.layers[layer][5].remove(cel_index)
|
||||
_ready()
|
||||
|
||||
var sprite := Image.new()
|
||||
sprite.copy_from(Global.canvases[frame].layers[layer][0])
|
||||
sprite.lock()
|
||||
Global.canvases[frame].layers[layer][0] = sprite
|
||||
var tex := ImageTexture.new()
|
||||
tex.create_from_image(sprite, 0)
|
||||
Global.canvases[frame].layers[layer][1] = tex
|
||||
|
||||
func remove_frame() -> void:
|
||||
var canvas : Canvas = Global.canvases[frame]
|
||||
var new_canvases := Global.canvases.duplicate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue