Skip to content

Commit

Permalink
Merge pull request #331 from endlessm/improve-background-property
Browse files Browse the repository at this point in the history
Background: Disable/enable conditional properties
  • Loading branch information
starnight authored Dec 9, 2024
2 parents a6f753f + db7d3a5 commit 2c16ed4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func _set_color(new_color):
func _set_block_type(new_block_type):
block_type = new_block_type
queue_redraw()
notify_property_list_changed()


func _set_control_part(new_control_part):
Expand All @@ -49,6 +50,13 @@ func _set_is_pointy_value(new_is_pointy_value):
queue_redraw()


func _validate_property(property: Dictionary):
if property.name == "control_part" and block_type != Types.BlockType.CONTROL:
property.usage |= PROPERTY_USAGE_READ_ONLY
elif property.name == "is_pointy_value" and block_type != Types.BlockType.VALUE:
property.usage |= PROPERTY_USAGE_READ_ONLY


func _ready():
parent_block = BlockTreeUtil.get_parent_block(self)
parent_block.focus_entered.connect(queue_redraw)
Expand Down

0 comments on commit 2c16ed4

Please sign in to comment.