Allow unsetting shortcut_context.

This commit is contained in:
bruvzg 2022-01-25 14:13:00 +02:00
parent 37472fa2c0
commit 306b98638e
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38

View file

@ -382,8 +382,11 @@ Ref<ButtonGroup> BaseButton::get_button_group() const {
}
void BaseButton::set_shortcut_context(Node *p_node) {
ERR_FAIL_NULL_MSG(p_node, "Shortcut context node can't be null.");
shortcut_context = p_node->get_instance_id();
if (p_node != nullptr) {
shortcut_context = p_node->get_instance_id();
} else {
shortcut_context = ObjectID();
}
}
Node *BaseButton::get_shortcut_context() const {