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

Cel buttons have a green outline to indicate that they're linked

The first time the link button get pressed, the currently selected cel is being linked. In futue commits, new frames will be linked on layers where the link button is pressed.
This commit is contained in:
OverloadedOrama 2020-03-18 02:02:41 +02:00
parent a60efccbfd
commit 778c86183f
3 changed files with 11 additions and 0 deletions

View file

@ -33,5 +33,12 @@ margin_right = 20.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
items = [ "Remove Frame", null, 0, false, true, -1, 0, null, "", false, "Clone Frame", null, 0, false, false, -1, 0, null, "", false, "Move Left", null, 0, false, true, -1, 0, null, "", false, "Move Right", null, 0, false, true, -1, 0, null, "", false ]
[node name="LinkedIndicator" type="Polygon2D" parent="."]
visible = false
color = Color( 0.0627451, 0.741176, 0.215686, 1 )
invert_enable = true
invert_border = 1.0
polygon = PoolVector2Array( 0, 0, 36, 0, 36, 36, 0, 36 )
[connection signal="pressed" from="." to="." method="_on_FrameButton_pressed"]
[connection signal="id_pressed" from="PopupMenu" to="." method="_on_PopupMenu_id_pressed"]

View file

@ -7,6 +7,8 @@ onready var popup_menu := $PopupMenu
func _ready() -> void:
hint_tooltip = "Frame: %s, Layer: %s" % [frame, layer]
if frame in Global.layers[layer][5]:
get_node("LinkedIndicator").visible = true
func _on_FrameButton_pressed() -> void:
if Input.is_action_just_released("left_mouse"):

View file

@ -66,3 +66,5 @@ func _on_LockButton_pressed() -> void:
func _on_LinkButton_pressed() -> void:
Global.layers[i][4] = !Global.layers[i][4]
if !Global.layers[i][5]:
Global.layers[i][5].append(Global.current_frame)