diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 9db2f0a2879b..dd6c4018c682 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -215,12 +215,12 @@ class AnimationTrackKeyEdit : public Object { args.resize(p_value); d_new["args"] = args; change_notify_deserved = true; - } else if (name.begins_with("args/")) { + } else if (name.begins_with("args_")) { Vector args = d_old["args"]; - int idx = name.get_slice("/", 1).to_int(); + int idx = name.get_slicec('_', 1).to_int(); ERR_FAIL_INDEX_V(idx, args.size(), false); - String what = name.get_slice("/", 2); + String what = name.get_slicec('_', 2); if (what == "type") { Variant::Type t = Variant::Type(int(p_value)); @@ -444,11 +444,11 @@ class AnimationTrackKeyEdit : public Object { return true; } - if (name.begins_with("args/")) { - int idx = name.get_slice("/", 1).to_int(); + if (name.begins_with("args_")) { + int idx = name.get_slicec('_', 1).to_int(); ERR_FAIL_INDEX_V(idx, args.size(), false); - String what = name.get_slice("/", 2); + String what = name.get_slicec('_', 2); if (what == "type") { r_ret = args[idx].get_type(); return true; @@ -570,10 +570,12 @@ class AnimationTrackKeyEdit : public Object { vtypes += Variant::get_type_name(Variant::Type(i)); } + p_list->push_back(PropertyInfo(Variant::NIL, "Args", PROPERTY_HINT_NONE, "args_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < args.size(); i++) { - p_list->push_back(PropertyInfo(Variant::INT, "args/" + itos(i) + "/type", PROPERTY_HINT_ENUM, vtypes)); + p_list->push_back(PropertyInfo(Variant::NIL, itos(i), PROPERTY_HINT_NONE, "args_" + itos(i) + "_", PROPERTY_USAGE_SUBGROUP)); + p_list->push_back(PropertyInfo(Variant::INT, "args_" + itos(i) + "_type", PROPERTY_HINT_ENUM, vtypes)); if (args[i].get_type() != Variant::NIL) { - p_list->push_back(PropertyInfo(args[i].get_type(), "args/" + itos(i) + "/value")); + p_list->push_back(PropertyInfo(args[i].get_type(), "args_" + itos(i) + "_value")); } } @@ -825,12 +827,12 @@ class AnimationMultiTrackKeyEdit : public Object { args.resize(p_value); d_new["args"] = args; change_notify_deserved = true; - } else if (name.begins_with("args/")) { + } else if (name.begins_with("args_")) { Vector args = d_old["args"]; - int idx = name.get_slice("/", 1).to_int(); + int idx = name.get_slicec('_', 1).to_int(); ERR_FAIL_INDEX_V(idx, args.size(), false); - String what = name.get_slice("/", 2); + String what = name.get_slicec('_', 2); if (what == "type") { Variant::Type t = Variant::Type(int(p_value)); @@ -1044,11 +1046,11 @@ class AnimationMultiTrackKeyEdit : public Object { return true; } - if (name.begins_with("args/")) { - int idx = name.get_slice("/", 1).to_int(); + if (name.begins_with("args_")) { + int idx = name.get_slicec('_', 1).to_int(); ERR_FAIL_INDEX_V(idx, args.size(), false); - String what = name.get_slice("/", 2); + String what = name.get_slicec('_', 2); if (what == "type") { r_ret = args[idx].get_type(); return true; @@ -1213,10 +1215,12 @@ class AnimationMultiTrackKeyEdit : public Object { vtypes += Variant::get_type_name(Variant::Type(i)); } + p_list->push_back(PropertyInfo(Variant::NIL, "Args", PROPERTY_HINT_NONE, "args_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < args.size(); i++) { - p_list->push_back(PropertyInfo(Variant::INT, "args/" + itos(i) + "/type", PROPERTY_HINT_ENUM, vtypes)); + p_list->push_back(PropertyInfo(Variant::NIL, itos(i), PROPERTY_HINT_NONE, "args_" + itos(i) + "_", PROPERTY_USAGE_SUBGROUP)); + p_list->push_back(PropertyInfo(Variant::INT, "args_" + itos(i) + "_type", PROPERTY_HINT_ENUM, vtypes)); if (args[i].get_type() != Variant::NIL) { - p_list->push_back(PropertyInfo(args[i].get_type(), "args/" + itos(i) + "/value")); + p_list->push_back(PropertyInfo(args[i].get_type(), "args_" + itos(i) + "_value")); } } } break; diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp index 09defac354e8..60f732f04051 100644 --- a/editor/array_property_edit.cpp +++ b/editor/array_property_edit.cpp @@ -77,8 +77,8 @@ void ArrayPropertyEdit::_set_value(int p_idx, const Variant &p_value) { bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { String pn = p_name; - if (pn.begins_with("array/")) { - if (pn == "array/size") { + if (pn.begins_with("array_")) { + if (pn == "array_size") { Variant arr = get_array(); int size = arr.call("size"); @@ -114,16 +114,16 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { ur->commit_action(); return true; } - if (pn == "array/page") { + if (pn == "array_page") { page = p_value; notify_property_list_changed(); return true; } } else if (pn.begins_with("indices")) { - if (pn.find("_") != -1) { + if (pn.ends_with("type")) { //type - int idx = pn.get_slicec('/', 1).get_slicec('_', 0).to_int(); + int idx = pn.get_slicec('_', 1).to_int(); int type = p_value; @@ -146,7 +146,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) { return true; } else { - int idx = pn.get_slicec('/', 1).to_int(); + int idx = pn.get_slicec('_', 1).to_int(); Variant arr = get_array(); Variant value = arr.get(idx); @@ -168,19 +168,19 @@ bool ArrayPropertyEdit::_get(const StringName &p_name, Variant &r_ret) const { //int size = arr.call("size"); String pn = p_name; - if (pn.begins_with("array/")) { - if (pn == "array/size") { + if (pn.begins_with("array_")) { + if (pn == "array_size") { r_ret = arr.call("size"); return true; } - if (pn == "array/page") { + if (pn == "array_page") { r_ret = page; return true; } } else if (pn.begins_with("indices")) { - if (pn.find("_") != -1) { + if (pn.ends_with("type")) { //type - int idx = pn.get_slicec('/', 1).get_slicec('_', 0).to_int(); + int idx = pn.get_slicec('_', 1).to_int(); bool valid; r_ret = arr.get(idx, &valid); if (valid) { @@ -189,7 +189,7 @@ bool ArrayPropertyEdit::_get(const StringName &p_name, Variant &r_ret) const { return valid; } else { - int idx = pn.get_slicec('/', 1).to_int(); + int idx = pn.get_slicec('_', 1).to_int(); bool valid; r_ret = arr.get(idx, &valid); @@ -208,31 +208,33 @@ void ArrayPropertyEdit::_get_property_list(List *p_list) const { Variant arr = get_array(); int size = arr.call("size"); - p_list->push_back(PropertyInfo(Variant::INT, "array/size", PROPERTY_HINT_RANGE, "0,100000,1")); + p_list->push_back(PropertyInfo(Variant::NIL, "Array", PROPERTY_HINT_NONE, "array_", PROPERTY_USAGE_GROUP)); + p_list->push_back(PropertyInfo(Variant::INT, "array_size", PROPERTY_HINT_RANGE, "0,100000,1")); int pages = size / ITEMS_PER_PAGE; if (pages > 0) { - p_list->push_back(PropertyInfo(Variant::INT, "array/page", PROPERTY_HINT_RANGE, "0," + itos(pages) + ",1")); + p_list->push_back(PropertyInfo(Variant::INT, "array_page", PROPERTY_HINT_RANGE, "0," + itos(pages) + ",1")); } int offset = page * ITEMS_PER_PAGE; int items = MIN(size - offset, ITEMS_PER_PAGE); + p_list->push_back(PropertyInfo(Variant::NIL, "Indices", PROPERTY_HINT_NONE, "indices_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < items; i++) { Variant v = arr.get(i + offset); bool is_typed = arr.get_type() != Variant::ARRAY || subtype != Variant::NIL; if (!is_typed) { - p_list->push_back(PropertyInfo(Variant::INT, "indices/" + itos(i + offset) + "_type", PROPERTY_HINT_ENUM, vtypes)); + p_list->push_back(PropertyInfo(Variant::INT, "indices_" + itos(i + offset) + "_type", PROPERTY_HINT_ENUM, vtypes)); } if (v.get_type() == Variant::OBJECT && Object::cast_to(v)) { - p_list->push_back(PropertyInfo(Variant::INT, "indices/" + itos(i + offset), PROPERTY_HINT_OBJECT_ID, "Object")); + p_list->push_back(PropertyInfo(Variant::INT, "indices_" + itos(i + offset), PROPERTY_HINT_OBJECT_ID, "Object")); continue; } if (is_typed || v.get_type() != Variant::NIL) { - PropertyInfo pi(v.get_type(), "indices/" + itos(i + offset)); + PropertyInfo pi(v.get_type(), "indices_" + itos(i + offset)); if (subtype != Variant::NIL) { pi.type = Variant::Type(subtype); pi.hint = PropertyHint(subtype_hint); diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 0c1fb6fe4d1c..5ba5399fffc4 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -66,8 +66,8 @@ class ConnectDialogBinds : public Object { bool _set(const StringName &p_name, const Variant &p_value) { String name = p_name; - if (name.begins_with("bind/")) { - int which = name.get_slice("/", 1).to_int() - 1; + if (name.begins_with("bind_")) { + int which = name.get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(which, params.size(), false); params.write[which] = p_value; } else { @@ -80,8 +80,8 @@ class ConnectDialogBinds : public Object { bool _get(const StringName &p_name, Variant &r_ret) const { String name = p_name; - if (name.begins_with("bind/")) { - int which = name.get_slice("/", 1).to_int() - 1; + if (name.begins_with("bind_")) { + int which = name.get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(which, params.size(), false); r_ret = params[which]; } else { @@ -92,8 +92,9 @@ class ConnectDialogBinds : public Object { } void _get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Bind", PROPERTY_HINT_NONE, "bind_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < params.size(); i++) { - p_list->push_back(PropertyInfo(params[i].get_type(), "bind/" + itos(i + 1))); + p_list->push_back(PropertyInfo(params[i].get_type(), "bind_" + itos(i + 1))); } } diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index de688f270923..04d8693c07b7 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -38,7 +38,7 @@ bool EditorPropertyArrayObject::_set(const StringName &p_name, const Variant &p_ String pn = p_name; if (pn.begins_with("indices")) { - int idx = pn.get_slicec('/', 1).to_int(); + int idx = pn.get_slicec('_', 1).to_int(); array.set(idx, p_value); return true; } @@ -50,7 +50,7 @@ bool EditorPropertyArrayObject::_get(const StringName &p_name, Variant &r_ret) c String pn = p_name; if (pn.begins_with("indices")) { - int idx = pn.get_slicec('/', 1).to_int(); + int idx = pn.get_slicec('_', 1).to_int(); bool valid; r_ret = array.get(idx, &valid); if (r_ret.get_type() == Variant::OBJECT && Object::cast_to(r_ret)) { @@ -90,7 +90,7 @@ bool EditorPropertyDictionaryObject::_set(const StringName &p_name, const Varian } if (pn.begins_with("indices")) { - int idx = pn.get_slicec('/', 1).to_int(); + int idx = pn.get_slicec('_', 1).to_int(); Variant key = dict.get_key_at_index(idx); dict[key] = p_value; return true; @@ -113,7 +113,7 @@ bool EditorPropertyDictionaryObject::_get(const StringName &p_name, Variant &r_r } if (pn.begins_with("indices")) { - int idx = pn.get_slicec('/', 1).to_int(); + int idx = pn.get_slicec('_', 1).to_int(); Variant key = dict.get_key_at_index(idx); r_ret = dict[key]; if (r_ret.get_type() == Variant::OBJECT && Object::cast_to(r_ret)) { @@ -157,7 +157,7 @@ EditorPropertyDictionaryObject::EditorPropertyDictionaryObject() { void EditorPropertyArray::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) { if (p_property.begins_with("indices")) { - int idx = p_property.get_slice("/", 1).to_int(); + int idx = p_property.get_slicec('_', 1).to_int(); Variant array = object->get_array(); array.set(idx, p_value); emit_changed(get_edited_property(), array, "", true); @@ -322,7 +322,7 @@ void EditorPropertyArray::update_property() { object->set_array(array); for (int i = 0; i < amount; i++) { - String prop_name = "indices/" + itos(i + offset); + String prop_name = "indices_" + itos(i + offset); EditorProperty *prop = nullptr; Variant value = array.get(i + offset); @@ -554,7 +554,7 @@ void EditorPropertyArray::setup(Variant::Type p_array_type, const String &p_hint int hint_subtype_separator = p_hint_string.find(":"); if (hint_subtype_separator >= 0) { String subtype_string = p_hint_string.substr(0, hint_subtype_separator); - int slash_pos = subtype_string.find("/"); + int slash_pos = subtype_string.find("_"); if (slash_pos >= 0) { subtype_hint = PropertyHint(subtype_string.substr(slash_pos + 1, subtype_string.size() - slash_pos - 1).to_int()); subtype_string = subtype_string.substr(0, slash_pos); @@ -615,7 +615,7 @@ void EditorPropertyDictionary::_property_changed(const String &p_property, Varia } else if (p_property == "new_item_value") { object->set_new_item_value(p_value); } else if (p_property.begins_with("indices")) { - int idx = p_property.get_slice("/", 1).to_int(); + int idx = p_property.get_slicec('_', 1).to_int(); Dictionary dict = object->get_dict(); Variant key = dict.get_key_at_index(idx); dict[key] = p_value; @@ -762,7 +762,7 @@ void EditorPropertyDictionary::update_property() { Variant value; if (i < amount) { - prop_name = "indices/" + itos(i + offset); + prop_name = "indices_" + itos(i + offset); key = dict.get_key_at_index(i + offset); value = dict.get_value_at_index(i + offset); } else if (i == amount) { diff --git a/editor/plugins/font_editor_plugin.cpp b/editor/plugins/font_editor_plugin.cpp index fa58eb54804b..97886111498c 100644 --- a/editor/plugins/font_editor_plugin.cpp +++ b/editor/plugins/font_editor_plugin.cpp @@ -291,8 +291,8 @@ void EditorInspectorPluginFont::parse_begin(Object *p_object) { } bool EditorInspectorPluginFont::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { - if (p_path.begins_with("language_support_override/") && p_object->is_class("FontData")) { - String lang = p_path.replace("language_support_override/", ""); + if (p_path.begins_with("language_support_override_") && p_object->is_class("FontData")) { + String lang = p_path.replace("language_support_override_", ""); FontDataEditor *editor = memnew(FontDataEditor); if (lang != "_new") { @@ -305,8 +305,8 @@ bool EditorInspectorPluginFont::parse_property(Object *p_object, Variant::Type p return true; } - if (p_path.begins_with("script_support_override/") && p_object->is_class("FontData")) { - String script = p_path.replace("script_support_override/", ""); + if (p_path.begins_with("script_support_override_") && p_object->is_class("FontData")) { + String script = p_path.replace("script_support_override_", ""); FontDataEditor *editor = memnew(FontDataEditor); if (script != "_new") { diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp index 1ea6630622bc..e4be21a0b6a3 100644 --- a/editor/plugins/item_list_editor_plugin.cpp +++ b/editor/plugins/item_list_editor_plugin.cpp @@ -35,8 +35,8 @@ bool ItemListPlugin::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; - int idx = name.get_slice("/", 0).to_int(); - String what = name.get_slice("/", 1); + int idx = name.get_slicec('_', 0).to_int(); + String what = name.get_slicec('_', 1); if (what == "text") { set_item_text(idx, p_value); @@ -70,8 +70,8 @@ bool ItemListPlugin::_set(const StringName &p_name, const Variant &p_value) { bool ItemListPlugin::_get(const StringName &p_name, Variant &r_ret) const { String name = p_name; - int idx = name.get_slice("/", 0).to_int(); - String what = name.get_slice("/", 1); + int idx = name.get_slicec('_', 0).to_int(); + String what = name.get_slicec('_', 1); if (what == "text") { r_ret = get_item_text(idx); @@ -101,7 +101,8 @@ bool ItemListPlugin::_get(const StringName &p_name, Variant &r_ret) const { void ItemListPlugin::_get_property_list(List *p_list) const { for (int i = 0; i < get_item_count(); i++) { - String base = itos(i) + "/"; + String base = itos(i) + "_"; + p_list->push_back(PropertyInfo(Variant::NIL, itos(i), PROPERTY_HINT_NONE, base, PROPERTY_USAGE_GROUP)); p_list->push_back(PropertyInfo(Variant::STRING, base + "text")); p_list->push_back(PropertyInfo(Variant::OBJECT, base + "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D")); diff --git a/editor/plugins/ot_features_plugin.cpp b/editor/plugins/ot_features_plugin.cpp index ebfdf2c7cd06..ae7efd548a73 100644 --- a/editor/plugins/ot_features_plugin.cpp +++ b/editor/plugins/ot_features_plugin.cpp @@ -95,7 +95,7 @@ OpenTypeFeaturesEditor::OpenTypeFeaturesEditor() { /*************************************************************************/ void OpenTypeFeaturesAdd::_add_feature(int p_option) { - get_edited_object()->set("opentype_features/" + TS->tag_to_name(p_option), 1); + get_edited_object()->set("opentype_features_" + TS->tag_to_name(p_option), 1); } void OpenTypeFeaturesAdd::update_property() { @@ -192,7 +192,7 @@ void EditorInspectorPluginOpenTypeFeatures::parse_category(Object *p_object, con } bool EditorInspectorPluginOpenTypeFeatures::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { - if (p_path == "opentype_features/_new") { + if (p_path == "opentype_features__new") { OpenTypeFeaturesAdd *editor = memnew(OpenTypeFeaturesAdd); add_property_editor(p_path, editor); return true; diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index 404ef62eca39..8b83e5d1d87e 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -203,12 +203,12 @@ void BoneTransformEditor::_value_changed_transform(const String p_property_name, } void BoneTransformEditor::_change_transform(Transform p_new_transform) { - if (property.get_slicec('/', 0) == "bones" && property.get_slicec('/', 2) == "custom_pose") { + if (property.get_slicec('_', 0) == "bones" && property.get_slicec('_', 2) == "custom_pose") { undo_redo->create_action(TTR("Set Custom Bone Pose Transform"), UndoRedo::MERGE_ENDS); - undo_redo->add_undo_method(skeleton, "set_bone_custom_pose", property.get_slicec('/', 1).to_int(), skeleton->get_bone_custom_pose(property.get_slicec('/', 1).to_int())); - undo_redo->add_do_method(skeleton, "set_bone_custom_pose", property.get_slicec('/', 1).to_int(), p_new_transform); + undo_redo->add_undo_method(skeleton, "set_bone_custom_pose", property.get_slicec('_', 1).to_int(), skeleton->get_bone_custom_pose(property.get_slicec('_', 1).to_int())); + undo_redo->add_do_method(skeleton, "set_bone_custom_pose", property.get_slicec('_', 1).to_int(), p_new_transform); undo_redo->commit_action(); - } else if (property.get_slicec('/', 0) == "bones") { + } else if (property.get_slicec('_', 0) == "bones") { undo_redo->create_action(TTR("Set Bone Transform"), UndoRedo::MERGE_ENDS); undo_redo->add_undo_property(skeleton, property, skeleton->get(property)); undo_redo->add_do_property(skeleton, property, p_new_transform); @@ -218,7 +218,7 @@ void BoneTransformEditor::_change_transform(Transform p_new_transform) { void BoneTransformEditor::update_enabled_checkbox() { if (enabled_checkbox) { - const String path = "bones/" + property.get_slicec('/', 1) + "/enabled"; + const String path = "bones_" + property.get_slicec('_', 1) + "_enabled"; const bool is_enabled = skeleton->get(path); enabled_checkbox->set_pressed(is_enabled); } @@ -298,7 +298,7 @@ void BoneTransformEditor::_key_button_pressed() { return; } - const BoneId bone_id = property.get_slicec('/', 1).to_int(); + const BoneId bone_id = property.get_slicec('_', 1).to_int(); const String name = skeleton->get_bone_name(bone_id); if (name.is_empty()) { @@ -313,7 +313,7 @@ void BoneTransformEditor::_key_button_pressed() { void BoneTransformEditor::_checkbox_toggled(const bool p_toggled) { if (enabled_checkbox) { - const String path = "bones/" + property.get_slicec('/', 1) + "/enabled"; + const String path = "bones_" + property.get_slicec('_', 1) + "_enabled"; skeleton->set(path, p_toggled); } } @@ -446,7 +446,7 @@ bool Skeleton3DEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_ } const String path = target->get_metadata(0); - if (!path.begins_with("bones/")) { + if (!path.begins_with("bones_")) { return false; } @@ -456,7 +456,7 @@ bool Skeleton3DEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_ } const String path2 = target->get_metadata(0); - if (!path2.begins_with("bones/")) { + if (!path2.begins_with("bones_")) { return false; } @@ -471,8 +471,8 @@ void Skeleton3DEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data TreeItem *target = joint_tree->get_item_at_position(p_point); TreeItem *selected = Object::cast_to(Dictionary(p_data)["node"]); - const BoneId target_boneidx = String(target->get_metadata(0)).get_slicec('/', 1).to_int(); - const BoneId selected_boneidx = String(selected->get_metadata(0)).get_slicec('/', 1).to_int(); + const BoneId target_boneidx = String(target->get_metadata(0)).get_slicec('_', 1).to_int(); + const BoneId selected_boneidx = String(selected->get_metadata(0)).get_slicec('_', 1).to_int(); move_skeleton_bone(skeleton->get_path(), selected_boneidx, target_boneidx); } @@ -507,9 +507,9 @@ void Skeleton3DEditor::_joint_tree_selection_changed() { TreeItem *selected = joint_tree->get_selected(); const String path = selected->get_metadata(0); - if (path.begins_with("bones/")) { - const int b_idx = path.get_slicec('/', 1).to_int(); - const String bone_path = "bones/" + itos(b_idx) + "/"; + if (path.begins_with("bones_")) { + const int b_idx = path.get_slicec('_', 1).to_int(); + const String bone_path = "bones_" + itos(b_idx) + "_"; pose_editor->set_target(bone_path + "pose"); rest_editor->set_target(bone_path + "rest"); @@ -566,7 +566,7 @@ void Skeleton3DEditor::update_joint_tree() { joint_item->set_text(0, skeleton->get_bone_name(b_idx)); joint_item->set_icon(0, bone_icon); joint_item->set_selectable(0, true); - joint_item->set_metadata(0, "bones/" + itos(b_idx)); + joint_item->set_metadata(0, "bones_" + itos(b_idx)); } } diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 5f590383d0e7..1c2a46f115c9 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1019,7 +1019,7 @@ bool GDScript::_set(const StringName &p_name, const Variant &p_value) { } void GDScript::_get_property_list(List *p_properties) const { - p_properties->push_back(PropertyInfo(Variant::STRING, "script/source", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_properties->push_back(PropertyInfo(Variant::STRING, "script_source", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); } void GDScript::_bind_methods() { @@ -2244,7 +2244,7 @@ GDScriptLanguage::GDScriptLanguage() { strings._set = StaticCString::create("_set"); strings._get = StaticCString::create("_get"); strings._get_property_list = StaticCString::create("_get_property_list"); - strings._script_source = StaticCString::create("script/source"); + strings._script_source = StaticCString::create("script_source"); _debug_parse_err_line = -1; _debug_parse_err_file = ""; diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 02ec9ccd0651..e7bec1f01e0e 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -98,10 +98,10 @@ class VisualScriptEditorSignalEdit : public Object { return true; } - if (String(p_name).begins_with("argument/")) { - int idx = String(p_name).get_slice("/", 1).to_int() - 1; + if (String(p_name).begins_with("argument_")) { + int idx = String(p_name).get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(idx, script->custom_signal_get_argument_count(sig), false); - String what = String(p_name).get_slice("/", 2); + String what = String(p_name).get_slicec('_', 2); if (what == "type") { int old_type = script->custom_signal_get_argument_type(sig, idx); int new_type = p_value; @@ -136,10 +136,10 @@ class VisualScriptEditorSignalEdit : public Object { r_ret = script->custom_signal_get_argument_count(sig); return true; } - if (String(p_name).begins_with("argument/")) { - int idx = String(p_name).get_slice("/", 1).to_int() - 1; + if (String(p_name).begins_with("argument_")) { + int idx = String(p_name).get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(idx, script->custom_signal_get_argument_count(sig), false); - String what = String(p_name).get_slice("/", 2); + String what = String(p_name).get_slicec('_', 2); if (what == "type") { r_ret = script->custom_signal_get_argument_type(sig, idx); return true; @@ -163,9 +163,11 @@ class VisualScriptEditorSignalEdit : public Object { argt += "," + Variant::get_type_name(Variant::Type(i)); } + p_list->push_back(PropertyInfo(Variant::NIL, "Arguments", PROPERTY_HINT_NONE, "argument_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < script->custom_signal_get_argument_count(sig); i++) { - p_list->push_back(PropertyInfo(Variant::INT, "argument/" + itos(i + 1) + "/type", PROPERTY_HINT_ENUM, argt)); - p_list->push_back(PropertyInfo(Variant::STRING, "argument/" + itos(i + 1) + "/name")); + p_list->push_back(PropertyInfo(Variant::NIL, itos(i + 1), PROPERTY_HINT_NONE, "argument_" + itos(i + 1) + "_", PROPERTY_USAGE_SUBGROUP)); + p_list->push_back(PropertyInfo(Variant::INT, "argument_" + itos(i + 1) + "_type", PROPERTY_HINT_ENUM, argt)); + p_list->push_back(PropertyInfo(Variant::STRING, "argument_" + itos(i + 1) + "_name")); } } diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index cb4230bea998..00c60ce14517 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -68,10 +68,10 @@ bool VisualScriptExpression::_set(const StringName &p_name, const Variant &p_val } if (String(p_name).begins_with("input_")) { - int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int(); + int idx = String(p_name).get_slicec('_', 1).to_int(); ERR_FAIL_INDEX_V(idx, inputs.size(), false); - String what = String(p_name).get_slice("/", 1); + String what = String(p_name).get_slicec('_', 2); if (what == "type") { inputs.write[idx].type = Variant::Type(int(p_value)); @@ -111,10 +111,10 @@ bool VisualScriptExpression::_get(const StringName &p_name, Variant &r_ret) cons } if (String(p_name).begins_with("input_")) { - int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int(); + int idx = String(p_name).get_slicec('_', 1).to_int(); ERR_FAIL_INDEX_V(idx, inputs.size(), false); - String what = String(p_name).get_slice("/", 1); + String what = String(p_name).get_slicec('_', 2); if (what == "type") { r_ret = inputs[idx].type; @@ -141,9 +141,11 @@ void VisualScriptExpression::_get_property_list(List *p_list) cons p_list->push_back(PropertyInfo(Variant::INT, "input_count", PROPERTY_HINT_RANGE, "0,64,1")); p_list->push_back(PropertyInfo(Variant::BOOL, "sequenced")); + p_list->push_back(PropertyInfo(Variant::NIL, "Inputs", PROPERTY_HINT_NONE, "input_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < inputs.size(); i++) { - p_list->push_back(PropertyInfo(Variant::INT, "input_" + itos(i) + "/type", PROPERTY_HINT_ENUM, argt)); - p_list->push_back(PropertyInfo(Variant::STRING, "input_" + itos(i) + "/name")); + p_list->push_back(PropertyInfo(Variant::NIL, itos(i), PROPERTY_HINT_NONE, "input_" + itos(i) + "_", PROPERTY_USAGE_SUBGROUP)); + p_list->push_back(PropertyInfo(Variant::INT, "input_" + itos(i) + "_type", PROPERTY_HINT_ENUM, argt)); + p_list->push_back(PropertyInfo(Variant::STRING, "input_" + itos(i) + "_name")); } } diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index e977f9c96b42..b5879a24bf7f 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -633,8 +633,8 @@ bool VisualScriptSwitch::_set(const StringName &p_name, const Variant &p_value) return true; } - if (String(p_name).begins_with("case/")) { - int idx = String(p_name).get_slice("/", 1).to_int(); + if (String(p_name).begins_with("case_")) { + int idx = String(p_name).get_slicec('_', 1).to_int(); ERR_FAIL_INDEX_V(idx, case_values.size(), false); case_values.write[idx].type = Variant::Type(int(p_value)); @@ -653,8 +653,8 @@ bool VisualScriptSwitch::_get(const StringName &p_name, Variant &r_ret) const { return true; } - if (String(p_name).begins_with("case/")) { - int idx = String(p_name).get_slice("/", 1).to_int(); + if (String(p_name).begins_with("case_")) { + int idx = String(p_name).get_slicec('_', 1).to_int(); ERR_FAIL_INDEX_V(idx, case_values.size(), false); r_ret = case_values[idx].type; @@ -672,8 +672,9 @@ void VisualScriptSwitch::_get_property_list(List *p_list) const { argt += "," + Variant::get_type_name(Variant::Type(i)); } + p_list->push_back(PropertyInfo(Variant::NIL, "Cases", PROPERTY_HINT_NONE, "case_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < case_values.size(); i++) { - p_list->push_back(PropertyInfo(Variant::INT, "case/" + itos(i), PROPERTY_HINT_ENUM, argt)); + p_list->push_back(PropertyInfo(Variant::INT, "case_" + itos(i), PROPERTY_HINT_ENUM, argt)); } } diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index fed6637acb65..7678a711b141 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -61,9 +61,9 @@ bool VisualScriptFunction::_set(const StringName &p_name, const Variant &p_value return true; } if (String(p_name).begins_with("argument_")) { - int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int() - 1; + int idx = String(p_name).get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(idx, arguments.size(), false); - String what = String(p_name).get_slice("/", 1); + String what = String(p_name).get_slicec('_', 2); if (what == "type") { Variant::Type new_type = Variant::Type(int(p_value)); arguments.write[idx].type = new_type; @@ -79,22 +79,22 @@ bool VisualScriptFunction::_set(const StringName &p_name, const Variant &p_value } } - if (p_name == "stack/stackless") { + if (p_name == "stack_stackless") { set_stack_less(p_value); return true; } - if (p_name == "stack/size") { + if (p_name == "stack_size") { stack_size = p_value; return true; } - if (p_name == "rpc/mode") { + if (p_name == "rpc_mode") { rpc_mode = MultiplayerAPI::RPCMode(int(p_value)); return true; } - if (p_name == "sequenced/sequenced") { + if (p_name == "sequenced") { sequenced = p_value; ports_changed_notify(); return true; @@ -109,9 +109,9 @@ bool VisualScriptFunction::_get(const StringName &p_name, Variant &r_ret) const return true; } if (String(p_name).begins_with("argument_")) { - int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int() - 1; + int idx = String(p_name).get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(idx, arguments.size(), false); - String what = String(p_name).get_slice("/", 1); + String what = String(p_name).get_slicec('_', 2); if (what == "type") { r_ret = arguments[idx].type; return true; @@ -122,22 +122,22 @@ bool VisualScriptFunction::_get(const StringName &p_name, Variant &r_ret) const } } - if (p_name == "stack/stackless") { + if (p_name == "stack_stackless") { r_ret = stack_less; return true; } - if (p_name == "stack/size") { + if (p_name == "stack_size") { r_ret = stack_size; return true; } - if (p_name == "rpc/mode") { + if (p_name == "rpc_mode") { r_ret = rpc_mode; return true; } - if (p_name == "sequenced/sequenced") { + if (p_name == "sequenced") { r_ret = sequenced; return true; } @@ -153,17 +153,17 @@ void VisualScriptFunction::_get_property_list(List *p_list) const } for (int i = 0; i < arguments.size(); i++) { - p_list->push_back(PropertyInfo(Variant::INT, "argument_" + itos(i + 1) + "/type", PROPERTY_HINT_ENUM, argt)); - p_list->push_back(PropertyInfo(Variant::STRING, "argument_" + itos(i + 1) + "/name")); + p_list->push_back(PropertyInfo(Variant::INT, "argument_" + itos(i + 1) + "_type", PROPERTY_HINT_ENUM, argt)); + p_list->push_back(PropertyInfo(Variant::STRING, "argument_" + itos(i + 1) + "_name")); } - p_list->push_back(PropertyInfo(Variant::BOOL, "sequenced/sequenced")); + p_list->push_back(PropertyInfo(Variant::BOOL, "sequenced")); if (!stack_less) { - p_list->push_back(PropertyInfo(Variant::INT, "stack/size", PROPERTY_HINT_RANGE, "1,100000")); + p_list->push_back(PropertyInfo(Variant::INT, "stack_size", PROPERTY_HINT_RANGE, "1,100000")); } - p_list->push_back(PropertyInfo(Variant::BOOL, "stack/stackless")); - p_list->push_back(PropertyInfo(Variant::INT, "rpc/mode", PROPERTY_HINT_ENUM, "Disabled,Remote,Master,Puppet,Remote Sync,Master Sync,Puppet Sync")); + p_list->push_back(PropertyInfo(Variant::BOOL, "stack_stackless")); + p_list->push_back(PropertyInfo(Variant::INT, "rpc_mode", PROPERTY_HINT_ENUM, "Disabled,Remote,Master,Puppet,Remote Sync,Master Sync,Puppet Sync")); } int VisualScriptFunction::get_output_sequence_port_count() const { @@ -433,9 +433,9 @@ bool VisualScriptLists::_set(const StringName &p_name, const Variant &p_value) { return true; } if (String(p_name).begins_with("input_") && is_input_port_editable()) { - int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int() - 1; + int idx = String(p_name).get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(idx, inputports.size(), false); - String what = String(p_name).get_slice("/", 1); + String what = String(p_name).get_slicec('_', 2); if (what == "type") { Variant::Type new_type = Variant::Type(int(p_value)); inputports.write[idx].type = new_type; @@ -469,9 +469,9 @@ bool VisualScriptLists::_set(const StringName &p_name, const Variant &p_value) { return true; } if (String(p_name).begins_with("output_") && is_output_port_editable()) { - int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int() - 1; + int idx = String(p_name).get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(idx, outputports.size(), false); - String what = String(p_name).get_slice("/", 1); + String what = String(p_name).get_slicec('_', 1); if (what == "type") { Variant::Type new_type = Variant::Type(int(p_value)); outputports.write[idx].type = new_type; @@ -502,9 +502,9 @@ bool VisualScriptLists::_get(const StringName &p_name, Variant &r_ret) const { return true; } if (String(p_name).begins_with("input_") && is_input_port_editable()) { - int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int() - 1; + int idx = String(p_name).get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(idx, inputports.size(), false); - String what = String(p_name).get_slice("/", 1); + String what = String(p_name).get_slicec('_', 1); if (what == "type") { r_ret = inputports[idx].type; return true; @@ -520,9 +520,9 @@ bool VisualScriptLists::_get(const StringName &p_name, Variant &r_ret) const { return true; } if (String(p_name).begins_with("output_") && is_output_port_editable()) { - int idx = String(p_name).get_slicec('_', 1).get_slicec('/', 0).to_int() - 1; + int idx = String(p_name).get_slicec('_', 1).to_int() - 1; ERR_FAIL_INDEX_V(idx, outputports.size(), false); - String what = String(p_name).get_slice("/", 1); + String what = String(p_name).get_slicec('_', 1); if (what == "type") { r_ret = outputports[idx].type; return true; @@ -550,8 +550,8 @@ void VisualScriptLists::_get_property_list(List *p_list) const { } for (int i = 0; i < inputports.size(); i++) { - p_list->push_back(PropertyInfo(Variant::INT, "input_" + itos(i + 1) + "/type", PROPERTY_HINT_ENUM, argt)); - p_list->push_back(PropertyInfo(Variant::STRING, "input_" + itos(i + 1) + "/name")); + p_list->push_back(PropertyInfo(Variant::INT, "input_" + itos(i + 1) + "_type", PROPERTY_HINT_ENUM, argt)); + p_list->push_back(PropertyInfo(Variant::STRING, "input_" + itos(i + 1) + "_name")); } } @@ -563,11 +563,11 @@ void VisualScriptLists::_get_property_list(List *p_list) const { } for (int i = 0; i < outputports.size(); i++) { - p_list->push_back(PropertyInfo(Variant::INT, "output_" + itos(i + 1) + "/type", PROPERTY_HINT_ENUM, argt)); - p_list->push_back(PropertyInfo(Variant::STRING, "output_" + itos(i + 1) + "/name")); + p_list->push_back(PropertyInfo(Variant::INT, "output_" + itos(i + 1) + "_type", PROPERTY_HINT_ENUM, argt)); + p_list->push_back(PropertyInfo(Variant::STRING, "output_" + itos(i + 1) + "_name")); } } - p_list->push_back(PropertyInfo(Variant::BOOL, "sequenced/sequenced")); + p_list->push_back(PropertyInfo(Variant::BOOL, "sequenced")); } // input data port interaction diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 27d5487a1a8f..1f07351c4198 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -51,8 +51,8 @@ bool MeshInstance3D::_set(const StringName &p_name, const Variant &p_value) { return true; } - if (p_name.operator String().begins_with("surface_material_override/")) { - int idx = p_name.operator String().get_slicec('/', 1).to_int(); + if (p_name.operator String().begins_with("surface_material_override_")) { + int idx = p_name.operator String().get_slicec('_', 3).to_int(); if (idx >= surface_override_materials.size() || idx < 0) { return false; } @@ -75,8 +75,8 @@ bool MeshInstance3D::_get(const StringName &p_name, Variant &r_ret) const { return true; } - if (p_name.operator String().begins_with("surface_material_override/")) { - int idx = p_name.operator String().get_slicec('/', 1).to_int(); + if (p_name.operator String().begins_with("surface_material_override_")) { + int idx = p_name.operator String().get_slicec('_', 3).to_int(); if (idx >= surface_override_materials.size() || idx < 0) { return false; } @@ -99,8 +99,9 @@ void MeshInstance3D::_get_property_list(List *p_list) const { } if (mesh.is_valid()) { + p_list->push_back(PropertyInfo(Variant::NIL, "Materials", PROPERTY_HINT_NONE, "mateiral_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < mesh->get_surface_count(); i++) { - p_list->push_back(PropertyInfo(Variant::OBJECT, "surface_material_override/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,StandardMaterial3D", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "surface_material_override_" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,StandardMaterial3D", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE)); } } } diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 270ba834c25c..8b7a34c568e9 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -1290,19 +1290,19 @@ bool PhysicalBone3D::PinJointData::_set(const StringName &p_name, const Variant return true; } - if ("joint_constraints/bias" == p_name) { + if ("joint_constraints_bias" == p_name) { bias = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->pin_joint_set_param(j, PhysicsServer3D::PIN_JOINT_BIAS, bias); } - } else if ("joint_constraints/damping" == p_name) { + } else if ("joint_constraints_damping" == p_name) { damping = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->pin_joint_set_param(j, PhysicsServer3D::PIN_JOINT_DAMPING, damping); } - } else if ("joint_constraints/impulse_clamp" == p_name) { + } else if ("joint_constraints_impulse_clamp" == p_name) { impulse_clamp = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->pin_joint_set_param(j, PhysicsServer3D::PIN_JOINT_IMPULSE_CLAMP, impulse_clamp); @@ -1320,11 +1320,11 @@ bool PhysicalBone3D::PinJointData::_get(const StringName &p_name, Variant &r_ret return true; } - if ("joint_constraints/bias" == p_name) { + if ("joint_constraints_bias" == p_name) { r_ret = bias; - } else if ("joint_constraints/damping" == p_name) { + } else if ("joint_constraints_damping" == p_name) { r_ret = damping; - } else if ("joint_constraints/impulse_clamp" == p_name) { + } else if ("joint_constraints_impulse_clamp" == p_name) { r_ret = impulse_clamp; } else { return false; @@ -1336,9 +1336,10 @@ bool PhysicalBone3D::PinJointData::_get(const StringName &p_name, Variant &r_ret void PhysicalBone3D::PinJointData::_get_property_list(List *p_list) const { JointData::_get_property_list(p_list); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/damping", PROPERTY_HINT_RANGE, "0.01,8.0,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/impulse_clamp", PROPERTY_HINT_RANGE, "0.0,64.0,0.01")); + p_list->push_back(PropertyInfo(Variant::NIL, "Joint Constraints", PROPERTY_HINT_NONE, "joint_constraints_", PROPERTY_USAGE_GROUP)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_damping", PROPERTY_HINT_RANGE, "0.01,8.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_impulse_clamp", PROPERTY_HINT_RANGE, "0.0,64.0,0.01")); } bool PhysicalBone3D::ConeJointData::_set(const StringName &p_name, const Variant &p_value, RID j) { @@ -1346,31 +1347,31 @@ bool PhysicalBone3D::ConeJointData::_set(const StringName &p_name, const Variant return true; } - if ("joint_constraints/swing_span" == p_name) { + if ("joint_constraints_swing_span" == p_name) { swing_span = Math::deg2rad(real_t(p_value)); if (j.is_valid()) { PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_SWING_SPAN, swing_span); } - } else if ("joint_constraints/twist_span" == p_name) { + } else if ("joint_constraints_twist_span" == p_name) { twist_span = Math::deg2rad(real_t(p_value)); if (j.is_valid()) { PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_TWIST_SPAN, twist_span); } - } else if ("joint_constraints/bias" == p_name) { + } else if ("joint_constraints_bias" == p_name) { bias = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_BIAS, bias); } - } else if ("joint_constraints/softness" == p_name) { + } else if ("joint_constraints_softness" == p_name) { softness = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_SOFTNESS, softness); } - } else if ("joint_constraints/relaxation" == p_name) { + } else if ("joint_constraints_relaxation" == p_name) { relaxation = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer3D::CONE_TWIST_JOINT_RELAXATION, relaxation); @@ -1388,15 +1389,15 @@ bool PhysicalBone3D::ConeJointData::_get(const StringName &p_name, Variant &r_re return true; } - if ("joint_constraints/swing_span" == p_name) { + if ("joint_constraints_swing_span" == p_name) { r_ret = Math::rad2deg(swing_span); - } else if ("joint_constraints/twist_span" == p_name) { + } else if ("joint_constraints_twist_span" == p_name) { r_ret = Math::rad2deg(twist_span); - } else if ("joint_constraints/bias" == p_name) { + } else if ("joint_constraints_bias" == p_name) { r_ret = bias; - } else if ("joint_constraints/softness" == p_name) { + } else if ("joint_constraints_softness" == p_name) { r_ret = softness; - } else if ("joint_constraints/relaxation" == p_name) { + } else if ("joint_constraints_relaxation" == p_name) { r_ret = relaxation; } else { return false; @@ -1408,11 +1409,12 @@ bool PhysicalBone3D::ConeJointData::_get(const StringName &p_name, Variant &r_re void PhysicalBone3D::ConeJointData::_get_property_list(List *p_list) const { JointData::_get_property_list(p_list); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/swing_span", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/twist_span", PROPERTY_HINT_RANGE, "-40000,40000,0.1,or_lesser,or_greater")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/bias", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/relaxation", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::NIL, "Joint Constraints", PROPERTY_HINT_NONE, "joint_constraints_", PROPERTY_USAGE_GROUP)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_swing_span", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_twist_span", PROPERTY_HINT_RANGE, "-40000,40000,0.1,or_lesser,or_greater")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_bias", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_relaxation", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); } bool PhysicalBone3D::HingeJointData::_set(const StringName &p_name, const Variant &p_value, RID j) { @@ -1420,37 +1422,37 @@ bool PhysicalBone3D::HingeJointData::_set(const StringName &p_name, const Varian return true; } - if ("joint_constraints/angular_limit_enabled" == p_name) { + if ("joint_constraints_angular_limit_enabled" == p_name) { angular_limit_enabled = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->hinge_joint_set_flag(j, PhysicsServer3D::HINGE_JOINT_FLAG_USE_LIMIT, angular_limit_enabled); } - } else if ("joint_constraints/angular_limit_upper" == p_name) { + } else if ("joint_constraints_angular_limit_upper" == p_name) { angular_limit_upper = Math::deg2rad(real_t(p_value)); if (j.is_valid()) { PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_UPPER, angular_limit_upper); } - } else if ("joint_constraints/angular_limit_lower" == p_name) { + } else if ("joint_constraints_angular_limit_lower" == p_name) { angular_limit_lower = Math::deg2rad(real_t(p_value)); if (j.is_valid()) { PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_LOWER, angular_limit_lower); } - } else if ("joint_constraints/angular_limit_bias" == p_name) { + } else if ("joint_constraints_angular_limit_bias" == p_name) { angular_limit_bias = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_BIAS, angular_limit_bias); } - } else if ("joint_constraints/angular_limit_softness" == p_name) { + } else if ("joint_constraints_angular_limit_softness" == p_name) { angular_limit_softness = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_SOFTNESS, angular_limit_softness); } - } else if ("joint_constraints/angular_limit_relaxation" == p_name) { + } else if ("joint_constraints_angular_limit_relaxation" == p_name) { angular_limit_relaxation = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->hinge_joint_set_param(j, PhysicsServer3D::HINGE_JOINT_LIMIT_RELAXATION, angular_limit_relaxation); @@ -1468,17 +1470,17 @@ bool PhysicalBone3D::HingeJointData::_get(const StringName &p_name, Variant &r_r return true; } - if ("joint_constraints/angular_limit_enabled" == p_name) { + if ("joint_constraints_angular_limit_enabled" == p_name) { r_ret = angular_limit_enabled; - } else if ("joint_constraints/angular_limit_upper" == p_name) { + } else if ("joint_constraints_angular_limit_upper" == p_name) { r_ret = Math::rad2deg(angular_limit_upper); - } else if ("joint_constraints/angular_limit_lower" == p_name) { + } else if ("joint_constraints_angular_limit_lower" == p_name) { r_ret = Math::rad2deg(angular_limit_lower); - } else if ("joint_constraints/angular_limit_bias" == p_name) { + } else if ("joint_constraints_angular_limit_bias" == p_name) { r_ret = angular_limit_bias; - } else if ("joint_constraints/angular_limit_softness" == p_name) { + } else if ("joint_constraints_angular_limit_softness" == p_name) { r_ret = angular_limit_softness; - } else if ("joint_constraints/angular_limit_relaxation" == p_name) { + } else if ("joint_constraints_angular_limit_relaxation" == p_name) { r_ret = angular_limit_relaxation; } else { return false; @@ -1490,12 +1492,12 @@ bool PhysicalBone3D::HingeJointData::_get(const StringName &p_name, Variant &r_r void PhysicalBone3D::HingeJointData::_get_property_list(List *p_list) const { JointData::_get_property_list(p_list); - p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/angular_limit_enabled")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_relaxation", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints_angular_limit_enabled")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_relaxation", PROPERTY_HINT_RANGE, "0.01,16,0.01")); } bool PhysicalBone3D::SliderJointData::_set(const StringName &p_name, const Variant &p_value, RID j) { @@ -1503,61 +1505,61 @@ bool PhysicalBone3D::SliderJointData::_set(const StringName &p_name, const Varia return true; } - if ("joint_constraints/linear_limit_upper" == p_name) { + if ("joint_constraints_linear_limit_upper" == p_name) { linear_limit_upper = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_UPPER, linear_limit_upper); } - } else if ("joint_constraints/linear_limit_lower" == p_name) { + } else if ("joint_constraints_linear_limit_lower" == p_name) { linear_limit_lower = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_LOWER, linear_limit_lower); } - } else if ("joint_constraints/linear_limit_softness" == p_name) { + } else if ("joint_constraints_linear_limit_softness" == p_name) { linear_limit_softness = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS, linear_limit_softness); } - } else if ("joint_constraints/linear_limit_restitution" == p_name) { + } else if ("joint_constraints_linear_limit_restitution" == p_name) { linear_limit_restitution = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION, linear_limit_restitution); } - } else if ("joint_constraints/linear_limit_damping" == p_name) { + } else if ("joint_constraints_linear_limit_damping" == p_name) { linear_limit_damping = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_LINEAR_LIMIT_DAMPING, linear_limit_restitution); } - } else if ("joint_constraints/angular_limit_upper" == p_name) { + } else if ("joint_constraints_angular_limit_upper" == p_name) { angular_limit_upper = Math::deg2rad(real_t(p_value)); if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_UPPER, angular_limit_upper); } - } else if ("joint_constraints/angular_limit_lower" == p_name) { + } else if ("joint_constraints_angular_limit_lower" == p_name) { angular_limit_lower = Math::deg2rad(real_t(p_value)); if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_LOWER, angular_limit_lower); } - } else if ("joint_constraints/angular_limit_softness" == p_name) { + } else if ("joint_constraints_angular_limit_softness" == p_name) { angular_limit_softness = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, angular_limit_softness); } - } else if ("joint_constraints/angular_limit_restitution" == p_name) { + } else if ("joint_constraints_angular_limit_restitution" == p_name) { angular_limit_restitution = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, angular_limit_softness); } - } else if ("joint_constraints/angular_limit_damping" == p_name) { + } else if ("joint_constraints_angular_limit_damping" == p_name) { angular_limit_damping = p_value; if (j.is_valid()) { PhysicsServer3D::get_singleton()->slider_joint_set_param(j, PhysicsServer3D::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING, angular_limit_damping); @@ -1575,25 +1577,25 @@ bool PhysicalBone3D::SliderJointData::_get(const StringName &p_name, Variant &r_ return true; } - if ("joint_constraints/linear_limit_upper" == p_name) { + if ("joint_constraints_linear_limit_upper" == p_name) { r_ret = linear_limit_upper; - } else if ("joint_constraints/linear_limit_lower" == p_name) { + } else if ("joint_constraints_linear_limit_lower" == p_name) { r_ret = linear_limit_lower; - } else if ("joint_constraints/linear_limit_softness" == p_name) { + } else if ("joint_constraints_linear_limit_softness" == p_name) { r_ret = linear_limit_softness; - } else if ("joint_constraints/linear_limit_restitution" == p_name) { + } else if ("joint_constraints_linear_limit_restitution" == p_name) { r_ret = linear_limit_restitution; - } else if ("joint_constraints/linear_limit_damping" == p_name) { + } else if ("joint_constraints_linear_limit_damping" == p_name) { r_ret = linear_limit_damping; - } else if ("joint_constraints/angular_limit_upper" == p_name) { + } else if ("joint_constraints_angular_limit_upper" == p_name) { r_ret = Math::rad2deg(angular_limit_upper); - } else if ("joint_constraints/angular_limit_lower" == p_name) { + } else if ("joint_constraints_angular_limit_lower" == p_name) { r_ret = Math::rad2deg(angular_limit_lower); - } else if ("joint_constraints/angular_limit_softness" == p_name) { + } else if ("joint_constraints_angular_limit_softness" == p_name) { r_ret = angular_limit_softness; - } else if ("joint_constraints/angular_limit_restitution" == p_name) { + } else if ("joint_constraints_angular_limit_restitution" == p_name) { r_ret = angular_limit_restitution; - } else if ("joint_constraints/angular_limit_damping" == p_name) { + } else if ("joint_constraints_angular_limit_damping" == p_name) { r_ret = angular_limit_damping; } else { return false; @@ -1605,17 +1607,18 @@ bool PhysicalBone3D::SliderJointData::_get(const StringName &p_name, Variant &r_ void PhysicalBone3D::SliderJointData::_get_property_list(List *p_list) const { JointData::_get_property_list(p_list); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_upper")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_lower")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/linear_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::NIL, "Joint Constraints", PROPERTY_HINT_NONE, "joint_constraints_", PROPERTY_USAGE_GROUP)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_linear_limit_upper")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_linear_limit_lower")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_linear_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_linear_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/angular_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_angular_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01")); } bool PhysicalBone3D::SixDOFJointData::_set(const StringName &p_name, const Variant &p_value, RID j) { @@ -1631,7 +1634,7 @@ bool PhysicalBone3D::SixDOFJointData::_set(const StringName &p_name, const Varia Vector3::Axis axis; { - const String axis_s = path.get_slicec('/', 1); + const String axis_s = path.get_slicec('_', 1); if ("x" == axis_s) { axis = Vector3::AXIS_X; } else if ("y" == axis_s) { @@ -1643,7 +1646,7 @@ bool PhysicalBone3D::SixDOFJointData::_set(const StringName &p_name, const Varia } } - String var_name = path.get_slicec('/', 2); + String var_name = path.get_slicec('_', 2); if ("linear_limit_enabled" == var_name) { axis_data[axis].linear_limit_enabled = p_value; @@ -1791,7 +1794,7 @@ bool PhysicalBone3D::SixDOFJointData::_get(const StringName &p_name, Variant &r_ int axis; { - const String axis_s = path.get_slicec('/', 1); + const String axis_s = path.get_slicec('_', 1); if ("x" == axis_s) { axis = 0; } else if ("y" == axis_s) { @@ -1803,7 +1806,7 @@ bool PhysicalBone3D::SixDOFJointData::_get(const StringName &p_name, Variant &r_ } } - String var_name = path.get_slicec('/', 2); + String var_name = path.get_slicec('_', 2); if ("linear_limit_enabled" == var_name) { r_ret = axis_data[axis].linear_limit_enabled; @@ -1856,28 +1859,30 @@ bool PhysicalBone3D::SixDOFJointData::_get(const StringName &p_name, Variant &r_ void PhysicalBone3D::SixDOFJointData::_get_property_list(List *p_list) const { const StringName axis_names[] = { "x", "y", "z" }; + p_list->push_back(PropertyInfo(Variant::NIL, "Joint Constraints", PROPERTY_HINT_NONE, "joint_constraints_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < 3; ++i) { - p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/linear_limit_enabled")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_limit_upper")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_limit_lower")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/linear_spring_enabled")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_spring_stiffness")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_spring_damping")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_equilibrium_point")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/linear_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/angular_limit_enabled")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/erp")); - p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/angular_spring_enabled")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_spring_stiffness")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_spring_damping")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints/" + axis_names[i] + "/angular_equilibrium_point")); + p_list->push_back(PropertyInfo(Variant::NIL, axis_names[i], PROPERTY_HINT_NONE, "joint_constraints_" + axis_names[i] + "_", PROPERTY_USAGE_SUBGROUP)); + p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints_" + axis_names[i] + "_linear_limit_enabled")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_linear_limit_upper")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_linear_limit_lower")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints_" + axis_names[i] + "_linear_spring_enabled")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_linear_spring_stiffness")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_linear_spring_damping")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_linear_equilibrium_point")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_linear_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_linear_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints_" + axis_names[i] + "_angular_limit_enabled")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_angular_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_angular_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_erp")); + p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints_" + axis_names[i] + "_angular_spring_enabled")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_angular_spring_stiffness")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_angular_spring_damping")); + p_list->push_back(PropertyInfo(Variant::FLOAT, "joint_constraints_" + axis_names[i] + "_angular_equilibrium_point")); } } diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index ebbb8985c909..ff5f286a9a1a 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -72,12 +72,12 @@ SkinReference::~SkinReference() { bool Skeleton3D::_set(const StringName &p_path, const Variant &p_value) { String path = p_path; - if (!path.begins_with("bones/")) { + if (!path.begins_with("bones_")) { return false; } - int which = path.get_slicec('/', 1).to_int(); - String what = path.get_slicec('/', 2); + int which = path.get_slicec('_', 1).to_int(); + String what = path.get_slicec('_', 2); if (which == bones.size() && what == "name") { add_bone(p_value); @@ -118,12 +118,12 @@ bool Skeleton3D::_set(const StringName &p_path, const Variant &p_value) { bool Skeleton3D::_get(const StringName &p_path, Variant &r_ret) const { String path = p_path; - if (!path.begins_with("bones/")) { + if (!path.begins_with("bones_")) { return false; } - int which = path.get_slicec('/', 1).to_int(); - String what = path.get_slicec('/', 2); + int which = path.get_slicec('_', 1).to_int(); + String what = path.get_slicec('_', 2); ERR_FAIL_INDEX_V(which, bones.size(), false); @@ -158,8 +158,10 @@ bool Skeleton3D::_get(const StringName &p_path, Variant &r_ret) const { } void Skeleton3D::_get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Bones", PROPERTY_HINT_NONE, "bones_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < bones.size(); i++) { - String prep = "bones/" + itos(i) + "/"; + p_list->push_back(PropertyInfo(Variant::NIL, itos(i), PROPERTY_HINT_NONE, "bones_" + itos(i) + "_", PROPERTY_USAGE_SUBGROUP)); + String prep = "bones_" + itos(i) + "_"; p_list->push_back(PropertyInfo(Variant::STRING, prep + "name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::INT, prep + "parent", PROPERTY_HINT_RANGE, "-1," + itos(bones.size() - 1) + ",1", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::TRANSFORM, prep + "rest", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp index dc4deb0570dc..a4e2fa76b4bc 100644 --- a/scene/3d/soft_body_3d.cpp +++ b/scene/3d/soft_body_3d.cpp @@ -124,14 +124,14 @@ void SoftBody3D::_update_pickable() { bool SoftBody3D::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; - String which = name.get_slicec('/', 0); + String which = name.get_slicec('_', 0); if ("pinned_points" == which) { return _set_property_pinned_points_indices(p_value); } else if ("attachments" == which) { - int idx = name.get_slicec('/', 1).to_int(); - String what = name.get_slicec('/', 2); + int idx = name.get_slicec('_', 1).to_int(); + String what = name.get_slicec('_', 2); return _set_property_pinned_points_attachment(idx, what, p_value); } @@ -141,7 +141,7 @@ bool SoftBody3D::_set(const StringName &p_name, const Variant &p_value) { bool SoftBody3D::_get(const StringName &p_name, Variant &r_ret) const { String name = p_name; - String which = name.get_slicec('/', 0); + String which = name.get_slicec('_', 0); if ("pinned_points" == which) { Array arr_ret; @@ -157,8 +157,8 @@ bool SoftBody3D::_get(const StringName &p_name, Variant &r_ret) const { return true; } else if ("attachments" == which) { - int idx = name.get_slicec('/', 1).to_int(); - String what = name.get_slicec('/', 2); + int idx = name.get_slicec('_', 1).to_int(); + String what = name.get_slicec('_', 2); return _get_property_pinned_points(idx, what, r_ret); } @@ -171,10 +171,12 @@ void SoftBody3D::_get_property_list(List *p_list) const { p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, "pinned_points")); + p_list->push_back(PropertyInfo(Variant::NIL, "Attachements", PROPERTY_HINT_NONE, "attachments_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < pinned_points_indices_size; ++i) { - p_list->push_back(PropertyInfo(Variant::INT, "attachments/" + itos(i) + "/point_index")); - p_list->push_back(PropertyInfo(Variant::NODE_PATH, "attachments/" + itos(i) + "/spatial_attachment_path")); - p_list->push_back(PropertyInfo(Variant::VECTOR3, "attachments/" + itos(i) + "/offset")); + p_list->push_back(PropertyInfo(Variant::NIL, itos(i), PROPERTY_HINT_NONE, "attachments_" + itos(i) + "_", PROPERTY_USAGE_SUBGROUP)); + p_list->push_back(PropertyInfo(Variant::INT, "attachments_" + itos(i) + "_point")); + p_list->push_back(PropertyInfo(Variant::NODE_PATH, "attachments_" + itos(i) + "_path")); + p_list->push_back(PropertyInfo(Variant::VECTOR3, "attachments_" + itos(i) + "_offset")); } } @@ -212,7 +214,7 @@ bool SoftBody3D::_set_property_pinned_points_attachment(int p_item, const String return false; } - if ("spatial_attachment_path" == p_what) { + if ("path" == p_what) { PinnedPoint *w = pinned_points.ptrw(); pin_point(w[p_item].point_index, true, p_value); _make_cache_dirty(); @@ -232,9 +234,9 @@ bool SoftBody3D::_get_property_pinned_points(int p_item, const String &p_what, V } const PinnedPoint *r = pinned_points.ptr(); - if ("point_index" == p_what) { + if ("point" == p_what) { r_ret = r[p_item].point_index; - } else if ("spatial_attachment_path" == p_what) { + } else if ("path" == p_what) { r_ret = r[p_item].spatial_attachment_path; } else if ("offset" == p_what) { r_ret = r[p_item].offset; diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index 4196b0b8fc5d..91585752c352 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -1033,9 +1033,9 @@ Ref AnimationNodeBlendTree::get_child_by_name(const StringName &p bool AnimationNodeBlendTree::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; - if (name.begins_with("nodes/")) { - String node_name = name.get_slicec('/', 1); - String what = name.get_slicec('/', 2); + if (name.begins_with("nodes_")) { + String node_name = name.get_slicec('_', 1); + String what = name.get_slicec('_', 2); if (what == "node") { Ref anode = p_value; @@ -1066,9 +1066,9 @@ bool AnimationNodeBlendTree::_set(const StringName &p_name, const Variant &p_val bool AnimationNodeBlendTree::_get(const StringName &p_name, Variant &r_ret) const { String name = p_name; - if (name.begins_with("nodes/")) { - String node_name = name.get_slicec('/', 1); - String what = name.get_slicec('/', 2); + if (name.begins_with("nodes_")) { + String node_name = name.get_slicec('_', 1); + String what = name.get_slicec('_', 2); if (what == "node") { if (nodes.has(node_name)) { @@ -1114,9 +1114,9 @@ void AnimationNodeBlendTree::_get_property_list(List *p_list) cons for (List::Element *E = names.front(); E; E = E->next()) { String name = E->get(); if (name != "output") { - p_list->push_back(PropertyInfo(Variant::OBJECT, "nodes/" + name + "/node", PROPERTY_HINT_RESOURCE_TYPE, "AnimationNode", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "nodes_" + name + "_node", PROPERTY_HINT_RESOURCE_TYPE, "AnimationNode", PROPERTY_USAGE_NOEDITOR)); } - p_list->push_back(PropertyInfo(Variant::VECTOR2, "nodes/" + name + "/position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, "nodes_" + name + "_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); } p_list->push_back(PropertyInfo(Variant::ARRAY, "node_connections", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 246fff6d5796..17e0abc1b822 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -810,9 +810,9 @@ Ref AnimationNodeStateMachine::get_child_by_name(const StringName bool AnimationNodeStateMachine::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; - if (name.begins_with("states/")) { - String node_name = name.get_slicec('/', 1); - String what = name.get_slicec('/', 2); + if (name.begins_with("states_")) { + String node_name = name.get_slicec('_', 1); + String what = name.get_slicec('_', 2); if (what == "node") { Ref anode = p_value; @@ -852,9 +852,9 @@ bool AnimationNodeStateMachine::_set(const StringName &p_name, const Variant &p_ bool AnimationNodeStateMachine::_get(const StringName &p_name, Variant &r_ret) const { String name = p_name; - if (name.begins_with("states/")) { - String node_name = name.get_slicec('/', 1); - String what = name.get_slicec('/', 2); + if (name.begins_with("states_")) { + String node_name = name.get_slicec('_', 1); + String what = name.get_slicec('_', 2); if (what == "node") { if (states.has(node_name)) { @@ -904,8 +904,8 @@ void AnimationNodeStateMachine::_get_property_list(List *p_list) c for (List::Element *E = names.front(); E; E = E->next()) { String name = E->get(); - p_list->push_back(PropertyInfo(Variant::OBJECT, "states/" + name + "/node", PROPERTY_HINT_RESOURCE_TYPE, "AnimationNode", PROPERTY_USAGE_NOEDITOR)); - p_list->push_back(PropertyInfo(Variant::VECTOR2, "states/" + name + "/position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "states_" + name + "_node", PROPERTY_HINT_RESOURCE_TYPE, "AnimationNode", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, "states_" + name + "_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); } p_list->push_back(PropertyInfo(Variant::ARRAY, "transitions", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 0c1798a876a3..39843c6d8ee2 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -74,16 +74,12 @@ void AnimatedValuesBackup::_bind_methods() { bool AnimationPlayer::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; - if (name.begins_with("playback/play")) { // bw compatibility - - set_current_animation(p_value); - - } else if (name.begins_with("anims/")) { - String which = name.get_slicec('/', 1); + if (name.begins_with("anims_")) { + String which = name.get_slicec('_', 1); add_animation(which, p_value); - } else if (name.begins_with("next/")) { - String which = name.get_slicec('/', 1); + } else if (name.begins_with("next_")) { + String which = name.get_slicec('_', 1); animation_set_next(which, p_value); } else if (p_name == SceneStringNames::get_singleton()->blend_times) { @@ -109,16 +105,12 @@ bool AnimationPlayer::_set(const StringName &p_name, const Variant &p_value) { bool AnimationPlayer::_get(const StringName &p_name, Variant &r_ret) const { String name = p_name; - if (name == "playback/play") { // bw compatibility - - r_ret = get_current_animation(); - - } else if (name.begins_with("anims/")) { - String which = name.get_slicec('/', 1); + if (name.begins_with("anims_")) { + String which = name.get_slicec('_', 1); r_ret = get_animation(which); - } else if (name.begins_with("next/")) { - String which = name.get_slicec('/', 1); + } else if (name.begins_with("next_")) { + String which = name.get_slicec('_', 1); r_ret = animation_get_next(which); @@ -168,9 +160,9 @@ void AnimationPlayer::_get_property_list(List *p_list) const { List anim_names; for (Map::Element *E = animation_set.front(); E; E = E->next()) { - anim_names.push_back(PropertyInfo(Variant::OBJECT, "anims/" + String(E->key()), PROPERTY_HINT_RESOURCE_TYPE, "Animation", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE)); + anim_names.push_back(PropertyInfo(Variant::OBJECT, "anims_" + String(E->key()), PROPERTY_HINT_RESOURCE_TYPE, "Animation", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE)); if (E->get().next != StringName()) { - anim_names.push_back(PropertyInfo(Variant::STRING, "next/" + String(E->key()), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + anim_names.push_back(PropertyInfo(Variant::STRING, "next_" + String(E->key()), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); } } diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 20308087242d..bab1e268cb2a 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -129,15 +129,15 @@ void Tween::_process_pending_commands() { bool Tween::_set(const StringName &p_name, const Variant &p_value) { // Set the correct attribute based on the given name String name = p_name; - if (name == "playback/speed" || name == "speed") { // Backwards compatibility + if (name == "playback_speed" || name == "speed") { // Backwards compatibility set_speed_scale(p_value); return true; - } else if (name == "playback/active") { + } else if (name == "playback_active") { set_active(p_value); return true; - } else if (name == "playback/repeat") { + } else if (name == "playback_repeat") { set_repeat(p_value); return true; } @@ -147,28 +147,21 @@ bool Tween::_set(const StringName &p_name, const Variant &p_value) { bool Tween::_get(const StringName &p_name, Variant &r_ret) const { // Get the correct attribute based on the given name String name = p_name; - if (name == "playback/speed") { // Backwards compatibility + if (name == "playback_speed") { // Backwards compatibility r_ret = speed_scale; return true; - } else if (name == "playback/active") { + } else if (name == "playback_active") { r_ret = is_active(); return true; - } else if (name == "playback/repeat") { + } else if (name == "playback_repeat") { r_ret = is_repeat(); return true; } return false; } -void Tween::_get_property_list(List *p_list) const { - // Add the property info for the Tween object - p_list->push_back(PropertyInfo(Variant::BOOL, "playback/active", PROPERTY_HINT_NONE, "")); - p_list->push_back(PropertyInfo(Variant::BOOL, "playback/repeat", PROPERTY_HINT_NONE, "")); - p_list->push_back(PropertyInfo(Variant::FLOAT, "playback/speed", PROPERTY_HINT_RANGE, "-64,64,0.01")); -} - void Tween::_notification(int p_what) { // What notification did we receive? switch (p_what) { diff --git a/scene/animation/tween.h b/scene/animation/tween.h index 142c0c65e0d5..9afbab89c988 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -140,7 +140,6 @@ class Tween : public Node { protected: bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; - void _get_property_list(List *p_list) const; void _notification(int p_what); static void _bind_methods(); diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index b0bcde8865ee..4a3f919c4446 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -459,8 +459,8 @@ Button::TextAlign Button::get_text_align() const { bool Button::_set(const StringName &p_name, const Variant &p_value) { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); double value = p_value; if (value == -1) { @@ -485,8 +485,8 @@ bool Button::_set(const StringName &p_name, const Variant &p_value) { bool Button::_get(const StringName &p_name, Variant &r_ret) const { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); if (opentype_features.has(tag)) { r_ret = opentype_features[tag]; @@ -500,11 +500,12 @@ bool Button::_get(const StringName &p_name, Variant &r_ret) const { } void Button::_get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Opentype Features", PROPERTY_HINT_NONE, "opentype_features_", PROPERTY_USAGE_GROUP)); for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features/" + name)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features_" + name)); } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features__new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); } void Button::_bind_methods() { diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 191f94b2b847..93f8f6132d3e 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -221,37 +221,37 @@ bool Control::_set(const StringName &p_name, const Variant &p_value) { } if (p_value.get_type() == Variant::NIL) { - if (name.begins_with("custom_icons/")) { - String dname = name.get_slicec('/', 1); + if (name.begins_with("custom_icons_")) { + String dname = name.get_slicec('_', 2); if (data.icon_override.has(dname)) { data.icon_override[dname]->disconnect("changed", callable_mp(this, &Control::_override_changed)); } data.icon_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); - } else if (name.begins_with("custom_styles/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_styles_")) { + String dname = name.get_slicec('_', 2); if (data.style_override.has(dname)) { data.style_override[dname]->disconnect("changed", callable_mp(this, &Control::_override_changed)); } data.style_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); - } else if (name.begins_with("custom_fonts/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_fonts_")) { + String dname = name.get_slicec('_', 2); if (data.font_override.has(dname)) { data.font_override[dname]->disconnect("changed", callable_mp(this, &Control::_override_changed)); } data.font_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); - } else if (name.begins_with("custom_font_sizes/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_font_sizes_")) { + String dname = name.get_slicec('_', 3); data.font_size_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); - } else if (name.begins_with("custom_colors/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_colors_")) { + String dname = name.get_slicec('_', 2); data.color_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); - } else if (name.begins_with("custom_constants/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_constants_")) { + String dname = name.get_slicec('_', 2); data.constant_override.erase(dname); notification(NOTIFICATION_THEME_CHANGED); } else { @@ -259,23 +259,23 @@ bool Control::_set(const StringName &p_name, const Variant &p_value) { } } else { - if (name.begins_with("custom_icons/")) { - String dname = name.get_slicec('/', 1); + if (name.begins_with("custom_icons_")) { + String dname = name.get_slicec('_', 2); add_theme_icon_override(dname, p_value); - } else if (name.begins_with("custom_styles/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_styles_")) { + String dname = name.get_slicec('_', 2); add_theme_style_override(dname, p_value); - } else if (name.begins_with("custom_fonts/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_fonts_")) { + String dname = name.get_slicec('_', 2); add_theme_font_override(dname, p_value); - } else if (name.begins_with("custom_font_sizes/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_font_sizes_")) { + String dname = name.get_slicec('_', 3); add_theme_font_size_override(dname, p_value); - } else if (name.begins_with("custom_colors/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_colors_")) { + String dname = name.get_slicec('_', 2); add_theme_color_override(dname, p_value); - } else if (name.begins_with("custom_constants/")) { - String dname = name.get_slicec('/', 1); + } else if (name.begins_with("custom_constants_")) { + String dname = name.get_slicec('_', 2); add_theme_constant_override(dname, p_value); } else { return false; @@ -306,23 +306,23 @@ bool Control::_get(const StringName &p_name, Variant &r_ret) const { return false; } - if (sname.begins_with("custom_icons/")) { - String name = sname.get_slicec('/', 1); + if (sname.begins_with("custom_icons_")) { + String name = sname.get_slicec('_', 2); r_ret = data.icon_override.has(name) ? Variant(data.icon_override[name]) : Variant(); - } else if (sname.begins_with("custom_styles/")) { - String name = sname.get_slicec('/', 1); + } else if (sname.begins_with("custom_styles_")) { + String name = sname.get_slicec('_', 2); r_ret = data.style_override.has(name) ? Variant(data.style_override[name]) : Variant(); - } else if (sname.begins_with("custom_fonts/")) { - String name = sname.get_slicec('/', 1); + } else if (sname.begins_with("custom_fonts_")) { + String name = sname.get_slicec('_', 2); r_ret = data.font_override.has(name) ? Variant(data.font_override[name]) : Variant(); - } else if (sname.begins_with("custom_font_sizes/")) { - String name = sname.get_slicec('/', 1); + } else if (sname.begins_with("custom_font_sizes_")) { + String name = sname.get_slicec('_', 3); r_ret = data.font_size_override.has(name) ? Variant(data.font_size_override[name]) : Variant(); - } else if (sname.begins_with("custom_colors/")) { - String name = sname.get_slicec('/', 1); + } else if (sname.begins_with("custom_colors_")) { + String name = sname.get_slicec('_', 2); r_ret = data.color_override.has(name) ? Variant(data.color_override[name]) : Variant(); - } else if (sname.begins_with("custom_constants/")) { - String name = sname.get_slicec('/', 1); + } else if (sname.begins_with("custom_constants_")) { + String name = sname.get_slicec('_', 2); r_ret = data.constant_override.has(name) ? Variant(data.constant_override[name]) : Variant(); } else { return false; @@ -344,73 +344,79 @@ void Control::_get_property_list(List *p_list) const { { List names; theme->get_icon_list(get_class_name(), &names); + p_list->push_back(PropertyInfo(Variant::NIL, "Custom Icons", PROPERTY_HINT_NONE, "custom_icons_", PROPERTY_USAGE_GROUP)); for (List::Element *E = names.front(); E; E = E->next()) { uint32_t hint = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CHECKABLE; if (data.icon_override.has(E->get())) { hint |= PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_CHECKED; } - p_list->push_back(PropertyInfo(Variant::OBJECT, "custom_icons/" + E->get(), PROPERTY_HINT_RESOURCE_TYPE, "Texture2D", hint)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "custom_icons_" + E->get(), PROPERTY_HINT_RESOURCE_TYPE, "Texture2D", hint)); } } { List names; theme->get_stylebox_list(get_class_name(), &names); + p_list->push_back(PropertyInfo(Variant::NIL, "Custom Styles", PROPERTY_HINT_NONE, "custom_styles_", PROPERTY_USAGE_GROUP)); for (List::Element *E = names.front(); E; E = E->next()) { uint32_t hint = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CHECKABLE; if (data.style_override.has(E->get())) { hint |= PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_CHECKED; } - p_list->push_back(PropertyInfo(Variant::OBJECT, "custom_styles/" + E->get(), PROPERTY_HINT_RESOURCE_TYPE, "StyleBox", hint)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "custom_styles_" + E->get(), PROPERTY_HINT_RESOURCE_TYPE, "StyleBox", hint)); } } { List names; theme->get_font_list(get_class_name(), &names); + p_list->push_back(PropertyInfo(Variant::NIL, "Custom Fonts", PROPERTY_HINT_NONE, "custom_fonts_", PROPERTY_USAGE_GROUP)); for (List::Element *E = names.front(); E; E = E->next()) { uint32_t hint = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CHECKABLE; if (data.font_override.has(E->get())) { hint |= PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_CHECKED; } - p_list->push_back(PropertyInfo(Variant::OBJECT, "custom_fonts/" + E->get(), PROPERTY_HINT_RESOURCE_TYPE, "Font", hint)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "custom_fonts_" + E->get(), PROPERTY_HINT_RESOURCE_TYPE, "Font", hint)); } } { List names; theme->get_font_size_list(get_class_name(), &names); + p_list->push_back(PropertyInfo(Variant::NIL, "Custom Font Sizes", PROPERTY_HINT_NONE, "custom_font_sizes_", PROPERTY_USAGE_GROUP)); for (List::Element *E = names.front(); E; E = E->next()) { uint32_t hint = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CHECKABLE; if (data.font_size_override.has(E->get())) { hint |= PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_CHECKED; } - p_list->push_back(PropertyInfo(Variant::INT, "custom_font_sizes/" + E->get(), PROPERTY_HINT_NONE, "", hint)); + p_list->push_back(PropertyInfo(Variant::INT, "custom_font_sizes_" + E->get(), PROPERTY_HINT_NONE, "", hint)); } } { List names; theme->get_color_list(get_class_name(), &names); + p_list->push_back(PropertyInfo(Variant::NIL, "Custom Colors", PROPERTY_HINT_NONE, "custom_colors_", PROPERTY_USAGE_GROUP)); for (List::Element *E = names.front(); E; E = E->next()) { uint32_t hint = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CHECKABLE; if (data.color_override.has(E->get())) { hint |= PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_CHECKED; } - p_list->push_back(PropertyInfo(Variant::COLOR, "custom_colors/" + E->get(), PROPERTY_HINT_NONE, "", hint)); + p_list->push_back(PropertyInfo(Variant::COLOR, "custom_colors_" + E->get(), PROPERTY_HINT_NONE, "", hint)); } } { List names; theme->get_constant_list(get_class_name(), &names); + p_list->push_back(PropertyInfo(Variant::NIL, "Custom Constants", PROPERTY_HINT_NONE, "custom_constants_", PROPERTY_USAGE_GROUP)); for (List::Element *E = names.front(); E; E = E->next()) { uint32_t hint = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CHECKABLE; if (data.constant_override.has(E->get())) { hint |= PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_CHECKED; } - p_list->push_back(PropertyInfo(Variant::INT, "custom_constants/" + E->get(), PROPERTY_HINT_RANGE, "-16384,16384", hint)); + p_list->push_back(PropertyInfo(Variant::INT, "custom_constants_" + E->get(), PROPERTY_HINT_RANGE, "-16384,16384", hint)); } } } diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 7d5c53effe4b..61c5ae0801e2 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -40,8 +40,8 @@ struct _MinSizeCache { bool GraphNode::_set(const StringName &p_name, const Variant &p_value) { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); double value = p_value; if (value == -1) { @@ -61,34 +61,39 @@ bool GraphNode::_set(const StringName &p_name, const Variant &p_value) { return true; } - if (!str.begins_with("slot/")) { + if (!str.begins_with("slot_")) { return false; } - int idx = str.get_slice("/", 1).to_int(); - String what = str.get_slice("/", 2); + int idx = str.get_slicec('_', 1).to_int(); + String side = str.get_slicec('_', 2); + String what = str.get_slicec('_', 3); Slot si; if (slot_info.has(idx)) { si = slot_info[idx]; } - if (what == "left_enabled") { - si.enable_left = p_value; - } else if (what == "left_type") { - si.type_left = p_value; - } else if (what == "left_icon") { - si.custom_slot_left = p_value; - } else if (what == "left_color") { - si.color_left = p_value; - } else if (what == "right_enabled") { - si.enable_right = p_value; - } else if (what == "right_type") { - si.type_right = p_value; - } else if (what == "right_color") { - si.color_right = p_value; - } else if (what == "right_icon") { - si.custom_slot_right = p_value; + if (side == "left") { + if (what == "enabled") { + si.enable_left = p_value; + } else if (what == "type") { + si.type_left = p_value; + } else if (what == "color") { + si.color_left = p_value; + } else if (what == "icon") { + si.custom_slot_left = p_value; + } + } else if (side == "right") { + if (what == "enabled") { + si.enable_right = p_value; + } else if (what == "type") { + si.type_right = p_value; + } else if (what == "color") { + si.color_right = p_value; + } else if (what == "icon") { + si.custom_slot_right = p_value; + } } else { return false; } @@ -100,8 +105,8 @@ bool GraphNode::_set(const StringName &p_name, const Variant &p_value) { bool GraphNode::_get(const StringName &p_name, Variant &r_ret) const { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); if (opentype_features.has(tag)) { r_ret = opentype_features[tag]; @@ -112,34 +117,39 @@ bool GraphNode::_get(const StringName &p_name, Variant &r_ret) const { } } - if (!str.begins_with("slot/")) { + if (!str.begins_with("slot_")) { return false; } - int idx = str.get_slice("/", 1).to_int(); - String what = str.get_slice("/", 2); + int idx = str.get_slicec('_', 1).to_int(); + String side = str.get_slicec('_', 2); + String what = str.get_slicec('_', 3); Slot si; if (slot_info.has(idx)) { si = slot_info[idx]; } - if (what == "left_enabled") { - r_ret = si.enable_left; - } else if (what == "left_type") { - r_ret = si.type_left; - } else if (what == "left_color") { - r_ret = si.color_left; - } else if (what == "left_icon") { - r_ret = si.custom_slot_left; - } else if (what == "right_enabled") { - r_ret = si.enable_right; - } else if (what == "right_type") { - r_ret = si.type_right; - } else if (what == "right_color") { - r_ret = si.color_right; - } else if (what == "right_icon") { - r_ret = si.custom_slot_right; + if (side == "left") { + if (what == "enabled") { + r_ret = si.enable_left; + } else if (what == "type") { + r_ret = si.type_left; + } else if (what == "color") { + r_ret = si.color_left; + } else if (what == "icon") { + r_ret = si.custom_slot_left; + } + } else if (side == "right") { + if (what == "enabled") { + r_ret = si.enable_right; + } else if (what == "type") { + r_ret = si.type_right; + } else if (what == "color") { + r_ret = si.color_right; + } else if (what == "icon") { + r_ret = si.custom_slot_right; + } } else { return false; } @@ -148,20 +158,23 @@ bool GraphNode::_get(const StringName &p_name, Variant &r_ret) const { } void GraphNode::_get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Opentype Features", PROPERTY_HINT_NONE, "opentype_features_", PROPERTY_USAGE_GROUP)); for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features/" + name)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features_" + name)); } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features__new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); int idx = 0; + p_list->push_back(PropertyInfo(Variant::NIL, "Slots", PROPERTY_HINT_NONE, "slot_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < get_child_count(); i++) { Control *c = Object::cast_to(get_child(i)); if (!c || c->is_set_as_top_level()) { continue; } - String base = "slot/" + itos(idx) + "/"; + String base = "slot_" + itos(idx) + "_"; + p_list->push_back(PropertyInfo(Variant::NIL, itos(idx), PROPERTY_HINT_NONE, base, PROPERTY_USAGE_SUBGROUP)); p_list->push_back(PropertyInfo(Variant::BOOL, base + "left_enabled")); p_list->push_back(PropertyInfo(Variant::INT, base + "left_type")); diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index be73fd8f51bf..eee448dfa97d 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -599,8 +599,8 @@ int Label::get_total_character_count() const { bool Label::_set(const StringName &p_name, const Variant &p_value) { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); double value = p_value; if (value == -1) { @@ -625,8 +625,8 @@ bool Label::_set(const StringName &p_name, const Variant &p_value) { bool Label::_get(const StringName &p_name, Variant &r_ret) const { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 1); int32_t tag = TS->name_to_tag(name); if (opentype_features.has(tag)) { r_ret = opentype_features[tag]; @@ -640,11 +640,12 @@ bool Label::_get(const StringName &p_name, Variant &r_ret) const { } void Label::_get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Opentype Features", PROPERTY_HINT_NONE, "opentype_features_", PROPERTY_USAGE_GROUP)); for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features/" + name)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features_" + name)); } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features__new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); } void Label::_bind_methods() { diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 1aff5d5390ce..49fc9eb55d5a 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -2034,8 +2034,8 @@ void LineEdit::_generate_context_menu() { bool LineEdit::_set(const StringName &p_name, const Variant &p_value) { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); double value = p_value; if (value == -1) { @@ -2060,8 +2060,8 @@ bool LineEdit::_set(const StringName &p_name, const Variant &p_value) { bool LineEdit::_get(const StringName &p_name, Variant &r_ret) const { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); if (opentype_features.has(tag)) { r_ret = opentype_features[tag]; @@ -2075,11 +2075,12 @@ bool LineEdit::_get(const StringName &p_name, Variant &r_ret) const { } void LineEdit::_get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Opentype Features", PROPERTY_HINT_NONE, "opentype_features_", PROPERTY_USAGE_GROUP)); for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features/" + name)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features_" + name)); } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features__new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); } void LineEdit::_validate_property(PropertyInfo &property) const { diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index 1f7b61e3d1a1..f73691b2d668 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -222,8 +222,8 @@ void LinkButton::_notification(int p_what) { bool LinkButton::_set(const StringName &p_name, const Variant &p_value) { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); double value = p_value; if (value == -1) { @@ -248,8 +248,8 @@ bool LinkButton::_set(const StringName &p_name, const Variant &p_value) { bool LinkButton::_get(const StringName &p_name, Variant &r_ret) const { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); if (opentype_features.has(tag)) { r_ret = opentype_features[tag]; @@ -263,11 +263,12 @@ bool LinkButton::_get(const StringName &p_name, Variant &r_ret) const { } void LinkButton::_get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Opentype Features", PROPERTY_HINT_NONE, "opentype_features_", PROPERTY_USAGE_GROUP)); for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features/" + name)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features_" + name)); } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features__new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); } void LinkButton::_bind_methods() { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 4f508423b3c8..b00402c59e3e 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -6749,8 +6749,8 @@ PopupMenu *TextEdit::get_menu() const { bool TextEdit::_set(const StringName &p_name, const Variant &p_value) { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); double value = p_value; if (value == -1) { @@ -6778,8 +6778,8 @@ bool TextEdit::_set(const StringName &p_name, const Variant &p_value) { bool TextEdit::_get(const StringName &p_name, Variant &r_ret) const { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("opentype_features_")) { + String name = str.get_slicec('_', 2); int32_t tag = TS->name_to_tag(name); if (opentype_features.has(tag)) { r_ret = opentype_features[tag]; @@ -6793,11 +6793,12 @@ bool TextEdit::_get(const StringName &p_name, Variant &r_ret) const { } void TextEdit::_get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Opentype Features", PROPERTY_HINT_NONE, "opentype_features_", PROPERTY_USAGE_GROUP)); for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features/" + name)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "opentype_features_" + name)); } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features__new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); } void TextEdit::_bind_methods() { diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 6f64ac6d04ed..3d48eb77f568 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -36,9 +36,9 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; - if (name.begins_with("tracks/")) { - int track = name.get_slicec('/', 1).to_int(); - String what = name.get_slicec('/', 2); + if (name.begins_with("tracks_")) { + int track = name.get_slicec('_', 1).to_int(); + String what = name.get_slicec('_', 2); if (tracks.size() == track && what == "type") { String type = p_value; @@ -312,9 +312,9 @@ bool Animation::_get(const StringName &p_name, Variant &r_ret) const { r_ret = loop; } else if (name == "step") { r_ret = step; - } else if (name.begins_with("tracks/")) { - int track = name.get_slicec('/', 1).to_int(); - String what = name.get_slicec('/', 2); + } else if (name.begins_with("tracks_")) { + int track = name.get_slicec('_', 1).to_int(); + String what = name.get_slicec('_', 2); ERR_FAIL_INDEX_V(track, tracks.size(), false); if (what == "type") { switch (track_get_type(track)) { @@ -570,13 +570,13 @@ bool Animation::_get(const StringName &p_name, Variant &r_ret) const { void Animation::_get_property_list(List *p_list) const { for (int i = 0; i < tracks.size(); i++) { - p_list->push_back(PropertyInfo(Variant::STRING, "tracks/" + itos(i) + "/type", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::NODE_PATH, "tracks/" + itos(i) + "/path", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::INT, "tracks/" + itos(i) + "/interp", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::BOOL, "tracks/" + itos(i) + "/loop_wrap", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::BOOL, "tracks/" + itos(i) + "/imported", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::BOOL, "tracks/" + itos(i) + "/enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, "tracks/" + itos(i) + "/keys", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::STRING, "tracks_" + itos(i) + "_type", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::NODE_PATH, "tracks_" + itos(i) + "_path", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::INT, "tracks_" + itos(i) + "_interp", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::BOOL, "tracks_" + itos(i) + "_loop_wrap", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::BOOL, "tracks_" + itos(i) + "_imported", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::BOOL, "tracks_" + itos(i) + "_enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, "tracks_" + itos(i) + "_keys", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); } } diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 6f87c524d81d..df3dc6f8c8c2 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -119,24 +119,24 @@ void FontData::_bind_methods() { bool FontData::_set(const StringName &p_name, const Variant &p_value) { String str = p_name; - if (str.begins_with("language_support_override/")) { - String lang = str.get_slicec('/', 1); - if (lang == "_new") { + if (str.begins_with("language_support_override_")) { + String lang = str.get_slicec('_', 3); + if (lang == "") { return false; } set_language_support_override(lang, p_value); return true; } - if (str.begins_with("script_support_override/")) { - String scr = str.get_slicec('/', 1); - if (scr == "_new") { + if (str.begins_with("script_support_override_")) { + String scr = str.get_slicec('_', 3); + if (scr == "") { return false; } set_script_support_override(scr, p_value); return true; } - if (str.begins_with("variation/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("variation_")) { + String name = str.get_slicec('_', 1); set_variation(name, p_value); return true; } @@ -146,24 +146,24 @@ bool FontData::_set(const StringName &p_name, const Variant &p_value) { bool FontData::_get(const StringName &p_name, Variant &r_ret) const { String str = p_name; - if (str.begins_with("language_support_override/")) { - String lang = str.get_slicec('/', 1); - if (lang == "_new") { + if (str.begins_with("language_support_override_")) { + String lang = str.get_slicec('_', 3); + if (lang == "") { return true; } r_ret = get_language_support_override(lang); return true; } - if (str.begins_with("script_support_override/")) { - String scr = str.get_slicec('/', 1); - if (scr == "_new") { + if (str.begins_with("script_support_override_")) { + String scr = str.get_slicec('_', 3); + if (scr == "") { return true; } r_ret = get_script_support_override(scr); return true; } - if (str.begins_with("variation/")) { - String name = str.get_slicec('/', 1); + if (str.begins_with("variation_")) { + String name = str.get_slicec('_', 1); r_ret = get_variation(name); return true; @@ -175,20 +175,20 @@ bool FontData::_get(const StringName &p_name, Variant &r_ret) const { void FontData::_get_property_list(List *p_list) const { Vector lang_over = get_language_support_overrides(); for (int i = 0; i < lang_over.size(); i++) { - p_list->push_back(PropertyInfo(Variant::BOOL, "language_support_override/" + lang_over[i], PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::BOOL, "language_support_override_" + lang_over[i], PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE)); } - p_list->push_back(PropertyInfo(Variant::NIL, "language_support_override/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::NIL, "language_support_override__new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); Vector scr_over = get_script_support_overrides(); for (int i = 0; i < scr_over.size(); i++) { - p_list->push_back(PropertyInfo(Variant::BOOL, "script_support_override/" + scr_over[i], PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::BOOL, "script_support_override_" + scr_over[i], PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE)); } - p_list->push_back(PropertyInfo(Variant::NIL, "script_support_override/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::NIL, "script_support_override__new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); Dictionary variations = get_variation_list(); for (const Variant *ftr = variations.next(nullptr); ftr != nullptr; ftr = variations.next(ftr)) { Vector3i v = variations[*ftr]; - p_list->push_back(PropertyInfo(Variant::FLOAT, "variation/" + TS->tag_to_name(*ftr), PROPERTY_HINT_RANGE, itos(v.x) + "," + itos(v.y), PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "variation_" + TS->tag_to_name(*ftr), PROPERTY_HINT_RANGE, itos(v.x) + "," + itos(v.y), PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE)); } } @@ -612,8 +612,8 @@ bool Font::_set(const StringName &p_name, const Variant &p_value) { return false; } #endif /* DISABLE_DEPRECATED */ - if (str.begins_with("data/")) { - int idx = str.get_slicec('/', 1).to_int(); + if (str.begins_with("data_")) { + int idx = str.get_slicec('_', 1).to_int(); Ref fd = p_value; if (fd.is_valid()) { @@ -637,8 +637,8 @@ bool Font::_set(const StringName &p_name, const Variant &p_value) { bool Font::_get(const StringName &p_name, Variant &r_ret) const { String str = p_name; - if (str.begins_with("data/")) { - int idx = str.get_slicec('/', 1).to_int(); + if (str.begins_with("data_")) { + int idx = str.get_slicec('_', 1).to_int(); if (idx == data.size()) { r_ret = Ref(); @@ -653,11 +653,12 @@ bool Font::_get(const StringName &p_name, Variant &r_ret) const { } void Font::_get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Data", PROPERTY_HINT_NONE, "data_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < data.size(); i++) { - p_list->push_back(PropertyInfo(Variant::OBJECT, "data/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "FontData")); + p_list->push_back(PropertyInfo(Variant::OBJECT, "data_" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "FontData")); } - p_list->push_back(PropertyInfo(Variant::OBJECT, "data/" + itos(data.size()), PROPERTY_HINT_RESOURCE_TYPE, "FontData")); + p_list->push_back(PropertyInfo(Variant::OBJECT, "data_" + itos(data.size()), PROPERTY_HINT_RESOURCE_TYPE, "FontData")); } void Font::reset_state() { diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index d31dbc877b95..21935f1d5f37 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -745,16 +745,14 @@ bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) { String sname = p_name; if (sname.begins_with("surface_")) { - int sl = sname.find("/"); - if (sl == -1) { - return false; - } - int idx = sname.substr(8, sl - 8).to_int() - 1; - String what = sname.get_slicec('/', 1); + int idx = sname.get_slicec('_', 1).to_int() - 1; + String what = sname.get_slicec('_', 2); if (what == "material") { surface_set_material(idx, p_value); } else if (what == "name") { surface_set_name(idx, p_value); + } else { + return false; } return true; } @@ -1085,18 +1083,15 @@ bool ArrayMesh::_get(const StringName &p_name, Variant &r_ret) const { String sname = p_name; if (sname.begins_with("surface_")) { - int sl = sname.find("/"); - if (sl == -1) { - return false; - } - int idx = sname.substr(8, sl - 8).to_int() - 1; - String what = sname.get_slicec('/', 1); + int idx = sname.get_slicec('_', 1).to_int() - 1; + String what = sname.get_slicec('_', 2); if (what == "material") { r_ret = surface_get_material(idx); } else if (what == "name") { r_ret = surface_get_name(idx); + } else { + return false; } - return true; } return true; @@ -1117,11 +1112,11 @@ void ArrayMesh::_get_property_list(List *p_list) const { } for (int i = 0; i < surfaces.size(); i++) { - p_list->push_back(PropertyInfo(Variant::STRING, "surface_" + itos(i + 1) + "/name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::STRING, "surface_" + itos(i + 1) + "_name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); if (surfaces[i].is_2d) { - p_list->push_back(PropertyInfo(Variant::OBJECT, "surface_" + itos(i + 1) + "/material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,CanvasItemMaterial", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "surface_" + itos(i + 1) + "_material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,CanvasItemMaterial", PROPERTY_USAGE_EDITOR)); } else { - p_list->push_back(PropertyInfo(Variant::OBJECT, "surface_" + itos(i + 1) + "/material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,StandardMaterial3D", PROPERTY_USAGE_EDITOR)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "surface_" + itos(i + 1) + "_material", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,StandardMaterial3D", PROPERTY_USAGE_EDITOR)); } } } diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp index ad90481fbd60..4392b3e3e608 100644 --- a/scene/resources/mesh_library.cpp +++ b/scene/resources/mesh_library.cpp @@ -32,9 +32,9 @@ bool MeshLibrary::_set(const StringName &p_name, const Variant &p_value) { String name = p_name; - if (name.begins_with("item/")) { - int idx = name.get_slicec('/', 1).to_int(); - String what = name.get_slicec('/', 2); + if (name.begins_with("item_")) { + int idx = name.get_slicec('_', 1).to_int(); + String what = name.get_slicec('_', 2); if (!item_map.has(idx)) { create_item(idx); } @@ -54,9 +54,11 @@ bool MeshLibrary::_set(const StringName &p_name, const Variant &p_value) { } else if (what == "preview") { set_item_preview(idx, p_value); } else if (what == "navmesh") { - set_item_navmesh(idx, p_value); - } else if (what == "navmesh_transform") { - set_item_navmesh_transform(idx, p_value); + if (name.get_slicec('_', 3) == "transform") { + set_item_navmesh_transform(idx, p_value); + } else { + set_item_navmesh(idx, p_value); + } } else { return false; } @@ -69,9 +71,9 @@ bool MeshLibrary::_set(const StringName &p_name, const Variant &p_value) { bool MeshLibrary::_get(const StringName &p_name, Variant &r_ret) const { String name = p_name; - int idx = name.get_slicec('/', 1).to_int(); + int idx = name.get_slicec('_', 1).to_int(); ERR_FAIL_COND_V(!item_map.has(idx), false); - String what = name.get_slicec('/', 2); + String what = name.get_slicec('_', 2); if (what == "name") { r_ret = get_item_name(idx); @@ -80,9 +82,11 @@ bool MeshLibrary::_get(const StringName &p_name, Variant &r_ret) const { } else if (what == "shapes") { r_ret = _get_item_shapes(idx); } else if (what == "navmesh") { - r_ret = get_item_navmesh(idx); - } else if (what == "navmesh_transform") { - r_ret = get_item_navmesh_transform(idx); + if (name.get_slicec('_', 3) == "transform") { + r_ret = get_item_navmesh_transform(idx); + } else { + r_ret = get_item_navmesh(idx); + } } else if (what == "preview") { r_ret = get_item_preview(idx); } else { @@ -93,8 +97,10 @@ bool MeshLibrary::_get(const StringName &p_name, Variant &r_ret) const { } void MeshLibrary::_get_property_list(List *p_list) const { + p_list->push_back(PropertyInfo(Variant::NIL, "Items", PROPERTY_HINT_NONE, "item_", PROPERTY_USAGE_GROUP)); for (Map::Element *E = item_map.front(); E; E = E->next()) { - String name = "item/" + itos(E->key()) + "/"; + String name = "item_" + itos(E->key()) + "_"; + p_list->push_back(PropertyInfo(Variant::NIL, itos(E->key()), PROPERTY_HINT_NONE, name, PROPERTY_USAGE_SUBGROUP)); p_list->push_back(PropertyInfo(Variant::STRING, name + "name")); p_list->push_back(PropertyInfo(Variant::OBJECT, name + "mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh")); p_list->push_back(PropertyInfo(Variant::TRANSFORM, name + "mesh_transform")); diff --git a/scene/resources/skin.cpp b/scene/resources/skin.cpp index fee8fdbde2f5..9f0d121368cf 100644 --- a/scene/resources/skin.cpp +++ b/scene/resources/skin.cpp @@ -90,9 +90,9 @@ bool Skin::_set(const StringName &p_name, const Variant &p_value) { if (name == "bind_count") { set_bind_count(p_value); return true; - } else if (name.begins_with("bind/")) { - int index = name.get_slicec('/', 1).to_int(); - String what = name.get_slicec('/', 2); + } else if (name.begins_with("bind_")) { + int index = name.get_slicec('_', 1).to_int(); + String what = name.get_slicec('_', 2); if (what == "bone") { set_bind_bone(index, p_value); return true; @@ -112,9 +112,9 @@ bool Skin::_get(const StringName &p_name, Variant &r_ret) const { if (name == "bind_count") { r_ret = get_bind_count(); return true; - } else if (name.begins_with("bind/")) { - int index = name.get_slicec('/', 1).to_int(); - String what = name.get_slicec('/', 2); + } else if (name.begins_with("bind_")) { + int index = name.get_slicec('_', 1).to_int(); + String what = name.get_slicec('_', 2); if (what == "bone") { r_ret = get_bind_bone(index); return true; @@ -131,10 +131,12 @@ bool Skin::_get(const StringName &p_name, Variant &r_ret) const { void Skin::_get_property_list(List *p_list) const { p_list->push_back(PropertyInfo(Variant::INT, "bind_count", PROPERTY_HINT_RANGE, "0,16384,1,or_greater")); + p_list->push_back(PropertyInfo(Variant::NIL, "Binds", PROPERTY_HINT_NONE, "bind_", PROPERTY_USAGE_GROUP)); for (int i = 0; i < get_bind_count(); i++) { - p_list->push_back(PropertyInfo(Variant::STRING_NAME, "bind/" + itos(i) + "/name")); - p_list->push_back(PropertyInfo(Variant::INT, "bind/" + itos(i) + "/bone", PROPERTY_HINT_RANGE, "0,16384,1,or_greater", get_bind_name(i) != StringName() ? PROPERTY_USAGE_NOEDITOR : PROPERTY_USAGE_DEFAULT)); - p_list->push_back(PropertyInfo(Variant::TRANSFORM, "bind/" + itos(i) + "/pose")); + p_list->push_back(PropertyInfo(Variant::NIL, itos(i), PROPERTY_HINT_NONE, "bind_" + itos(i) + "_", PROPERTY_USAGE_SUBGROUP)); + p_list->push_back(PropertyInfo(Variant::STRING_NAME, "bind_" + itos(i) + "_name")); + p_list->push_back(PropertyInfo(Variant::INT, "bind_" + itos(i) + "_bone", PROPERTY_HINT_RANGE, "0,16384,1,or_greater", get_bind_name(i) != StringName() ? PROPERTY_USAGE_NOEDITOR : PROPERTY_USAGE_DEFAULT)); + p_list->push_back(PropertyInfo(Variant::TRANSFORM, "bind_" + itos(i) + "_pose")); } } diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 49115a0d81f6..39978097e571 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -1874,7 +1874,7 @@ bool AnimatedTexture::is_pixel_opaque(int p_x, int p_y) const { void AnimatedTexture::_validate_property(PropertyInfo &property) const { String prop = property.name; if (prop.begins_with("frame_")) { - int frame = prop.get_slicec('/', 0).get_slicec('_', 1).to_int(); + int frame = prop.get_slicec('_', 0).to_int(); if (frame >= frame_count) { property.usage = 0; } diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index e8b203417ef7..0ff976cf0700 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -276,10 +276,10 @@ Vector Theme::_get_type_list() const { bool Theme::_set(const StringName &p_name, const Variant &p_value) { String sname = p_name; - if (sname.find("/") != -1) { - String type = sname.get_slicec('/', 1); - String node_type = sname.get_slicec('/', 0); - String name = sname.get_slicec('/', 2); + if (sname.find("_") != -1) { + String type = sname.get_slicec('_', 1); + String node_type = sname.get_slicec('_', 0); + String name = sname.get_slicec('_', 2); if (type == "icons") { set_icon(name, node_type, p_value); @@ -304,10 +304,10 @@ bool Theme::_set(const StringName &p_name, const Variant &p_value) { bool Theme::_get(const StringName &p_name, Variant &r_ret) const { String sname = p_name; - if (sname.find("/") != -1) { - String type = sname.get_slicec('/', 1); - String node_type = sname.get_slicec('/', 0); - String name = sname.get_slicec('/', 2); + if (sname.find("_") != -1) { + String type = sname.get_slicec('_', 1); + String node_type = sname.get_slicec('_', 0); + String name = sname.get_slicec('_', 2); if (type == "icons") { if (!has_icon(name, node_type)) { @@ -342,61 +342,114 @@ bool Theme::_get(const StringName &p_name, Variant &r_ret) const { } void Theme::_get_property_list(List *p_list) const { - List list; - const StringName *key = nullptr; + Set node_types; + Set property_groups; + List properties; while ((key = icon_map.next(key))) { + String node_type = *key; + node_types.insert(node_type); + String property_group = node_type + "_icons"; + property_groups.insert(property_group); const StringName *key2 = nullptr; - while ((key2 = icon_map[*key].next(key2))) { - list.push_back(PropertyInfo(Variant::OBJECT, String() + *key + "/icons/" + *key2, PROPERTY_HINT_RESOURCE_TYPE, "Texture2D", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_STORE_IF_NULL)); + properties.push_back(PropertyInfo(Variant::OBJECT, property_group + "_" + *key2, PROPERTY_HINT_RESOURCE_TYPE, "Texture2D", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_STORE_IF_NULL)); } } key = nullptr; while ((key = style_map.next(key))) { + String node_type = *key; + node_types.insert(node_type); + String property_group = node_type + "_styles"; + property_groups.insert(property_group); const StringName *key2 = nullptr; - while ((key2 = style_map[*key].next(key2))) { - list.push_back(PropertyInfo(Variant::OBJECT, String() + *key + "/styles/" + *key2, PROPERTY_HINT_RESOURCE_TYPE, "StyleBox", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_STORE_IF_NULL)); + properties.push_back(PropertyInfo(Variant::OBJECT, property_group + "_" + *key2, PROPERTY_HINT_RESOURCE_TYPE, "StyleBox", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_STORE_IF_NULL)); } } key = nullptr; while ((key = font_map.next(key))) { + String node_type = *key; + node_types.insert(node_type); + String property_group = node_type + "_fonts"; + property_groups.insert(property_group); const StringName *key2 = nullptr; - while ((key2 = font_map[*key].next(key2))) { - list.push_back(PropertyInfo(Variant::OBJECT, String() + *key + "/fonts/" + *key2, PROPERTY_HINT_RESOURCE_TYPE, "Font", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_STORE_IF_NULL)); + properties.push_back(PropertyInfo(Variant::OBJECT, property_group + "_" + *key2, PROPERTY_HINT_RESOURCE_TYPE, "Font", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_STORE_IF_NULL)); } } key = nullptr; while ((key = color_map.next(key))) { + String node_type = *key; + node_types.insert(node_type); + String property_group = node_type + "_colors"; + property_groups.insert(property_group); const StringName *key2 = nullptr; - while ((key2 = color_map[*key].next(key2))) { - list.push_back(PropertyInfo(Variant::COLOR, String() + *key + "/colors/" + *key2)); + properties.push_back(PropertyInfo(Variant::COLOR, property_group + "_" + *key2)); } } key = nullptr; while ((key = constant_map.next(key))) { + String node_type = *key; + node_types.insert(node_type); + String property_group = node_type + "_contstants"; + property_groups.insert(property_group); const StringName *key2 = nullptr; - while ((key2 = constant_map[*key].next(key2))) { - list.push_back(PropertyInfo(Variant::INT, String() + *key + "/constants/" + *key2)); + properties.push_back(PropertyInfo(Variant::INT, property_group + "_" + *key2)); } } - list.sort(); - for (List::Element *E = list.front(); E; E = E->next()) { - p_list->push_back(E->get()); + if (properties.size() == 0) { + return; + } + + List sorted_node_types; + for (Set::Element *E = node_types.front(); E; E = E->next()) { + sorted_node_types.push_back(E->get()); + } + sorted_node_types.sort(); + + List sorted_property_groups; + for (Set::Element *E = property_groups.front(); E; E = E->next()) { + sorted_property_groups.push_back(E->get()); + } + sorted_property_groups.sort(); + + properties.sort(); + + List::Element *node_element = sorted_node_types.front(); + List::Element *group_element = sorted_property_groups.front(); + ERR_FAIL_COND_MSG((!node_element || !group_element), "No node types or property groups."); + String node_type = "Guaranteed to be wrong"; + String group_name = "Guaranteed to be wrong"; + for (List::Element *info_element = properties.front(); info_element; info_element = info_element->next()) { + PropertyInfo info = info_element->get(); + if (!info.name.begins_with(node_type)) { + // New node type + ERR_FAIL_COND_MSG(!node_element || !info.name.begins_with(node_element->get()), "Incorrect or missing node type"); + node_type = node_element->get(); + node_element = node_element->next(); + p_list->push_back(PropertyInfo(Variant::NIL, node_type, PROPERTY_HINT_NONE, node_type + "_", PROPERTY_USAGE_GROUP)); + } + if (!info.name.begins_with(group_name)) { + // New property group + ERR_FAIL_COND_MSG(!group_element || !info.name.begins_with(group_element->get()), "Incorrect or missing group name"); + group_name = group_element->get(); + group_element = group_element->next(); + p_list->push_back(PropertyInfo(Variant::NIL, group_name.trim_prefix(node_type), PROPERTY_HINT_NONE, group_name + "_", PROPERTY_USAGE_SUBGROUP)); + } + p_list->push_back(info_element->get()); } } diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 84be69d0d688..b158334dc2d0 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -36,16 +36,16 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) { String n = p_name; - int slash = n.find("/"); - if (slash == -1) { + int sep = n.find("_"); + if (sep == -1) { return false; } - int id = String::to_int(n.get_data(), slash); + int id = String::to_int(n.get_data(), sep); if (!tile_map.has(id)) { create_tile(id); } - String what = n.substr(slash + 1, n.length()); + String what = n.substr(sep + 1, n.length()); if (what == "name") { tile_set_name(id, p_value); @@ -68,7 +68,7 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) { if (is_autotile) { tile_set_tile_mode(id, AUTO_TILE); } - } else if (what.left(9) == "autotile/") { + } else if (what.left(9) == "autotile_") { what = what.right(9); if (what == "bitmask_mode") { autotile_set_bitmask_mode(id, (BitmaskMode)((int)p_value)); @@ -210,15 +210,15 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) { bool TileSet::_get(const StringName &p_name, Variant &r_ret) const { String n = p_name; - int slash = n.find("/"); - if (slash == -1) { + int sep = n.find("_"); + if (sep == -1) { return false; } - int id = String::to_int(n.get_data(), slash); + int id = String::to_int(n.get_data(), sep); ERR_FAIL_COND_V(!tile_map.has(id), false); - String what = n.substr(slash + 1, n.length()); + String what = n.substr(sep + 1, n.length()); if (what == "name") { r_ret = tile_get_name(id); @@ -234,7 +234,7 @@ bool TileSet::_get(const StringName &p_name, Variant &r_ret) const { r_ret = tile_get_region(id); } else if (what == "tile_mode") { r_ret = tile_get_tile_mode(id); - } else if (what.left(9) == "autotile/") { + } else if (what.left(9) == "autotile_") { what = what.right(9); if (what == "bitmask_mode") { r_ret = autotile_get_bitmask_mode(id); @@ -324,7 +324,7 @@ bool TileSet::_get(const StringName &p_name, Variant &r_ret) const { void TileSet::_get_property_list(List *p_list) const { for (Map::Element *E = tile_map.front(); E; E = E->next()) { int id = E->key(); - String pre = itos(id) + "/"; + String pre = itos(id) + "_"; p_list->push_back(PropertyInfo(Variant::STRING, pre + "name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "tex_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); @@ -333,23 +333,23 @@ void TileSet::_get_property_list(List *p_list) const { p_list->push_back(PropertyInfo(Variant::RECT2, pre + "region", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::INT, pre + "tile_mode", PROPERTY_HINT_ENUM, "SINGLE_TILE,AUTO_TILE,ATLAS_TILE", PROPERTY_USAGE_NOEDITOR)); if (tile_get_tile_mode(id) == AUTO_TILE) { - p_list->push_back(PropertyInfo(Variant::INT, pre + "autotile/bitmask_mode", PROPERTY_HINT_ENUM, "2X2,3X3 (minimal),3X3", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/bitmask_flags", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "autotile/icon_coordinate", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "autotile/tile_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::INT, pre + "autotile/spacing", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/occluder_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/navpoly_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/priority_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/z_index_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::INT, pre + "autotile_bitmask_mode", PROPERTY_HINT_ENUM, "2X2,3X3 (minimal),3X3", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile_bitmask_flags", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "autotile_icon_coordinate", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "autotile_tile_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::INT, pre + "autotile_spacing", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile_occluder_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile_navpoly_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile_priority_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile_z_index_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); } else if (tile_get_tile_mode(id) == ATLAS_TILE) { - p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "autotile/icon_coordinate", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "autotile/tile_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::INT, pre + "autotile/spacing", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/occluder_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/navpoly_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/priority_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile/z_index_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "autotile_icon_coordinate", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "autotile_tile_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::INT, pre + "autotile_spacing", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile_occluder_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile_navpoly_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile_priority_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::ARRAY, pre + "autotile_z_index_map", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); } p_list->push_back(PropertyInfo(Variant::VECTOR2, pre + "occluder_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::OBJECT, pre + "occluder", PROPERTY_HINT_RESOURCE_TYPE, "OccluderPolygon2D", PROPERTY_USAGE_NOEDITOR)); diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index b810f9562eb4..f6a7f3168eef 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -1000,8 +1000,8 @@ bool VisualShader::_set(const StringName &p_name, const Variant &p_value) { if (name == "mode") { set_mode(Shader::Mode(int(p_value))); return true; - } else if (name.begins_with("flags/")) { - StringName flag = name.get_slicec('/', 1); + } else if (name.begins_with("flags_")) { + StringName flag = name.get_slicec('_', 1); bool enable = p_value; if (enable) { flags.insert(flag); @@ -1010,8 +1010,8 @@ bool VisualShader::_set(const StringName &p_name, const Variant &p_value) { } _queue_update(); return true; - } else if (name.begins_with("modes/")) { - String mode = name.get_slicec('/', 1); + } else if (name.begins_with("modes_")) { + String mode = name.get_slicec('_', 1); int value = p_value; if (value == 0) { modes.erase(mode); //means it's default anyway, so don't store it @@ -1020,8 +1020,8 @@ bool VisualShader::_set(const StringName &p_name, const Variant &p_value) { } _queue_update(); return true; - } else if (name.begins_with("nodes/")) { - String typestr = name.get_slicec('/', 1); + } else if (name.begins_with("nodes_")) { + String typestr = name.get_slicec('_', 1); Type type = TYPE_VERTEX; for (int i = 0; i < TYPE_MAX; i++) { if (typestr == type_string[i]) { @@ -1030,7 +1030,7 @@ bool VisualShader::_set(const StringName &p_name, const Variant &p_value) { } } - String index = name.get_slicec('/', 2); + String index = name.get_slicec('_', 2); if (index == "connections") { Vector conns = p_value; if (conns.size() % 4 == 0) { @@ -1042,7 +1042,7 @@ bool VisualShader::_set(const StringName &p_name, const Variant &p_value) { } int id = index.to_int(); - String what = name.get_slicec('/', 3); + String what = name.get_slicec('_', 3); if (what == "node") { add_node(type, p_value, Vector2(), id); @@ -1072,20 +1072,20 @@ bool VisualShader::_get(const StringName &p_name, Variant &r_ret) const { if (name == "mode") { r_ret = get_mode(); return true; - } else if (name.begins_with("flags/")) { - StringName flag = name.get_slicec('/', 1); + } else if (name.begins_with("flags_")) { + StringName flag = name.get_slicec('_', 1); r_ret = flags.has(flag); return true; - } else if (name.begins_with("modes/")) { - String mode = name.get_slicec('/', 1); + } else if (name.begins_with("modes_")) { + String mode = name.get_slicec('_', 1); if (modes.has(mode)) { r_ret = modes[mode]; } else { r_ret = 0; } return true; - } else if (name.begins_with("nodes/")) { - String typestr = name.get_slicec('/', 1); + } else if (name.begins_with("nodes_")) { + String typestr = name.get_slicec('_', 1); Type type = TYPE_VERTEX; for (int i = 0; i < TYPE_MAX; i++) { if (typestr == type_string[i]) { @@ -1094,7 +1094,7 @@ bool VisualShader::_get(const StringName &p_name, Variant &r_ret) const { } } - String index = name.get_slicec('/', 2); + String index = name.get_slicec('_', 2); if (index == "connections") { Vector conns; for (const List::Element *E = graph[type].connections.front(); E; E = E->next()) { @@ -1109,7 +1109,7 @@ bool VisualShader::_get(const StringName &p_name, Variant &r_ret) const { } int id = index.to_int(); - String what = name.get_slicec('/', 3); + String what = name.get_slicec('_', 3); if (what == "node") { r_ret = get_node(type, id); @@ -1172,35 +1172,37 @@ void VisualShader::_get_property_list(List *p_list) const { } } + p_list->push_back(PropertyInfo(Variant::NIL, "Modes", PROPERTY_HINT_NONE, "modes_", PROPERTY_USAGE_GROUP)); for (Map::Element *E = blend_mode_enums.front(); E; E = E->next()) { - p_list->push_back(PropertyInfo(Variant::INT, "modes/" + E->key(), PROPERTY_HINT_ENUM, E->get())); + p_list->push_back(PropertyInfo(Variant::INT, "modes_" + E->key(), PROPERTY_HINT_ENUM, E->get())); } + p_list->push_back(PropertyInfo(Variant::NIL, "Flags", PROPERTY_HINT_NONE, "flags_", PROPERTY_USAGE_GROUP)); for (Set::Element *E = toggles.front(); E; E = E->next()) { - p_list->push_back(PropertyInfo(Variant::BOOL, "flags/" + E->get())); + p_list->push_back(PropertyInfo(Variant::BOOL, "flags_" + E->get())); } for (int i = 0; i < TYPE_MAX; i++) { for (Map::Element *E = graph[i].nodes.front(); E; E = E->next()) { - String prop_name = "nodes/"; + String prop_name = "nodes_"; prop_name += type_string[i]; - prop_name += "/" + itos(E->key()); + prop_name += "_" + itos(E->key()); if (E->key() != NODE_ID_OUTPUT) { - p_list->push_back(PropertyInfo(Variant::OBJECT, prop_name + "/node", PROPERTY_HINT_RESOURCE_TYPE, "VisualShaderNode", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE)); + p_list->push_back(PropertyInfo(Variant::OBJECT, prop_name + "_node", PROPERTY_HINT_RESOURCE_TYPE, "VisualShaderNode", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE)); } - p_list->push_back(PropertyInfo(Variant::VECTOR2, prop_name + "/position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, prop_name + "_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); if (Object::cast_to(E->get().node.ptr()) != nullptr) { - p_list->push_back(PropertyInfo(Variant::VECTOR2, prop_name + "/size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); - p_list->push_back(PropertyInfo(Variant::STRING, prop_name + "/input_ports", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); - p_list->push_back(PropertyInfo(Variant::STRING, prop_name + "/output_ports", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, prop_name + "_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::STRING, prop_name + "_input_ports", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::STRING, prop_name + "_output_ports", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); } if (Object::cast_to(E->get().node.ptr()) != nullptr) { - p_list->push_back(PropertyInfo(Variant::STRING, prop_name + "/expression", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::STRING, prop_name + "_expression", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); } } - p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, "nodes/" + String(type_string[i]) + "/connections", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, "nodes_" + String(type_string[i]) + "_connections", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR)); } } diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 08c482553b26..182d004dd47b 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -1330,15 +1330,15 @@ AudioServer::~AudioServer() { bool AudioBusLayout::_set(const StringName &p_name, const Variant &p_value) { String s = p_name; - if (s.begins_with("bus/")) { - int index = s.get_slice("/", 1).to_int(); + if (s.begins_with("bus_")) { + int index = s.get_slicec('_', 1).to_int(); if (buses.size() <= index) { buses.resize(index + 1); } Bus &bus = buses.write[index]; - String what = s.get_slice("/", 2); + String what = s.get_slicec('_', 2); if (what == "name") { bus.name = p_value; @@ -1353,14 +1353,14 @@ bool AudioBusLayout::_set(const StringName &p_name, const Variant &p_value) { } else if (what == "send") { bus.send = p_value; } else if (what == "effect") { - int which = s.get_slice("/", 3).to_int(); + int which = s.get_slicec('_', 3).to_int(); if (bus.effects.size() <= which) { bus.effects.resize(which + 1); } Bus::Effect &fx = bus.effects.write[which]; - String fxwhat = s.get_slice("/", 4); + String fxwhat = s.get_slicec('_', 4); if (fxwhat == "effect") { fx.effect = p_value; } else if (fxwhat == "enabled") { @@ -1382,15 +1382,15 @@ bool AudioBusLayout::_set(const StringName &p_name, const Variant &p_value) { bool AudioBusLayout::_get(const StringName &p_name, Variant &r_ret) const { String s = p_name; - if (s.begins_with("bus/")) { - int index = s.get_slice("/", 1).to_int(); + if (s.begins_with("bus_")) { + int index = s.get_slicec('_', 1).to_int(); if (index < 0 || index >= buses.size()) { return false; } const Bus &bus = buses[index]; - String what = s.get_slice("/", 2); + String what = s.get_slicec('_', 2); if (what == "name") { r_ret = bus.name; @@ -1405,14 +1405,14 @@ bool AudioBusLayout::_get(const StringName &p_name, Variant &r_ret) const { } else if (what == "send") { r_ret = bus.send; } else if (what == "effect") { - int which = s.get_slice("/", 3).to_int(); + int which = s.get_slicec('_', 3).to_int(); if (which < 0 || which >= bus.effects.size()) { return false; } const Bus::Effect &fx = bus.effects[which]; - String fxwhat = s.get_slice("/", 4); + String fxwhat = s.get_slicec('_', 4); if (fxwhat == "effect") { r_ret = fx.effect; } else if (fxwhat == "enabled") { @@ -1434,16 +1434,16 @@ bool AudioBusLayout::_get(const StringName &p_name, Variant &r_ret) const { void AudioBusLayout::_get_property_list(List *p_list) const { for (int i = 0; i < buses.size(); i++) { - p_list->push_back(PropertyInfo(Variant::STRING, "bus/" + itos(i) + "/name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::BOOL, "bus/" + itos(i) + "/solo", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::BOOL, "bus/" + itos(i) + "/mute", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::BOOL, "bus/" + itos(i) + "/bypass_fx", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::FLOAT, "bus/" + itos(i) + "/volume_db", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::FLOAT, "bus/" + itos(i) + "/send", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::STRING, "bus_" + itos(i) + "_name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::BOOL, "bus_" + itos(i) + "_solo", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::BOOL, "bus_" + itos(i) + "_mute", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::BOOL, "bus_" + itos(i) + "_bypass_fx", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "bus_" + itos(i) + "_volume_db", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "bus_" + itos(i) + "_send", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); for (int j = 0; j < buses[i].effects.size(); j++) { - p_list->push_back(PropertyInfo(Variant::OBJECT, "bus/" + itos(i) + "/effect/" + itos(j) + "/effect", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); - p_list->push_back(PropertyInfo(Variant::BOOL, "bus/" + itos(i) + "/effect/" + itos(j) + "/enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::OBJECT, "bus_" + itos(i) + "_effect_" + itos(j) + "_effect", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); + p_list->push_back(PropertyInfo(Variant::BOOL, "bus_" + itos(i) + "_effect_" + itos(j) + "_enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); } } }