Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

category_factory: Add another Sounds blocks for GDScript flavor #174

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions addons/block_code/ui/picker/categories/category_factory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,15 @@ static func property_to_blocklist(property: Dictionary) -> Array[Block]:
var variant_type = property.type

const FALLBACK_SET_FOR_TYPE = {
TYPE_BOOL: false,
TYPE_INT: "0",
TYPE_FLOAT: "0",
TYPE_VECTOR2: "0,0",
TYPE_COLOR: "DARK_ORANGE",
}

const FALLBACK_CHANGE_FOR_TYPE = {
TYPE_BOOL: true,
TYPE_INT: "1",
TYPE_FLOAT: "1",
TYPE_VECTOR2: "1,1",
Expand Down Expand Up @@ -724,6 +726,31 @@ static func get_built_in_blocks(_class_name: String) -> Array[Block]:
"angular_velocity": {"category": "Physics | Velocity"},
}

"AudioStreamPlayer":
var b = BLOCKS["statement_block"].instantiate()
b.block_name = "audiostreamplayer_play"
b.block_format = "Play"
b.statement = "play()"
b.tooltip_text = "Play the audio stream"
b.category = "Sounds"
block_list.append(b)

b = BLOCKS["statement_block"].instantiate()
b.block_name = "audiostreamplayer_stop"
b.block_format = "Stop"
b.statement = "stop()"
b.tooltip_text = "Stop the audio stream"
b.category = "Sounds"
block_list.append(b)

props = {
"stream_paused":
{
"category": "Sounds",
"has_change": false,
},
}

"AnimationPlayer":
var b = BLOCKS["statement_block"].instantiate()
b.block_name = "animationplayer_play"
Expand Down