You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +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:
@@ -36,7 +36,6 @@
|
||||
#include "thirdparty/misc/clipper.hpp"
|
||||
|
||||
void Skeleton2DEditor::_node_removed(Node *p_node) {
|
||||
|
||||
if (p_node == node) {
|
||||
node = nullptr;
|
||||
options->hide();
|
||||
@@ -44,19 +43,16 @@ void Skeleton2DEditor::_node_removed(Node *p_node) {
|
||||
}
|
||||
|
||||
void Skeleton2DEditor::edit(Skeleton2D *p_sprite) {
|
||||
|
||||
node = p_sprite;
|
||||
}
|
||||
|
||||
void Skeleton2DEditor::_menu_option(int p_option) {
|
||||
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (p_option) {
|
||||
case MENU_OPTION_MAKE_REST: {
|
||||
|
||||
if (node->get_bone_count() == 0) {
|
||||
err_dialog->set_text(TTR("This skeleton has no bones, create some children Bone2D nodes."));
|
||||
err_dialog->popup_centered();
|
||||
@@ -95,7 +91,6 @@ void Skeleton2DEditor::_bind_methods() {
|
||||
}
|
||||
|
||||
Skeleton2DEditor::Skeleton2DEditor() {
|
||||
|
||||
options = memnew(MenuButton);
|
||||
|
||||
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(options);
|
||||
@@ -115,28 +110,23 @@ Skeleton2DEditor::Skeleton2DEditor() {
|
||||
}
|
||||
|
||||
void Skeleton2DEditorPlugin::edit(Object *p_object) {
|
||||
|
||||
sprite_editor->edit(Object::cast_to<Skeleton2D>(p_object));
|
||||
}
|
||||
|
||||
bool Skeleton2DEditorPlugin::handles(Object *p_object) const {
|
||||
|
||||
return p_object->is_class("Skeleton2D");
|
||||
}
|
||||
|
||||
void Skeleton2DEditorPlugin::make_visible(bool p_visible) {
|
||||
|
||||
if (p_visible) {
|
||||
sprite_editor->options->show();
|
||||
} else {
|
||||
|
||||
sprite_editor->options->hide();
|
||||
sprite_editor->edit(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
Skeleton2DEditorPlugin::Skeleton2DEditorPlugin(EditorNode *p_node) {
|
||||
|
||||
editor = p_node;
|
||||
sprite_editor = memnew(Skeleton2DEditor);
|
||||
editor->get_viewport()->add_child(sprite_editor);
|
||||
|
||||
Reference in New Issue
Block a user