Skip to content

Commit 319a8a1

Browse files
committed
category_factory: Add stop audio feature
https://phabricator.endlessm.com/T35582
1 parent 90fad21 commit 319a8a1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

addons/block_code/ui/picker/categories/category_factory.gd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,21 @@ static func get_general_blocks() -> Array[Block]:
502502
b.tooltip_text = "Play the audio stream with volume and pitch"
503503
b.category = "Sounds"
504504
block_list.append(b)
505+
506+
b = BLOCKS["statement_block"].instantiate()
507+
b.block_name = "stop_sound"
508+
b.block_type = Types.BlockType.EXECUTE
509+
b.block_format = "Stop the sound {name: STRING}"
510+
b.statement = (
511+
"""
512+
var __sound_node = get_node({name})
513+
__sound_node.stop()
514+
"""
515+
. dedent()
516+
)
517+
b.tooltip_text = "Stop the audio stream"
518+
b.category = "Sounds"
519+
block_list.append(b)
505520
#endregion
506521
#region Graphics
507522

0 commit comments

Comments
 (0)