@@ -778,10 +778,20 @@ Control *EditorProperty::make_custom_tooltip(const String &p_text) const {
778
778
help_bit->add_style_override (" panel" , get_stylebox (" panel" , " TooltipPanel" ));
779
779
help_bit->get_rich_text ()->set_fixed_size_to_width (360 * EDSCALE);
780
780
781
- String text = TTR (" Property:" ) + " [u][b]" + p_text.get_slice (" ::" , 0 ) + " [/b][/u]\n " ;
782
- text += p_text.get_slice (" ::" , 1 ).strip_edges ();
783
- help_bit->set_text (text);
784
- help_bit->call_deferred (" set_text" , text); // hack so it uses proper theme once inside scene
781
+ PackedStringArray slices = p_text.split (" ::" , false );
782
+ if (!slices.empty ()) {
783
+ String property_name = slices[0 ].strip_edges ();
784
+ String text = TTR (" Property:" ) + " [u][b]" + property_name + " [/b][/u]" ;
785
+
786
+ if (slices.size () > 1 ) {
787
+ String property_doc = slices[1 ].strip_edges ();
788
+ if (property_name != property_doc) {
789
+ text += " \n " + property_doc;
790
+ }
791
+ }
792
+ help_bit->call_deferred (" set_text" , text); // hack so it uses proper theme once inside scene
793
+ }
794
+
785
795
return help_bit;
786
796
}
787
797
@@ -1005,10 +1015,20 @@ Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) cons
1005
1015
help_bit->add_style_override (" panel" , get_stylebox (" panel" , " TooltipPanel" ));
1006
1016
help_bit->get_rich_text ()->set_fixed_size_to_width (360 * EDSCALE);
1007
1017
1008
- String text = " [u][b]" + p_text.get_slice (" ::" , 0 ) + " [/b][/u]\n " ;
1009
- text += p_text.get_slice (" ::" , 1 ).strip_edges ();
1010
- help_bit->set_text (text);
1011
- help_bit->call_deferred (" set_text" , text); // hack so it uses proper theme once inside scene
1018
+ PackedStringArray slices = p_text.split (" ::" , false );
1019
+ if (!slices.empty ()) {
1020
+ String property_name = slices[0 ].strip_edges ();
1021
+ String text = " [u][b]" + property_name + " [/b][/u]" ;
1022
+
1023
+ if (slices.size () > 1 ) {
1024
+ String property_doc = slices[1 ].strip_edges ();
1025
+ if (property_name != property_doc) {
1026
+ text += " \n " + property_doc;
1027
+ }
1028
+ }
1029
+ help_bit->call_deferred (" set_text" , text); // hack so it uses proper theme once inside scene
1030
+ }
1031
+
1012
1032
return help_bit;
1013
1033
}
1014
1034
0 commit comments