-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow using deferred calls, and show linked frames
- Loading branch information
Showing
8 changed files
with
212 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
addons/goutte.animated_shape_2d/editor/icons/link.png.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://chl5rhpr6ngqp" | ||
path="res://.godot/imported/link.png-e080a774f28ccd8863f5e23555455903.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://addons/goutte.animated_shape_2d/editor/icons/link.png" | ||
dest_files=["res://.godot/imported/link.png-e080a774f28ccd8863f5e23555455903.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 |
37 changes: 37 additions & 0 deletions
37
addons/goutte.animated_shape_2d/editor/linked_frames_feedback.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@tool | ||
extends Node | ||
|
||
|
||
@export var editor: ShapeFramesBottomPanelControl | ||
|
||
|
||
func update_for(animation_name: StringName, frame_index: int): | ||
assert(editor.currently_selected_animation_name == animation_name) | ||
# 1. Grab the sprite frame resource of the selected frame | ||
var frame_editor := editor.get_frame_at(frame_index) | ||
var shape_frame := frame_editor.get_shape_frame() | ||
# 2. Iterate over all frames to find linked frames | ||
var linked_frames_editors: Array[ShapeFrameEditor]= [] | ||
for some_frame_editor in editor.frames_list: | ||
if shape_frame == null: | ||
continue | ||
if some_frame_editor.get_shape_frame() != shape_frame: | ||
continue | ||
linked_frames_editors.append(some_frame_editor) | ||
# 3. Hide the link marker everywhere | ||
for some_frame_editor in editor.frames_list: | ||
some_frame_editor.hide_link_marker() | ||
# 4. Show the link marker where appropriate | ||
if linked_frames_editors.size() > 1: | ||
for linked_frame_editor in linked_frames_editors: | ||
linked_frame_editor.show_link_marker() | ||
|
||
|
||
func _on_shape_frames_bottom_panel_control_frame_selected(animation_name: StringName, frame_index: int): | ||
update_for(animation_name, frame_index) | ||
|
||
|
||
func _on_shape_frames_bottom_panel_control_frame_changed(animation_name, frame_index): | ||
var selected_frame_editor := editor.get_selected_frame() | ||
update_for(selected_frame_editor.animation_name, selected_frame_editor.frame_index) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.