|
|
@@ -563,28 +563,28 @@ bool PickBuiltinObject()
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-// When calling items from the quick menu, they have "Create" prepended for clarity. Strip that now to get the object name to create
|
|
|
-String GetActionName(const String&in name)
|
|
|
-{
|
|
|
- if (name.StartsWith("Create"))
|
|
|
- return name.Substring(7);
|
|
|
- else
|
|
|
- return name;
|
|
|
-}
|
|
|
-
|
|
|
bool PickUIElement()
|
|
|
{
|
|
|
Menu@ menu = GetEventSender();
|
|
|
if (menu is null)
|
|
|
return false;
|
|
|
|
|
|
- String action = menu.name;
|
|
|
+ String action = GetActionName(menu.name);
|
|
|
if (action.empty)
|
|
|
return false;
|
|
|
|
|
|
return NewUIElement(action);
|
|
|
}
|
|
|
|
|
|
+// When calling items from the quick menu, they have "Create" prepended for clarity. Strip that now to get the object name to create
|
|
|
+String GetActionName(const String&in name)
|
|
|
+{
|
|
|
+ if (name.StartsWith("Create"))
|
|
|
+ return name.Substring(7);
|
|
|
+ else
|
|
|
+ return name;
|
|
|
+}
|
|
|
+
|
|
|
void HandleMenuSelected(StringHash eventType, VariantMap& eventData)
|
|
|
{
|
|
|
Menu@ menu = eventData["Element"].GetUIElement();
|