You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-22 15:06:45 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
#include "scene/gui/box_container.h"
|
||||
|
||||
void NavigationMeshEditor::_node_removed(Node *p_node) {
|
||||
|
||||
if (p_node == node) {
|
||||
node = nullptr;
|
||||
|
||||
@@ -47,9 +46,7 @@ void NavigationMeshEditor::_node_removed(Node *p_node) {
|
||||
}
|
||||
|
||||
void NavigationMeshEditor::_notification(int p_option) {
|
||||
|
||||
if (p_option == NOTIFICATION_ENTER_TREE) {
|
||||
|
||||
button_bake->set_icon(get_theme_icon("Bake", "EditorIcons"));
|
||||
button_reset->set_icon(get_theme_icon("Reload", "EditorIcons"));
|
||||
}
|
||||
@@ -72,7 +69,6 @@ void NavigationMeshEditor::_bake_pressed() {
|
||||
}
|
||||
|
||||
void NavigationMeshEditor::_clear_pressed() {
|
||||
|
||||
if (node)
|
||||
NavigationMeshGenerator::get_singleton()->clear(node->get_navigation_mesh());
|
||||
|
||||
@@ -85,7 +81,6 @@ void NavigationMeshEditor::_clear_pressed() {
|
||||
}
|
||||
|
||||
void NavigationMeshEditor::edit(NavigationRegion3D *p_nav_region) {
|
||||
|
||||
if (p_nav_region == nullptr || node == p_nav_region) {
|
||||
return;
|
||||
}
|
||||
@@ -97,7 +92,6 @@ void NavigationMeshEditor::_bind_methods() {
|
||||
}
|
||||
|
||||
NavigationMeshEditor::NavigationMeshEditor() {
|
||||
|
||||
bake_hbox = memnew(HBoxContainer);
|
||||
|
||||
button_bake = memnew(ToolButton);
|
||||
@@ -124,22 +118,18 @@ NavigationMeshEditor::~NavigationMeshEditor() {
|
||||
}
|
||||
|
||||
void NavigationMeshEditorPlugin::edit(Object *p_object) {
|
||||
|
||||
navigation_mesh_editor->edit(Object::cast_to<NavigationRegion3D>(p_object));
|
||||
}
|
||||
|
||||
bool NavigationMeshEditorPlugin::handles(Object *p_object) const {
|
||||
|
||||
return p_object->is_class("NavigationRegion3D");
|
||||
}
|
||||
|
||||
void NavigationMeshEditorPlugin::make_visible(bool p_visible) {
|
||||
|
||||
if (p_visible) {
|
||||
navigation_mesh_editor->show();
|
||||
navigation_mesh_editor->bake_hbox->show();
|
||||
} else {
|
||||
|
||||
navigation_mesh_editor->hide();
|
||||
navigation_mesh_editor->bake_hbox->hide();
|
||||
navigation_mesh_editor->edit(nullptr);
|
||||
@@ -147,7 +137,6 @@ void NavigationMeshEditorPlugin::make_visible(bool p_visible) {
|
||||
}
|
||||
|
||||
NavigationMeshEditorPlugin::NavigationMeshEditorPlugin(EditorNode *p_node) {
|
||||
|
||||
editor = p_node;
|
||||
navigation_mesh_editor = memnew(NavigationMeshEditor);
|
||||
editor->get_viewport()->add_child(navigation_mesh_editor);
|
||||
|
||||
Reference in New Issue
Block a user