summaryrefslogtreecommitdiff
path: root/editor/editor_properties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r--editor/editor_properties.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 24c229adfd..07df2cedd5 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -380,7 +380,7 @@ void EditorPropertyPath::_path_pressed() {
dialog->set_file_mode(save_mode ? EditorFileDialog::FILE_MODE_SAVE_FILE : EditorFileDialog::FILE_MODE_OPEN_FILE);
for (int i = 0; i < extensions.size(); i++) {
String e = extensions[i].strip_edges();
- if (e != String()) {
+ if (!e.is_empty()) {
dialog->add_filter(extensions[i].strip_edges());
}
}
@@ -706,7 +706,7 @@ void EditorPropertyFlags::setup(const Vector<String> &p_options) {
bool first = true;
for (int i = 0; i < p_options.size(); i++) {
String option = p_options[i].strip_edges();
- if (option != "") {
+ if (!option.is_empty()) {
CheckBox *cb = memnew(CheckBox);
cb->set_text(option);
cb->set_clip_text(true);
@@ -891,7 +891,7 @@ public:
Vector2 offset;
offset.y = rect2.size.y * 0.75;
- draw_string(font, rect2.position + offset, itos(layer_index + 1), HALIGN_CENTER, rect2.size.x, font_size, on ? text_color_on : text_color);
+ draw_string(font, rect2.position + offset, itos(layer_index + 1), HORIZONTAL_ALIGNMENT_CENTER, rect2.size.x, font_size, on ? text_color_on : text_color);
ofs.x += bsize + 1;
@@ -1055,7 +1055,7 @@ void EditorPropertyLayers::setup(LayerType p_layer_type) {
name = ProjectSettings::get_singleton()->get(basename + vformat("/layer_%d", i + 1));
}
- if (name == "") {
+ if (name.is_empty()) {
name = vformat(TTR("Layer %d"), i + 1);
}
@@ -1186,7 +1186,7 @@ void EditorPropertyObjectID::_edit_pressed() {
void EditorPropertyObjectID::update_property() {
String type = base_type;
- if (type == "") {
+ if (type.is_empty()) {
type = "Object";
}
@@ -1383,7 +1383,7 @@ void EditorPropertyEasing::_draw_easing() {
} else {
decimals = 1;
}
- f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), TS->format_number(rtos(exp).pad_decimals(decimals)), HALIGN_LEFT, -1, font_size, font_color);
+ f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), TS->format_number(rtos(exp).pad_decimals(decimals)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color);
}
void EditorPropertyEasing::update_property() {
@@ -3065,7 +3065,7 @@ void EditorPropertyResource::update_property() {
if (res.is_valid() && get_edited_object()->editor_is_section_unfolded(get_edited_property())) {
if (!sub_inspector) {
sub_inspector = memnew(EditorInspector);
- sub_inspector->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
+ sub_inspector->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
sub_inspector->set_use_doc_hints(true);
sub_inspector->set_sub_inspector(true);
@@ -3229,7 +3229,7 @@ static EditorPropertyRangeHint _parse_range_hint(PropertyHint p_hint, const Stri
}
}
- if ((hint.radians || degrees) && hint.suffix == String()) {
+ if ((hint.radians || degrees) && hint.suffix.is_empty()) {
hint.suffix = U"\u00B0";
}
@@ -3514,10 +3514,10 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
} break;
case Variant::NODE_PATH: {
EditorPropertyNodePath *editor = memnew(EditorPropertyNodePath);
- if (p_hint == PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE && p_hint_text != String()) {
+ if (p_hint == PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE && !p_hint_text.is_empty()) {
editor->setup(p_hint_text, Vector<StringName>(), (p_usage & PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT));
}
- if (p_hint == PROPERTY_HINT_NODE_PATH_VALID_TYPES && p_hint_text != String()) {
+ if (p_hint == PROPERTY_HINT_NODE_PATH_VALID_TYPES && !p_hint_text.is_empty()) {
Vector<String> types = p_hint_text.split(",", false);
Vector<StringName> sn = Variant(types); //convert via variant
editor->setup(NodePath(), sn, (p_usage & PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT));