You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00: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:
@@ -39,8 +39,9 @@ bool MultiNodeEdit::_set(const StringName &p_name, const Variant &p_value) {
|
||||
|
||||
bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value, const String &p_field) {
|
||||
Node *es = EditorNode::get_singleton()->get_edited_scene();
|
||||
if (!es)
|
||||
if (!es) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String name = p_name;
|
||||
|
||||
@@ -52,12 +53,14 @@ bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value,
|
||||
|
||||
ur->create_action(TTR("MultiNode Set") + " " + String(name), UndoRedo::MERGE_ENDS);
|
||||
for (const List<NodePath>::Element *E = nodes.front(); E; E = E->next()) {
|
||||
if (!es->has_node(E->get()))
|
||||
if (!es->has_node(E->get())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Node *n = es->get_node(E->get());
|
||||
if (!n)
|
||||
if (!n) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (p_value.get_type() == Variant::NODE_PATH) {
|
||||
Node *tonode = n->get_node(p_value);
|
||||
@@ -86,8 +89,9 @@ bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value,
|
||||
|
||||
bool MultiNodeEdit::_get(const StringName &p_name, Variant &r_ret) const {
|
||||
Node *es = EditorNode::get_singleton()->get_edited_scene();
|
||||
if (!es)
|
||||
if (!es) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String name = p_name;
|
||||
if (name == "scripts") { // script set is intercepted at object level (check Variant Object::get() ) ,so use a different name
|
||||
@@ -95,17 +99,20 @@ bool MultiNodeEdit::_get(const StringName &p_name, Variant &r_ret) const {
|
||||
}
|
||||
|
||||
for (const List<NodePath>::Element *E = nodes.front(); E; E = E->next()) {
|
||||
if (!es->has_node(E->get()))
|
||||
if (!es->has_node(E->get())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const Node *n = es->get_node(E->get());
|
||||
if (!n)
|
||||
if (!n) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool found;
|
||||
r_ret = n->get(name, &found);
|
||||
if (found)
|
||||
if (found) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -115,27 +122,31 @@ void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
HashMap<String, PLData> usage;
|
||||
|
||||
Node *es = EditorNode::get_singleton()->get_edited_scene();
|
||||
if (!es)
|
||||
if (!es) {
|
||||
return;
|
||||
}
|
||||
|
||||
int nc = 0;
|
||||
|
||||
List<PLData *> data_list;
|
||||
|
||||
for (const List<NodePath>::Element *E = nodes.front(); E; E = E->next()) {
|
||||
if (!es->has_node(E->get()))
|
||||
if (!es->has_node(E->get())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Node *n = es->get_node(E->get());
|
||||
if (!n)
|
||||
if (!n) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<PropertyInfo> plist;
|
||||
n->get_property_list(&plist, true);
|
||||
|
||||
for (List<PropertyInfo>::Element *F = plist.front(); F; F = F->next()) {
|
||||
if (F->get().name == "script")
|
||||
if (F->get().name == "script") {
|
||||
continue; //added later manually, since this is intercepted before being set (check Variant Object::get() )
|
||||
}
|
||||
if (!usage.has(F->get().name)) {
|
||||
PLData pld;
|
||||
pld.uses = 0;
|
||||
@@ -145,8 +156,9 @@ void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
}
|
||||
|
||||
// Make sure only properties with the same exact PropertyInfo data will appear
|
||||
if (usage[F->get().name].info == F->get())
|
||||
if (usage[F->get().name].info == F->get()) {
|
||||
usage[F->get().name].uses++;
|
||||
}
|
||||
}
|
||||
|
||||
nc++;
|
||||
|
||||
Reference in New Issue
Block a user