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

Background: Disable/enable conditional properties #331

Merged
merged 1 commit into from
Dec 9, 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
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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply place related link from Godot document 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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply place related link from Godot document _validate_property()

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
Loading