Style: Apply clang-tidy's readability-braces-around-statements
This commit is contained in:
parent
9bbe51dc27
commit
d83761ba80
32 changed files with 308 additions and 165 deletions
|
|
@ -649,14 +649,16 @@ public:
|
|||
Color color = get_theme_color("highlight_color", "Editor");
|
||||
for (int i = 0; i < 2; i++) {
|
||||
Point2 ofs(4, vofs);
|
||||
if (i == 1)
|
||||
if (i == 1) {
|
||||
ofs.y += bsize + 1;
|
||||
}
|
||||
|
||||
ofs += rect.position;
|
||||
for (int j = 0; j < 10; j++) {
|
||||
Point2 o = ofs + Point2(j * (bsize + 1), 0);
|
||||
if (j >= 5)
|
||||
if (j >= 5) {
|
||||
o.x += 1;
|
||||
}
|
||||
|
||||
const int idx = i * 10 + j;
|
||||
const bool on = value & (1 << idx);
|
||||
|
|
|
|||
|
|
@ -38,8 +38,9 @@
|
|||
EditorTranslationParser *EditorTranslationParser::singleton = nullptr;
|
||||
|
||||
Error EditorTranslationParserPlugin::parse_file(const String &p_path, Vector<String> *r_ids, Vector<Vector<String>> *r_ids_ctx_plural) {
|
||||
if (!get_script_instance())
|
||||
if (!get_script_instance()) {
|
||||
return ERR_UNAVAILABLE;
|
||||
}
|
||||
|
||||
if (get_script_instance()->has_method("parse_file")) {
|
||||
Array ids;
|
||||
|
|
@ -70,8 +71,9 @@ Error EditorTranslationParserPlugin::parse_file(const String &p_path, Vector<Str
|
|||
}
|
||||
|
||||
void EditorTranslationParserPlugin::get_recognized_extensions(List<String> *r_extensions) const {
|
||||
if (!get_script_instance())
|
||||
if (!get_script_instance()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (get_script_instance()->has_method("get_recognized_extensions")) {
|
||||
Array extensions = get_script_instance()->call("get_recognized_extensions");
|
||||
|
|
|
|||
|
|
@ -2621,8 +2621,9 @@ void FileSystemDock::_get_imported_files(const String &p_path, Vector<String> &f
|
|||
}
|
||||
|
||||
void FileSystemDock::_update_import_dock() {
|
||||
if (!import_dock_needs_update)
|
||||
if (!import_dock_needs_update) {
|
||||
return;
|
||||
}
|
||||
|
||||
// List selected.
|
||||
Vector<String> selected;
|
||||
|
|
@ -2633,8 +2634,9 @@ void FileSystemDock::_update_import_dock() {
|
|||
} else {
|
||||
// Use the file list.
|
||||
for (int i = 0; i < files->get_item_count(); i++) {
|
||||
if (!files->is_selected(i))
|
||||
if (!files->is_selected(i)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
selected.push_back(files->get_item_metadata(i));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,16 +167,18 @@ void BoneTransformEditor::_notification(int p_what) {
|
|||
}
|
||||
|
||||
void BoneTransformEditor::_value_changed(const double p_value) {
|
||||
if (updating)
|
||||
if (updating) {
|
||||
return;
|
||||
}
|
||||
|
||||
Transform tform = compute_transform_from_vector3s();
|
||||
_change_transform(tform);
|
||||
}
|
||||
|
||||
void BoneTransformEditor::_value_changed_vector3(const String p_property_name, const Vector3 p_vector, const StringName p_edited_property_name, const bool p_boolean) {
|
||||
if (updating)
|
||||
if (updating) {
|
||||
return;
|
||||
}
|
||||
Transform tform = compute_transform_from_vector3s();
|
||||
_change_transform(tform);
|
||||
}
|
||||
|
|
@ -194,8 +196,9 @@ Transform BoneTransformEditor::compute_transform_from_vector3s() const {
|
|||
}
|
||||
|
||||
void BoneTransformEditor::_value_changed_transform(const String p_property_name, const Transform p_transform, const StringName p_edited_property_name, const bool p_boolean) {
|
||||
if (updating)
|
||||
if (updating) {
|
||||
return;
|
||||
}
|
||||
_change_transform(p_transform);
|
||||
}
|
||||
|
||||
|
|
@ -222,11 +225,13 @@ void BoneTransformEditor::update_enabled_checkbox() {
|
|||
}
|
||||
|
||||
void BoneTransformEditor::_update_properties() {
|
||||
if (updating)
|
||||
if (updating) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (skeleton == nullptr)
|
||||
if (skeleton == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
updating = true;
|
||||
|
||||
|
|
@ -235,11 +240,13 @@ void BoneTransformEditor::_update_properties() {
|
|||
}
|
||||
|
||||
void BoneTransformEditor::_update_custom_pose_properties() {
|
||||
if (updating)
|
||||
if (updating) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (skeleton == nullptr)
|
||||
if (skeleton == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
updating = true;
|
||||
|
||||
|
|
@ -287,14 +294,16 @@ void BoneTransformEditor::set_toggle_enabled(const bool p_enabled) {
|
|||
}
|
||||
|
||||
void BoneTransformEditor::_key_button_pressed() {
|
||||
if (skeleton == nullptr)
|
||||
if (skeleton == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
const BoneId bone_id = property.get_slicec('/', 1).to_int();
|
||||
const String name = skeleton->get_bone_name(bone_id);
|
||||
|
||||
if (name.is_empty())
|
||||
if (name.is_empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Need to normalize the basis before you key it
|
||||
Transform tform = compute_transform_from_vector3s();
|
||||
|
|
@ -405,8 +414,9 @@ PhysicalBone3D *Skeleton3DEditor::create_physical_bone(int bone_id, int bone_chi
|
|||
Variant Skeleton3DEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
|
||||
TreeItem *selected = joint_tree->get_selected();
|
||||
|
||||
if (!selected)
|
||||
if (!selected) {
|
||||
return Variant();
|
||||
}
|
||||
|
||||
Ref<Texture> icon = selected->get_icon(0);
|
||||
|
||||
|
|
@ -431,27 +441,32 @@ Variant Skeleton3DEditor::get_drag_data_fw(const Point2 &p_point, Control *p_fro
|
|||
|
||||
bool Skeleton3DEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
|
||||
TreeItem *target = joint_tree->get_item_at_position(p_point);
|
||||
if (!target)
|
||||
if (!target) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const String path = target->get_metadata(0);
|
||||
if (!path.begins_with("bones/"))
|
||||
if (!path.begins_with("bones/")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TreeItem *selected = Object::cast_to<TreeItem>(Dictionary(p_data)["node"]);
|
||||
if (target == selected)
|
||||
if (target == selected) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const String path2 = target->get_metadata(0);
|
||||
if (!path2.begins_with("bones/"))
|
||||
if (!path2.begins_with("bones/")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Skeleton3DEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
||||
if (!can_drop_data_fw(p_point, p_data, p_from))
|
||||
if (!can_drop_data_fw(p_point, p_data, p_from)) {
|
||||
return;
|
||||
}
|
||||
|
||||
TreeItem *target = joint_tree->get_item_at_position(p_point);
|
||||
TreeItem *selected = Object::cast_to<TreeItem>(Dictionary(p_data)["node"]);
|
||||
|
|
@ -510,19 +525,23 @@ void Skeleton3DEditor::_joint_tree_rmb_select(const Vector2 &p_pos) {
|
|||
}
|
||||
|
||||
void Skeleton3DEditor::_update_properties() {
|
||||
if (rest_editor)
|
||||
if (rest_editor) {
|
||||
rest_editor->_update_properties();
|
||||
if (pose_editor)
|
||||
}
|
||||
if (pose_editor) {
|
||||
pose_editor->_update_properties();
|
||||
if (custom_pose_editor)
|
||||
}
|
||||
if (custom_pose_editor) {
|
||||
custom_pose_editor->_update_custom_pose_properties();
|
||||
}
|
||||
}
|
||||
|
||||
void Skeleton3DEditor::update_joint_tree() {
|
||||
joint_tree->clear();
|
||||
|
||||
if (skeleton == nullptr)
|
||||
if (skeleton == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
TreeItem *root = joint_tree->create_item();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue