File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
addons/block_code/ui/picker/categories Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -502,6 +502,40 @@ 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 = "pause_continue_sound"
508+ b .block_type = Types .BlockType .EXECUTE
509+ b .block_format = "{pause: OPTION} the sound {name: STRING} "
510+ b .statement = (
511+ """
512+ var __sound_node = get_node({name} )
513+ if "{pause} " == "pause":
514+ __sound_node.stream_paused = true
515+ else:
516+ __sound_node.stream_paused = false
517+ """
518+ . dedent ()
519+ )
520+ b .defaults = {"pause" : OptionData .new (["Pause" , "Continue" ])}
521+ b .tooltip_text = "Pause/Continue the audio stream"
522+ b .category = "Sounds"
523+ block_list .append (b )
524+
525+ b = BLOCKS ["statement_block" ].instantiate ()
526+ b .block_name = "stop_sound"
527+ b .block_type = Types .BlockType .EXECUTE
528+ b .block_format = "Stop the sound {name: STRING} "
529+ b .statement = (
530+ """
531+ var __sound_node = get_node({name} )
532+ __sound_node.stop()
533+ """
534+ . dedent ()
535+ )
536+ b .tooltip_text = "Stop the audio stream"
537+ b .category = "Sounds"
538+ block_list .append (b )
505539#endregion
506540#region Graphics
507541
You can’t perform that action at this time.
0 commit comments