Skip to content

Commit

Permalink
category_factory: Add BOOL data type's SET & CHANGE fallback values
Browse files Browse the repository at this point in the history
To generate set and change blocks of node's property in boolean type
automatically, add property in boolean type's set and change fallback
value.
  • Loading branch information
starnight committed Aug 13, 2024
1 parent 4ed905f commit 22877e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/block_code/ui/picker/categories/category_factory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -566,13 +566,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

0 comments on commit 22877e7

Please sign in to comment.