Fix inspector group name capitalization

(cherry picked from commit 88b09694e7)
This commit is contained in:
FireForge 2022-03-25 21:22:46 -05:00 committed by Rémi Verschelde
parent ad0c4bf32d
commit 7f787857ef
3 changed files with 18 additions and 4 deletions

View file

@ -1612,8 +1612,22 @@ void EditorInspector::update_tree() {
current_vbox->add_child(section);
sections.push_back(section);
const String label = EditorPropertyNameProcessor::get_singleton()->process_name(path_name, property_name_style);
const String tooltip = EditorPropertyNameProcessor::get_singleton()->process_name(path_name, EditorPropertyNameProcessor::get_tooltip_style(property_name_style));
String label;
String tooltip;
// Only process group label if this is not the group or subgroup.
if ((i == 0 && path_name == group)) {
if (property_name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
label = TTRGET(path_name);
tooltip = path_name;
} else {
label = path_name;
tooltip = TTRGET(path_name);
}
} else {
label = EditorPropertyNameProcessor::get_singleton()->process_name(path_name, property_name_style);
tooltip = EditorPropertyNameProcessor::get_singleton()->process_name(path_name, EditorPropertyNameProcessor::get_tooltip_style(property_name_style));
}
Color c = sscolor;
c.a /= level;

View file

@ -1467,7 +1467,7 @@ void KinematicBody2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "motion/sync_to_physics"), "set_sync_to_physics", "is_sync_to_physics_enabled");
ADD_GROUP("Moving platform", "moving_platform");
ADD_GROUP("Moving Platform", "moving_platform");
ADD_PROPERTY(PropertyInfo(Variant::INT, "moving_platform_apply_velocity_on_leave", PROPERTY_HINT_ENUM, "Always,Upward Only,Never", PROPERTY_USAGE_DEFAULT), "set_moving_platform_apply_velocity_on_leave", "get_moving_platform_apply_velocity_on_leave");
BIND_ENUM_CONSTANT(PLATFORM_VEL_ON_LEAVE_ALWAYS);

View file

@ -1480,7 +1480,7 @@ void KinematicBody::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "motion/sync_to_physics"), "set_sync_to_physics", "is_sync_to_physics_enabled");
ADD_GROUP("Moving platform", "moving_platform");
ADD_GROUP("Moving Platform", "moving_platform");
ADD_PROPERTY(PropertyInfo(Variant::INT, "moving_platform_apply_velocity_on_leave", PROPERTY_HINT_ENUM, "Always,Upward Only,Never", PROPERTY_USAGE_DEFAULT), "set_moving_platform_apply_velocity_on_leave", "get_moving_platform_apply_velocity_on_leave");
BIND_ENUM_CONSTANT(PLATFORM_VEL_ON_LEAVE_ALWAYS);