mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
@@ -35,17 +35,20 @@
|
||||
void MenuButton::_unhandled_key_input(Ref<InputEvent> p_event) {
|
||||
ERR_FAIL_COND(p_event.is_null());
|
||||
|
||||
if (disable_shortcuts)
|
||||
if (disable_shortcuts) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_event->is_pressed() && !p_event->is_echo() && (Object::cast_to<InputEventKey>(p_event.ptr()) || Object::cast_to<InputEventJoypadButton>(p_event.ptr()) || Object::cast_to<InputEventAction>(*p_event))) {
|
||||
if (!get_parent() || !is_visible_in_tree() || is_disabled())
|
||||
if (!get_parent() || !is_visible_in_tree() || is_disabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool global_only = (get_viewport()->get_modal_stack_top() && !get_viewport()->get_modal_stack_top()->is_a_parent_of(this));
|
||||
|
||||
if (popup->activate_item_by_event(p_event, global_only))
|
||||
if (popup->activate_item_by_event(p_event, global_only)) {
|
||||
accept_event();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user