@@ -1039,6 +1039,10 @@ namespace EditorPythonBindings
1039
1039
1040
1040
// record the event names the behavior can send, their parameters and return type
1041
1041
AZStd::string comment = behaviorEBus->m_toolTip ;
1042
+ if (comment.empty ())
1043
+ {
1044
+ comment = Internal::ReadStringAttribute (behaviorEBus->m_attributes , AZ::Script::Attributes::ToolTip);
1045
+ }
1042
1046
1043
1047
if (!behaviorEBus->m_events .empty ())
1044
1048
{
@@ -1104,7 +1108,8 @@ namespace EditorPythonBindings
1104
1108
const AZStd::string methodName,
1105
1109
const AZ::BehaviorMethod& behaviorMethod,
1106
1110
const AZ::BehaviorClass* behaviorClass,
1107
- bool defineTooltip)
1111
+ bool defineTooltip,
1112
+ bool defineDebugDescription)
1108
1113
{
1109
1114
AZStd::string buffer;
1110
1115
AZStd::vector<AZStd::string> pythonArgs;
@@ -1160,14 +1165,30 @@ namespace EditorPythonBindings
1160
1165
AzFramework::StringFunc::Join (buffer, pythonArgs.begin (), pythonArgs.end (), " ," );
1161
1166
AzFramework::StringFunc::Append (buffer, " ) -> None:\n " );
1162
1167
1168
+ AZStd::string methodTooltipAndDebugDescription = " " ;
1169
+
1170
+ if (defineDebugDescription && behaviorMethod.m_debugDescription != nullptr )
1171
+ {
1172
+ AZStd::string debugDescription (behaviorMethod.m_debugDescription );
1173
+ if (!debugDescription.empty ())
1174
+ {
1175
+ methodTooltipAndDebugDescription += debugDescription;
1176
+ methodTooltipAndDebugDescription += " \n " ;
1177
+ }
1178
+ }
1163
1179
if (defineTooltip)
1164
1180
{
1165
1181
AZStd::string methodTooltip = Internal::ReadStringAttribute (behaviorMethod.m_attributes , AZ::Script::Attributes::ToolTip);
1166
1182
if (!methodTooltip.empty ())
1167
1183
{
1168
- Internal::AddCommentBlock (indentLevel + 1 , methodTooltip, buffer);
1184
+ methodTooltipAndDebugDescription += methodTooltip;
1185
+ methodTooltipAndDebugDescription += " \n " ;
1169
1186
}
1170
1187
}
1188
+ if (!methodTooltipAndDebugDescription.empty ())
1189
+ {
1190
+ Internal::AddCommentBlock (indentLevel + 1 , methodTooltipAndDebugDescription, buffer);
1191
+ }
1171
1192
1172
1193
Internal::Indent (indentLevel + 1 , buffer);
1173
1194
AzFramework::StringFunc::Append (buffer, " pass\n\n " );
@@ -1205,6 +1226,16 @@ namespace EditorPythonBindings
1205
1226
{
1206
1227
body = " " ;
1207
1228
}
1229
+ if (defineTooltip)
1230
+ {
1231
+ AZStd::string classTooltip =
1232
+ Internal::ReadStringAttribute (behaviorClass->m_attributes , AZ::Script::Attributes::ToolTip);
1233
+ if (!classTooltip.empty ())
1234
+ {
1235
+ Internal::AddCommentBlock (1 , classTooltip, body);
1236
+ }
1237
+ }
1238
+
1208
1239
Internal::Indent (1 , body);
1209
1240
AzFramework::StringFunc::Append (body, " pass\n\n " );
1210
1241
AzFramework::StringFunc::Append (buffer, body.c_str ());
0 commit comments