Browse Source

Generalized the factory category for all objects.
Removed hardcoded UI element type list in Editor.

Lasse Öörni 12 years ago
parent
commit
c0dbf7f545
55 changed files with 203 additions and 118 deletions
  1. 14 7
      Bin/Data/Scripts/Editor/EditorUI.as
  2. 84 33
      Docs/ScriptAPI.dox
  3. 1 1
      Engine/Audio/SoundListener.cpp
  4. 1 1
      Engine/Audio/SoundSource.cpp
  5. 1 1
      Engine/Audio/SoundSource3D.cpp
  6. 2 2
      Engine/Core/Context.cpp
  7. 9 9
      Engine/Core/Context.h
  8. 12 0
      Engine/Core/Object.cpp
  9. 2 0
      Engine/Core/Object.h
  10. 1 1
      Engine/Engine/APITemplates.h
  11. 6 6
      Engine/Engine/SceneAPI.cpp
  12. 1 1
      Engine/Graphics/AnimatedModel.cpp
  13. 1 1
      Engine/Graphics/AnimationController.cpp
  14. 1 1
      Engine/Graphics/BillboardSet.cpp
  15. 1 1
      Engine/Graphics/Camera.cpp
  16. 1 1
      Engine/Graphics/CustomGeometry.cpp
  17. 1 1
      Engine/Graphics/DebugRenderer.cpp
  18. 1 1
      Engine/Graphics/DecalSet.cpp
  19. 1 1
      Engine/Graphics/Light.cpp
  20. 1 1
      Engine/Graphics/Octree.cpp
  21. 1 1
      Engine/Graphics/ParticleEmitter.cpp
  22. 1 1
      Engine/Graphics/Skybox.cpp
  23. 1 1
      Engine/Graphics/StaticModel.cpp
  24. 1 1
      Engine/Graphics/Terrain.cpp
  25. 1 1
      Engine/Graphics/TerrainPatch.cpp
  26. 1 1
      Engine/Graphics/Zone.cpp
  27. 1 1
      Engine/Navigation/Navigable.cpp
  28. 1 1
      Engine/Navigation/NavigationMesh.cpp
  29. 1 1
      Engine/Navigation/OffMeshConnection.cpp
  30. 1 1
      Engine/Network/NetworkPriority.cpp
  31. 1 1
      Engine/Physics/CollisionShape.cpp
  32. 1 1
      Engine/Physics/Constraint.cpp
  33. 1 1
      Engine/Physics/PhysicsWorld.cpp
  34. 1 1
      Engine/Physics/RigidBody.cpp
  35. 0 12
      Engine/Scene/Component.cpp
  36. 0 3
      Engine/Scene/Component.h
  37. 1 1
      Engine/Scene/SmoothedTransform.cpp
  38. 1 1
      Engine/Script/ScriptInstance.cpp
  39. 2 1
      Engine/UI/BorderImage.cpp
  40. 3 1
      Engine/UI/Button.cpp
  41. 3 1
      Engine/UI/CheckBox.cpp
  42. 3 1
      Engine/UI/Cursor.cpp
  43. 3 1
      Engine/UI/DropDownList.cpp
  44. 3 1
      Engine/UI/LineEdit.cpp
  45. 3 1
      Engine/UI/ListView.cpp
  46. 4 2
      Engine/UI/Menu.cpp
  47. 2 1
      Engine/UI/ScrollBar.cpp
  48. 3 1
      Engine/UI/ScrollView.cpp
  49. 3 1
      Engine/UI/Slider.cpp
  50. 2 1
      Engine/UI/Sprite.cpp
  51. 2 1
      Engine/UI/Text.cpp
  52. 1 1
      Engine/UI/Text3D.cpp
  53. 2 0
      Engine/UI/UI.cpp
  54. 3 1
      Engine/UI/UIElement.cpp
  55. 3 1
      Engine/UI/Window.cpp

+ 14 - 7
Bin/Data/Scripts/Editor/EditorUI.as

@@ -192,12 +192,16 @@ void CreateMenuBar()
 
         Menu@ childMenu = CreateMenuItem("Component", null, SHOW_POPUP_INDICATOR);
         Window@ childPopup = CreatePopup(childMenu);
-        String[] componentCategories = GetComponentCategories();
-        for (uint i = 0; i < componentCategories.length; ++i)
+        String[] objectCategories = GetObjectCategories();
+        for (uint i = 0; i < objectCategories.length; ++i)
         {
-            Menu@ menu = CreateMenuItem(componentCategories[i], null, SHOW_POPUP_INDICATOR);
+            // Skip the UI category for the component menus
+            if (objectCategories[i] == "UI")
+                continue;
+
+            Menu@ menu = CreateMenuItem(objectCategories[i], null, SHOW_POPUP_INDICATOR);
             Window@ popup = CreatePopup(menu);
-            String[] componentTypes = GetComponentsByCategory(componentCategories[i]);
+            String[] componentTypes = GetObjectsByCategory(objectCategories[i]);
             for (uint j = 0; j < componentTypes.length; ++j)
                 popup.AddChild(CreateIconizedMenuItem(componentTypes[j], @PickComponent));
             childPopup.AddChild(menu);
@@ -215,9 +219,12 @@ void CreateMenuBar()
 
         childMenu = CreateMenuItem("UI-element", null, SHOW_POPUP_INDICATOR);
         childPopup = CreatePopup(childMenu);
-        String[] typeNames = { "BorderImage", "Button", "CheckBox", "DropDownList", "LineEdit", "ListView", "Menu", "ScrollBar", "ScrollView", "Slider", "Sprite", "Text", "Window" };
-        for (uint i = 0; i < typeNames.length; ++i)
-            childPopup.AddChild(CreateIconizedMenuItem(typeNames[i], @PickUIElement));
+        String[] uiElementTypes = GetObjectsByCategory("UI");
+        for (uint i = 0; i < uiElementTypes.length; ++i)
+        {
+            if (uiElementTypes[i] != "UIElement")
+                childPopup.AddChild(CreateIconizedMenuItem(uiElementTypes[i], @PickUIElement));
+        }
         childPopup.AddChild(CreateMenuDivider());
         childPopup.AddChild(CreateIconizedMenuItem("UIElement", @PickUIElement));
         popup.AddChild(childMenu);

+ 84 - 33
Docs/ScriptAPI.dox

@@ -66,8 +66,8 @@ namespace Urho3D
 - String RemoveTrailingSlash(const String&)
 - String GetParentPath(const String&)
 - String GetInternalPath(const String&)
-- String[]@ GetComponentCategories()
-- String[]@ GetComponentsByCategory(const String&)
+- String[]@ GetObjectCategories()
+- String[]@ GetObjectsByCategory(const String&)
 - uint GetAlphaFormat()
 - uint GetLuminanceFormat()
 - uint GetLuminanceAlphaFormat()
@@ -807,6 +807,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 
@@ -837,6 +838,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint frameNumber (readonly)
@@ -859,6 +861,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - int level
@@ -1004,6 +1007,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - FileMode mode (readonly)
@@ -1105,6 +1109,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String currentDir
@@ -1122,6 +1127,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name (readonly)
@@ -1140,6 +1146,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -1174,6 +1181,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint[] memoryBudget
@@ -1199,6 +1207,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -1222,6 +1231,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -1338,6 +1348,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -1367,6 +1378,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -1376,7 +1388,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 
 
@@ -1443,6 +1454,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -1496,6 +1508,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -1505,7 +1518,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - Vector3 targetPosition
 - Quaternion targetRotation
@@ -1589,6 +1601,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -1682,6 +1695,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -1691,7 +1705,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 
 
@@ -1723,6 +1736,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -1732,7 +1746,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - float nearClip
 - float farClip
@@ -1838,6 +1851,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -1868,6 +1882,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - Scene@ scene
@@ -1907,6 +1922,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -1943,6 +1959,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -1999,6 +2016,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -2023,6 +2041,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -2048,6 +2067,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -2080,6 +2100,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -2113,6 +2134,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2122,7 +2144,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2181,6 +2202,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2190,7 +2212,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2246,6 +2267,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2255,7 +2277,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2304,6 +2325,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2313,7 +2335,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2358,6 +2379,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2367,7 +2389,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2441,6 +2462,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2450,7 +2472,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2528,6 +2549,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2537,7 +2559,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 
 
@@ -2574,6 +2595,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2583,7 +2605,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2630,6 +2651,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2639,7 +2661,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2694,6 +2715,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2703,7 +2725,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2749,6 +2770,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2758,7 +2780,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2803,6 +2824,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2812,7 +2834,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -2853,6 +2874,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2862,7 +2884,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - Material@ material
 - Image@ heightMap
@@ -2924,6 +2945,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -2933,7 +2955,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - BoundingBox worldBoundingBox (readonly)
 - uint numLevels (readonly)
@@ -2952,6 +2973,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String windowTitle
@@ -2989,6 +3011,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numViewports
@@ -3054,6 +3077,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - bool mouseVisible
@@ -3089,6 +3113,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -3124,6 +3149,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -3133,7 +3159,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 
 
@@ -3163,6 +3188,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -3172,7 +3198,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - SoundType soundType
 - float frequency
@@ -3212,6 +3237,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -3221,7 +3247,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - SoundType soundType
 - float frequency
@@ -3248,6 +3273,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - float[] masterGain
@@ -3272,6 +3298,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -3337,6 +3364,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -3461,6 +3489,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -3585,6 +3614,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -3690,6 +3720,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -3825,6 +3856,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -3958,6 +3990,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -4090,6 +4123,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -4226,6 +4260,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -4359,6 +4394,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -4508,6 +4544,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -4654,6 +4691,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -4754,6 +4792,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -4763,7 +4802,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool inView (readonly)
 - bool castShadows
@@ -4856,6 +4894,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5002,6 +5041,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5152,6 +5192,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5297,6 +5338,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5385,6 +5427,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String title
@@ -5422,6 +5465,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - Cursor@ cursor
@@ -5469,6 +5513,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5478,7 +5523,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - float basePriority
 - float distanceFactor
@@ -5499,6 +5543,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - Scene@ scene
@@ -5537,6 +5582,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - int updateFps
@@ -5576,6 +5622,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5585,7 +5632,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - ShapeType shapeType
 - Vector3 size
@@ -5628,6 +5674,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5637,7 +5684,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - float mass
 - Vector3 position
@@ -5687,6 +5733,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5696,7 +5743,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - ConstraintType constraintType
 - Vector3 position
@@ -5752,6 +5798,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5761,7 +5808,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - Vector3 gravity
 - int fps
@@ -5789,6 +5835,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5798,7 +5845,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - bool recursive
 
@@ -5831,6 +5877,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5840,7 +5887,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - int tileSize
 - float cellSize
@@ -5883,6 +5929,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5892,7 +5939,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - Node@ endPoint
 - float radius
@@ -5910,6 +5956,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - String name
@@ -5948,6 +5995,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - uint numAttributes (readonly)
@@ -5957,7 +6005,6 @@ Properties:<br>
 - bool enabled
 - bool enabledEffective (readonly)
 - uint id (readonly)
-- String category (readonly)
 - Node@ node (readonly)
 - int fixedUpdateFps
 - ScriptFile@ scriptFile
@@ -5975,6 +6022,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - ScriptFile@ defaultScriptFile
@@ -5991,6 +6039,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - XMLFile@ style
@@ -6017,6 +6066,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - XMLFile@ style
@@ -6044,6 +6094,7 @@ Methods:<br>
 Properties:<br>
 - ShortStringHash type (readonly)
 - String typeName (readonly)
+- String category (readonly)
 - int refs (readonly)
 - int weakRefs (readonly)
 - int minFps

+ 1 - 1
Engine/Audio/SoundListener.cpp

@@ -44,7 +44,7 @@ SoundListener::~SoundListener()
 
 void SoundListener::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<SoundListener>(AUDIO_CATEGORY);
+    context->RegisterFactory<SoundListener>(AUDIO_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(SoundListener, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
 }

+ 1 - 1
Engine/Audio/SoundSource.cpp

@@ -136,7 +136,7 @@ SoundSource::~SoundSource()
 
 void SoundSource::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<SoundSource>(AUDIO_CATEGORY);
+    context->RegisterFactory<SoundSource>(AUDIO_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(SoundSource, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ENUM_ATTRIBUTE(SoundSource, "Sound Type", soundType_, typeNames, SOUND_EFFECT, AM_DEFAULT);

+ 1 - 1
Engine/Audio/SoundSource3D.cpp

@@ -54,7 +54,7 @@ SoundSource3D::SoundSource3D(Context* context) :
 
 void SoundSource3D::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<SoundSource3D>(AUDIO_CATEGORY);
+    context->RegisterFactory<SoundSource3D>(AUDIO_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(SoundSource3D, SoundSource);
     // Remove Attenuation and Panning as attribute as they are constantly being updated

+ 2 - 2
Engine/Core/Context.cpp

@@ -82,14 +82,14 @@ void Context::RegisterFactory(ObjectFactory* factory)
     factories_[factory->GetType()] = factory;
 }
 
-void Context::RegisterComponentFactory(ObjectFactory* factory, const char* category)
+void Context::RegisterFactory(ObjectFactory* factory, const char* category)
 {
     if (!factory)
         return;
 
     RegisterFactory(factory);
     if (String::CStringLength(category))
-        componentCategories_[category].Push(factory->GetType());
+        objectCategories_[category].Push(factory->GetType());
 }
 
 void Context::RegisterSubsystem(Object* object)

+ 9 - 9
Engine/Core/Context.h

@@ -44,8 +44,8 @@ public:
     SharedPtr<Object> CreateObject(ShortStringHash objectType);
     /// Register a factory for an object type.
     void RegisterFactory(ObjectFactory* factory);
-    /// Register a factory for a component type.
-    void RegisterComponentFactory(ObjectFactory* factory, const char* category);
+    /// Register a factory for an object type and specify the object category.
+    void RegisterFactory(ObjectFactory* factory, const char* category);
     /// Register a subsystem.
     void RegisterSubsystem(Object* subsystem);
     /// Remove a subsystem.
@@ -61,8 +61,8 @@ public:
     void CopyBaseAttributes(ShortStringHash baseType, ShortStringHash derivedType);
     /// Template version of registering an object factory.
     template <class T> void RegisterFactory();
-    /// Template version of registering a component factory.
-    template <class T> void RegisterComponentFactory(const char* category);
+    /// Template version of registering an object factory with category.
+    template <class T> void RegisterFactory(const char* category);
     /// Template version of removing a subsystem.
     template <class T> void RemoveSubsystem();
     /// Template version of registering an object attribute.
@@ -80,8 +80,8 @@ public:
     const HashMap<ShortStringHash, SharedPtr<Object> >& GetSubsystems() const { return subsystems_; }
     /// Return all object factories.
     const HashMap<ShortStringHash, SharedPtr<ObjectFactory> >& GetObjectFactories() const { return factories_; }
-    /// Return all component categories.
-    const HashMap<String, Vector<ShortStringHash> >& GetComponentCategories() const { return componentCategories_; }
+    /// Return all object categories.
+    const HashMap<String, Vector<ShortStringHash> >& GetObjectCategories() const { return objectCategories_; }
     /// Return active event sender. Null outside event handling.
     Object* GetEventSender() const;
     /// Return active event handler. Set by Object. Null outside event handling.
@@ -163,12 +163,12 @@ private:
     PODVector<Object*> eventSenders_;
     /// Active event handler. Not stored in a stack for performance reasons; is needed only in esoteric cases.
     EventHandler* eventHandler_;
-    /// Component categories.
-    HashMap<String, Vector<ShortStringHash> > componentCategories_;
+    /// Object categories.
+    HashMap<String, Vector<ShortStringHash> > objectCategories_;
 };
 
 template <class T> void Context::RegisterFactory() { RegisterFactory(new ObjectFactoryImpl<T>(this)); }
-template <class T> void Context::RegisterComponentFactory(const char* category) { RegisterComponentFactory(new ObjectFactoryImpl<T>(this), category); }
+template <class T> void Context::RegisterFactory(const char* category) { RegisterFactory(new ObjectFactoryImpl<T>(this), category); }
 template <class T> void Context::RemoveSubsystem() { RemoveSubsystem(T::GetTypeStatic()); }
 template <class T> void Context::RegisterAttribute(const AttributeInfo& attr) { RegisterAttribute(T::GetTypeStatic(), attr); }
 template <class T> void Context::RemoveAttribute(const char* name) { RemoveAttribute(T::GetTypeStatic(), name); }

+ 12 - 0
Engine/Core/Object.cpp

@@ -343,6 +343,18 @@ bool Object::HasSubscribedToEvent(Object* sender, StringHash eventType) const
         return FindSpecificEventHandler(sender, eventType) != 0;
 }
 
+const String& Object::GetCategory() const
+{
+    const HashMap<String, Vector<ShortStringHash> >& objectCategories = context_->GetObjectCategories();
+    for (HashMap<String, Vector<ShortStringHash> >::ConstIterator i = objectCategories.Begin(); i != objectCategories.End(); ++i)
+    {
+        if (i->second_.Contains(GetType()))
+            return i->first_;
+    }
+
+    return String::EMPTY;
+}
+
 EventHandler* Object::FindEventHandler(StringHash eventType, EventHandler** previous) const
 {
     EventHandler* handler = eventHandlers_.First();

+ 2 - 0
Engine/Core/Object.h

@@ -83,6 +83,8 @@ public:
     bool HasSubscribedToEvent(Object* sender, StringHash eventType) const;
     /// Template version of returning a subsystem.
     template <class T> T* GetSubsystem() const;
+    /// Return object category. Categories are (optionally) registered along with the object factory. Return an empty string if the object category is not registered.
+    const String& GetCategory() const;
     
 protected:
     /// Execution context.

+ 1 - 1
Engine/Engine/APITemplates.h

@@ -298,6 +298,7 @@ template <class T> void RegisterObject(asIScriptEngine* engine, const char* clas
     engine->RegisterObjectBehaviour(className, asBEHAVE_RELEASE, "void f()", asMETHODPR(T, ReleaseRef, (), void), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "ShortStringHash get_type() const", asMETHODPR(T, GetType, () const, ShortStringHash), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "const String& get_typeName() const", asMETHODPR(T, GetTypeName, () const, const String&), asCALL_THISCALL);
+    engine->RegisterObjectMethod(className, "const String& get_category() const", asMETHODPR(T, GetCategory, () const, const String&), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "int get_refs() const", asMETHODPR(T, Refs, () const, int), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "int get_weakRefs() const", asMETHODPR(T, WeakRefs, () const, int), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "void SendEvent(const String&in, VariantMap& eventData = VariantMap())", asFUNCTION(ObjectSendEvent<T>), asCALL_CDECL_OBJLAST);
@@ -399,7 +400,6 @@ template <class T> void RegisterComponent(asIScriptEngine* engine, const char* c
     engine->RegisterObjectMethod(className, "bool get_enabled() const", asMETHODPR(T, IsEnabled, () const, bool), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "bool get_enabledEffective() const", asMETHODPR(T, IsEnabledEffective, () const, bool), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "uint get_id()", asMETHODPR(T, GetID, () const, unsigned), asCALL_THISCALL);
-    engine->RegisterObjectMethod(className, "const String& get_category() const", asMETHODPR(T, GetCategory, () const, const String&), asCALL_THISCALL);
     if (nodeRegistered)
         engine->RegisterObjectMethod(className, "Node@+ get_node() const", asMETHODPR(T, GetNode, () const, Node*), asCALL_THISCALL);
     if (debugRendererRegistered)

+ 6 - 6
Engine/Engine/SceneAPI.cpp

@@ -122,16 +122,16 @@ static CScriptArray* SceneGetRequiredPackageFiles(Scene* ptr)
     return VectorToHandleArray<PackageFile>(ptr->GetRequiredPackageFiles(), "Array<PackageFile@>");
 }
 
-static CScriptArray* GetComponentCategories()
+static CScriptArray* GetObjectCategories()
 {
-    Vector<String> categories = GetScriptContext()->GetComponentCategories().Keys();
+    Vector<String> categories = GetScriptContext()->GetObjectCategories().Keys();
     Sort(categories.Begin(), categories.End());
     return VectorToArray<String>(categories, "Array<String>");
 }
 
-static CScriptArray* GetComponentsByCategory(const String& category)
+static CScriptArray* GetObjectsByCategory(const String& category)
 {
-    const HashMap<String, Vector<ShortStringHash> >& categories = GetScriptContext()->GetComponentCategories();
+    const HashMap<String, Vector<ShortStringHash> >& categories = GetScriptContext()->GetObjectCategories();
     Vector<String> components;
 
     HashMap<String, Vector<ShortStringHash> >::ConstIterator i = categories.Find(category);
@@ -218,8 +218,8 @@ static void RegisterScene(asIScriptEngine* engine)
     // Register Variant GetPtr() for Scene
     engine->RegisterObjectMethod("Variant", "Scene@+ GetScene() const", asFUNCTION(GetVariantPtr<Scene>), asCALL_CDECL_OBJLAST);
 
-    engine->RegisterGlobalFunction("Array<String>@ GetComponentCategories()", asFUNCTION(GetComponentCategories), asCALL_CDECL);
-    engine->RegisterGlobalFunction("Array<String>@ GetComponentsByCategory(const String&in)", asFUNCTION(GetComponentsByCategory), asCALL_CDECL);
+    engine->RegisterGlobalFunction("Array<String>@ GetObjectCategories()", asFUNCTION(GetObjectCategories), asCALL_CDECL);
+    engine->RegisterGlobalFunction("Array<String>@ GetObjectsByCategory(const String&in)", asFUNCTION(GetObjectsByCategory), asCALL_CDECL);
 }
 
 void RegisterSceneAPI(asIScriptEngine* engine)

+ 1 - 1
Engine/Graphics/AnimatedModel.cpp

@@ -80,7 +80,7 @@ AnimatedModel::~AnimatedModel()
 
 void AnimatedModel::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<AnimatedModel>(ANIMATION_CATEGORY);
+    context->RegisterFactory<AnimatedModel>(ANIMATION_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(AnimatedModel, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(AnimatedModel, VAR_RESOURCEREF, "Model", GetModelAttr, SetModelAttr, ResourceRef, ResourceRef(Model::GetTypeStatic()), AM_DEFAULT);

+ 1 - 1
Engine/Graphics/AnimationController.cpp

@@ -61,7 +61,7 @@ AnimationController::~AnimationController()
 
 void AnimationController::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<AnimationController>(ANIMATION_CATEGORY);
+    context->RegisterFactory<AnimationController>(ANIMATION_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(AnimationController, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(AnimationController, VAR_VARIANTVECTOR, "Animations", GetAnimationsAttr, SetAnimationsAttr, VariantVector, Variant::emptyVariantVector, AM_FILE | AM_NOEDIT);

+ 1 - 1
Engine/Graphics/BillboardSet.cpp

@@ -82,7 +82,7 @@ BillboardSet::~BillboardSet()
 
 void BillboardSet::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<BillboardSet>(EFFECT_CATEGORY);
+    context->RegisterFactory<BillboardSet>(EFFECT_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(BillboardSet, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(BillboardSet, VAR_RESOURCEREF, "Material", GetMaterialAttr, SetMaterialAttr, ResourceRef, ResourceRef(Material::GetTypeStatic()), AM_DEFAULT);

+ 1 - 1
Engine/Graphics/Camera.cpp

@@ -83,7 +83,7 @@ Camera::~Camera()
 
 void Camera::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<Camera>(SCENE_CATEGORY);
+    context->RegisterFactory<Camera>(SCENE_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(Camera, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Camera, VAR_FLOAT, "Near Clip", GetNearClip, SetNearClip, float, DEFAULT_NEARCLIP, AM_DEFAULT);

+ 1 - 1
Engine/Graphics/CustomGeometry.cpp

@@ -59,7 +59,7 @@ CustomGeometry::~CustomGeometry()
 
 void CustomGeometry::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<CustomGeometry>(STATIC_CATEGORY);
+    context->RegisterFactory<CustomGeometry>(STATIC_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(CustomGeometry, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATTRIBUTE(CustomGeometry, VAR_BOOL, "Is Occluder", occluder_, false, AM_DEFAULT);

+ 1 - 1
Engine/Graphics/DebugRenderer.cpp

@@ -62,7 +62,7 @@ DebugRenderer::~DebugRenderer()
 
 void DebugRenderer::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<DebugRenderer>(SUBSYSTEM_CATEGORY);
+    context->RegisterFactory<DebugRenderer>(SUBSYSTEM_CATEGORY);
 }
 
 void DebugRenderer::SetView(Camera* camera)

+ 1 - 1
Engine/Graphics/DecalSet.cpp

@@ -180,7 +180,7 @@ DecalSet::~DecalSet()
 
 void DecalSet::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<DecalSet>(EFFECT_CATEGORY);
+    context->RegisterFactory<DecalSet>(EFFECT_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(DecalSet, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(DecalSet, VAR_RESOURCEREF, "Material", GetMaterialAttr, SetMaterialAttr, ResourceRef, ResourceRef(Material::GetTypeStatic()), AM_DEFAULT);

+ 1 - 1
Engine/Graphics/Light.cpp

@@ -112,7 +112,7 @@ Light::~Light()
 
 void Light::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<Light>(SCENE_CATEGORY);
+    context->RegisterFactory<Light>(SCENE_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(Light, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ENUM_ACCESSOR_ATTRIBUTE(Light, "Light Type", GetLightType, SetLightType, LightType, typeNames, DEFAULT_LIGHTTYPE, AM_DEFAULT);

+ 1 - 1
Engine/Graphics/Octree.cpp

@@ -350,7 +350,7 @@ Octree::~Octree()
 
 void Octree::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<Octree>(SUBSYSTEM_CATEGORY);
+    context->RegisterFactory<Octree>(SUBSYSTEM_CATEGORY);
 
     Vector3 defaultBoundsMin = -Vector3::ONE * DEFAULT_OCTREE_SIZE;
     Vector3 defaultBoundsMax = Vector3::ONE * DEFAULT_OCTREE_SIZE;

+ 1 - 1
Engine/Graphics/ParticleEmitter.cpp

@@ -81,7 +81,7 @@ ParticleEmitter::~ParticleEmitter()
 
 void ParticleEmitter::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<ParticleEmitter>(EFFECT_CATEGORY);
+    context->RegisterFactory<ParticleEmitter>(EFFECT_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(ParticleEmitter, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(ParticleEmitter, VAR_RESOURCEREF, "Parameter Source", GetParameterSourceAttr, SetParameterSourceAttr, ResourceRef, ResourceRef(XMLFile::GetTypeStatic()), AM_DEFAULT);

+ 1 - 1
Engine/Graphics/Skybox.cpp

@@ -48,7 +48,7 @@ Skybox::~Skybox()
 
 void Skybox::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<Skybox>(ENVIRONMENT_CATEGORY);
+    context->RegisterFactory<Skybox>(ENVIRONMENT_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(Skybox, StaticModel);
 }

+ 1 - 1
Engine/Graphics/StaticModel.cpp

@@ -57,7 +57,7 @@ StaticModel::~StaticModel()
 
 void StaticModel::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<StaticModel>(STATIC_CATEGORY);
+    context->RegisterFactory<StaticModel>(STATIC_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(StaticModel, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(StaticModel, VAR_RESOURCEREF, "Model", GetModelAttr, SetModelAttr, ResourceRef, ResourceRef(Model::GetTypeStatic()), AM_DEFAULT);

+ 1 - 1
Engine/Graphics/Terrain.cpp

@@ -91,7 +91,7 @@ Terrain::~Terrain()
 
 void Terrain::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<Terrain>(ENVIRONMENT_CATEGORY);
+    context->RegisterFactory<Terrain>(ENVIRONMENT_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(Terrain, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Terrain, VAR_RESOURCEREF, "Height Map", GetHeightMapAttr, SetHeightMapAttr, ResourceRef, ResourceRef(Image::GetTypeStatic()), AM_DEFAULT);

+ 1 - 1
Engine/Graphics/TerrainPatch.cpp

@@ -70,7 +70,7 @@ TerrainPatch::~TerrainPatch()
 
 void TerrainPatch::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<TerrainPatch>(ENVIRONMENT_CATEGORY);
+    context->RegisterFactory<TerrainPatch>(ENVIRONMENT_CATEGORY);
 }
 
 void TerrainPatch::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryResult>& results)

+ 1 - 1
Engine/Graphics/Zone.cpp

@@ -64,7 +64,7 @@ Zone::~Zone()
 
 void Zone::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<Zone>(SCENE_CATEGORY);
+    context->RegisterFactory<Zone>(SCENE_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(Zone, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATTRIBUTE(Zone, VAR_VECTOR3, "Bounding Box Min", boundingBox_.min_, DEFAULT_BOUNDING_BOX_MIN, AM_DEFAULT);

+ 1 - 1
Engine/Navigation/Navigable.cpp

@@ -45,7 +45,7 @@ Navigable::~Navigable()
 
 void Navigable::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<Navigable>(NAVIGATION_CATEGORY);
+    context->RegisterFactory<Navigable>(NAVIGATION_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(Navigable, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATTRIBUTE(Navigable, VAR_BOOL, "Recursive", recursive_, true, AM_DEFAULT);

+ 1 - 1
Engine/Navigation/NavigationMesh.cpp

@@ -182,7 +182,7 @@ NavigationMesh::~NavigationMesh()
 
 void NavigationMesh::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<NavigationMesh>(NAVIGATION_CATEGORY);
+    context->RegisterFactory<NavigationMesh>(NAVIGATION_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(NavigationMesh, VAR_INT, "Tile Size", GetTileSize, SetTileSize, int, DEFAULT_TILE_SIZE, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(NavigationMesh, VAR_FLOAT, "Cell Size", GetCellSize, SetCellSize, float, DEFAULT_CELL_SIZE, AM_DEFAULT);

+ 1 - 1
Engine/Navigation/OffMeshConnection.cpp

@@ -52,7 +52,7 @@ OffMeshConnection::~OffMeshConnection()
 
 void OffMeshConnection::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<OffMeshConnection>(NAVIGATION_CATEGORY);
+    context->RegisterFactory<OffMeshConnection>(NAVIGATION_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(OffMeshConnection, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATTRIBUTE(OffMeshConnection, VAR_INT, "Endpoint NodeID", endPointID_, 0, AM_DEFAULT | AM_NODEID);

+ 1 - 1
Engine/Network/NetworkPriority.cpp

@@ -53,7 +53,7 @@ NetworkPriority::~NetworkPriority()
 
 void NetworkPriority::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<NetworkPriority>(NETWORK_CATEGORY);
+    context->RegisterFactory<NetworkPriority>(NETWORK_CATEGORY);
     
     ATTRIBUTE(NetworkPriority, VAR_FLOAT, "Base Priority", basePriority_, DEFAULT_BASE_PRIORITY, AM_DEFAULT);
     ATTRIBUTE(NetworkPriority, VAR_FLOAT, "Distance Factor", distanceFactor_, DEFAULT_DISTANCE_FACTOR, AM_DEFAULT);

+ 1 - 1
Engine/Physics/CollisionShape.cpp

@@ -273,7 +273,7 @@ CollisionShape::~CollisionShape()
 
 void CollisionShape::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<CollisionShape>(PHYSICS_CATEGORY);
+    context->RegisterFactory<CollisionShape>(PHYSICS_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(CollisionShape, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ENUM_ATTRIBUTE(CollisionShape, "Shape Type", shapeType_, typeNames, SHAPE_BOX, AM_DEFAULT);

+ 1 - 1
Engine/Physics/Constraint.cpp

@@ -82,7 +82,7 @@ Constraint::~Constraint()
 
 void Constraint::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<Constraint>(PHYSICS_CATEGORY);
+    context->RegisterFactory<Constraint>(PHYSICS_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(Constraint, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ENUM_ATTRIBUTE(Constraint, "Constraint Type", constraintType_, typeNames, CONSTRAINT_POINT, AM_DEFAULT);

+ 1 - 1
Engine/Physics/PhysicsWorld.cpp

@@ -155,7 +155,7 @@ PhysicsWorld::~PhysicsWorld()
 
 void PhysicsWorld::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<PhysicsWorld>(SUBSYSTEM_CATEGORY);
+    context->RegisterFactory<PhysicsWorld>(SUBSYSTEM_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(PhysicsWorld, VAR_VECTOR3, "Gravity", GetGravity, SetGravity, Vector3, DEFAULT_GRAVITY, AM_DEFAULT);
     ATTRIBUTE(PhysicsWorld, VAR_INT, "Physics FPS", fps_, DEFAULT_FPS, AM_DEFAULT);

+ 1 - 1
Engine/Physics/RigidBody.cpp

@@ -95,7 +95,7 @@ RigidBody::~RigidBody()
 
 void RigidBody::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<RigidBody>(PHYSICS_CATEGORY);
+    context->RegisterFactory<RigidBody>(PHYSICS_CATEGORY);
 
     ACCESSOR_ATTRIBUTE(RigidBody, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(RigidBody, VAR_VECTOR3, "Physics Position", GetPosition, SetPosition, Vector3, Vector3::ZERO, AM_FILE | AM_NOEDIT);

+ 0 - 12
Engine/Scene/Component.cpp

@@ -197,18 +197,6 @@ void Component::MarkNetworkUpdate()
     }
 }
 
-const String& Component::GetCategory() const
-{
-    const HashMap<String, Vector<ShortStringHash> >& componentCategories = context_->GetComponentCategories();
-    for (HashMap<String, Vector<ShortStringHash> >::ConstIterator i = componentCategories.Begin(); i != componentCategories.End(); ++i)
-    {
-        if (i->second_.Contains(GetType()))
-            return i->first_;
-    }
-
-    return String::EMPTY;
-}
-
 void Component::SetID(unsigned id)
 {
     id_ = id;

+ 0 - 3
Engine/Scene/Component.h

@@ -93,9 +93,6 @@ public:
     /// Mark for attribute check on the next network update.
     void MarkNetworkUpdate();
     
-    /// Return component category. Return an empty string if the component category is not registered.
-    const String& GetCategory() const;
-
 protected:
     /// Handle scene node being assigned at creation.
     virtual void OnNodeSet(Node* node) {};

+ 1 - 1
Engine/Scene/SmoothedTransform.cpp

@@ -50,7 +50,7 @@ SmoothedTransform::~SmoothedTransform()
 
 void SmoothedTransform::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<SmoothedTransform>(NETWORK_CATEGORY);
+    context->RegisterFactory<SmoothedTransform>(NETWORK_CATEGORY);
 }
 
 void SmoothedTransform::Update(float constant, float squaredSnapThreshold)

+ 1 - 1
Engine/Script/ScriptInstance.cpp

@@ -81,7 +81,7 @@ ScriptInstance::~ScriptInstance()
 
 void ScriptInstance::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<ScriptInstance>(SCRIPT_CATEGORY);
+    context->RegisterFactory<ScriptInstance>(SCRIPT_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(ScriptInstance, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(ScriptInstance, VAR_RESOURCEREF, "Script File", GetScriptFileAttr, SetScriptFileAttr, ResourceRef, ResourceRef(ScriptFile::GetTypeStatic()), AM_DEFAULT);

+ 2 - 1
Engine/UI/BorderImage.cpp

@@ -32,6 +32,7 @@ namespace Urho3D
 {
 
 extern const char* blendModeNames[];
+extern const char* UI_CATEGORY;
 
 template<> BlendMode Variant::Get<BlendMode>() const
 {
@@ -56,7 +57,7 @@ BorderImage::~BorderImage()
 
 void BorderImage::RegisterObject(Context* context)
 {
-    context->RegisterFactory<BorderImage>();
+    context->RegisterFactory<BorderImage>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(BorderImage, UIElement);
     ACCESSOR_ATTRIBUTE(BorderImage, VAR_RESOURCEREF, "Texture", GetTextureAttr, SetTextureAttr, ResourceRef, ResourceRef(Texture2D::GetTypeStatic()), AM_FILE);

+ 3 - 1
Engine/UI/Button.cpp

@@ -31,6 +31,8 @@
 namespace Urho3D
 {
 
+extern const char* UI_CATEGORY;
+
 OBJECTTYPESTATIC(Button);
 
 Button::Button(Context* context) :
@@ -51,7 +53,7 @@ Button::~Button()
 
 void Button::RegisterObject(Context* context)
 {
-    context->RegisterFactory<Button>();
+    context->RegisterFactory<Button>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(Button, BorderImage);
     UPDATE_ATTRIBUTE_DEFAULT_VALUE(Button, "Is Enabled", true);

+ 3 - 1
Engine/UI/CheckBox.cpp

@@ -31,6 +31,8 @@
 namespace Urho3D
 {
 
+extern const char* UI_CATEGORY;
+
 OBJECTTYPESTATIC(CheckBox);
 
 CheckBox::CheckBox(Context* context) :
@@ -47,7 +49,7 @@ CheckBox::~CheckBox()
 
 void CheckBox::RegisterObject(Context* context)
 {
-    context->RegisterFactory<CheckBox>();
+    context->RegisterFactory<CheckBox>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(CheckBox, BorderImage);
     UPDATE_ATTRIBUTE_DEFAULT_VALUE(CheckBox, "Is Enabled", true);

+ 3 - 1
Engine/UI/Cursor.cpp

@@ -47,6 +47,8 @@ static const char* shapeNames[] =
     0
 };
 
+extern const char* UI_CATEGORY;
+
 OBJECTTYPESTATIC(Cursor);
 
 Cursor::Cursor(Context* context) :
@@ -80,7 +82,7 @@ Cursor::~Cursor()
 
 void Cursor::RegisterObject(Context* context)
 {
-    context->RegisterFactory<Cursor>();
+    context->RegisterFactory<Cursor>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(Cursor, BorderImage);
     UPDATE_ATTRIBUTE_DEFAULT_VALUE(Cursor, "Priority", M_MAX_INT);

+ 3 - 1
Engine/UI/DropDownList.cpp

@@ -33,6 +33,8 @@
 namespace Urho3D
 {
 
+extern const char* UI_CATEGORY;
+
 OBJECTTYPESTATIC(DropDownList);
 
 DropDownList::DropDownList(Context* context) :
@@ -65,7 +67,7 @@ DropDownList::~DropDownList()
 
 void DropDownList::RegisterObject(Context* context)
 {
-    context->RegisterFactory<DropDownList>();
+    context->RegisterFactory<DropDownList>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(DropDownList, Menu);
     ACCESSOR_ATTRIBUTE(DropDownList, VAR_INT, "Selection", GetSelection, SetSelectionAttr, unsigned, 0, AM_FILE);

+ 3 - 1
Engine/UI/LineEdit.cpp

@@ -33,6 +33,8 @@
 namespace Urho3D
 {
 
+extern const char* UI_CATEGORY;
+
 OBJECTTYPESTATIC(LineEdit);
 
 LineEdit::LineEdit(Context* context) :
@@ -71,7 +73,7 @@ LineEdit::~LineEdit()
 
 void LineEdit::RegisterObject(Context* context)
 {
-    context->RegisterFactory<LineEdit>();
+    context->RegisterFactory<LineEdit>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(LineEdit, BorderImage);
     UPDATE_ATTRIBUTE_DEFAULT_VALUE(LineEdit, "Clip Children", true);

+ 3 - 1
Engine/UI/ListView.cpp

@@ -50,6 +50,8 @@ template<> HighlightMode Variant::Get<HighlightMode>() const
 
 static const ShortStringHash expandedHash("Expanded");
 
+extern const char* UI_CATEGORY;
+
 bool GetItemExpanded(UIElement* item)
 {
     return item ? item->GetVar(expandedHash).GetBool() : false;
@@ -183,7 +185,7 @@ ListView::~ListView()
 
 void ListView::RegisterObject(Context* context)
 {
-    context->RegisterFactory<ListView>();
+    context->RegisterFactory<ListView>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(HierarchyContainer, UIElement);
     COPY_BASE_ATTRIBUTES(ListView, ScrollView);

+ 4 - 2
Engine/UI/Menu.cpp

@@ -34,8 +34,10 @@
 namespace Urho3D
 {
 
-extern ShortStringHash VAR_ORIGIN;
 const ShortStringHash VAR_SHOW_POPUP("ShowPopup");
+extern ShortStringHash VAR_ORIGIN;
+
+extern const char* UI_CATEGORY;
 
 OBJECTTYPESTATIC(Menu);
 
@@ -61,7 +63,7 @@ Menu::~Menu()
 
 void Menu::RegisterObject(Context* context)
 {
-    context->RegisterFactory<Menu>();
+    context->RegisterFactory<Menu>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(Menu, Button);
     REF_ACCESSOR_ATTRIBUTE(Menu, VAR_INTVECTOR2, "Popup Offset", GetPopupOffset, SetPopupOffset, IntVector2, IntVector2::ZERO, AM_FILE);

+ 2 - 1
Engine/UI/ScrollBar.cpp

@@ -36,6 +36,7 @@ static const float DEFAULT_REPEAT_DELAY = 0.4f;
 static const float DEFAULT_REPEAT_RATE = 20.0f;
 
 extern const char* orientations[];
+extern const char* UI_CATEGORY;
 
 OBJECTTYPESTATIC(ScrollBar);
 
@@ -75,7 +76,7 @@ ScrollBar::~ScrollBar()
 
 void ScrollBar::RegisterObject(Context* context)
 {
-    context->RegisterFactory<ScrollBar>();
+    context->RegisterFactory<ScrollBar>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(ScrollBar, UIElement);
     UPDATE_ATTRIBUTE_DEFAULT_VALUE(ScrollBar, "Is Enabled", true);

+ 3 - 1
Engine/UI/ScrollView.cpp

@@ -35,6 +35,8 @@ namespace Urho3D
 
 static const float STEP_FACTOR = 300.0f;
 
+extern const char* UI_CATEGORY;
+
 OBJECTTYPESTATIC(ScrollView);
 
 ScrollView::ScrollView(Context* context) :
@@ -76,7 +78,7 @@ ScrollView::~ScrollView()
 
 void ScrollView::RegisterObject(Context* context)
 {
-    context->RegisterFactory<ScrollView>();
+    context->RegisterFactory<ScrollView>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(ScrollView, UIElement);
     UPDATE_ATTRIBUTE_DEFAULT_VALUE(ScrollView, "Clip Children", true);

+ 3 - 1
Engine/UI/Slider.cpp

@@ -44,6 +44,8 @@ template<> Orientation Variant::Get<Orientation>() const
     return (Orientation)GetInt();
 }
 
+extern const char* UI_CATEGORY;
+
 OBJECTTYPESTATIC(Slider);
 
 Slider::Slider(Context* context) :
@@ -67,7 +69,7 @@ Slider::~Slider()
 
 void Slider::RegisterObject(Context* context)
 {
-    context->RegisterFactory<Slider>();
+    context->RegisterFactory<Slider>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(Slider, BorderImage);
     UPDATE_ATTRIBUTE_DEFAULT_VALUE(Slider, "Is Enabled", true);

+ 2 - 1
Engine/UI/Sprite.cpp

@@ -34,6 +34,7 @@ namespace Urho3D
 extern const char* blendModeNames[];
 extern const char* horizontalAlignments[];
 extern const char* verticalAlignments[];
+extern const char* UI_CATEGORY;
 
 OBJECTTYPESTATIC(Sprite);
 
@@ -54,7 +55,7 @@ Sprite::~Sprite()
 
 void Sprite::RegisterObject(Context* context)
 {
-    context->RegisterFactory<Sprite>();
+    context->RegisterFactory<Sprite>(UI_CATEGORY);
     
     REF_ACCESSOR_ATTRIBUTE(Sprite, VAR_STRING, "Name", GetName, SetName, String, String::EMPTY, AM_FILE);
     REF_ACCESSOR_ATTRIBUTE(Sprite, VAR_VECTOR2, "Position", GetPosition, SetPosition, Vector2, Vector2::ZERO, AM_FILE);

+ 2 - 1
Engine/UI/Text.cpp

@@ -38,6 +38,7 @@ namespace Urho3D
 static const float MIN_ROW_SPACING = 0.5f;
 
 extern const char* horizontalAlignments[];
+extern const char* UI_CATEGORY;
 
 struct GlyphLocation
 {
@@ -77,7 +78,7 @@ Text::~Text()
 
 void Text::RegisterObject(Context* context)
 {
-    context->RegisterFactory<Text>();
+    context->RegisterFactory<Text>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(Text, UIElement);
     UPDATE_ATTRIBUTE_DEFAULT_VALUE(Text, "Use Derived Opacity", false);

+ 1 - 1
Engine/UI/Text3D.cpp

@@ -63,7 +63,7 @@ Text3D::~Text3D()
 
 void Text3D::RegisterObject(Context* context)
 {
-    context->RegisterComponentFactory<Text3D>(EFFECT_CATEGORY);
+    context->RegisterFactory<Text3D>(EFFECT_CATEGORY);
     
     ACCESSOR_ATTRIBUTE(Text3D, VAR_BOOL, "Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(Text3D, VAR_RESOURCEREF, "Font", GetFontAttr, SetFontAttr, ResourceRef, ResourceRef(Font::GetTypeStatic()), AM_DEFAULT);

+ 2 - 0
Engine/UI/UI.cpp

@@ -63,6 +63,8 @@ const ShortStringHash VAR_ORIGINAL_CHILD_INDEX("OriginalChildIndex");
 const ShortStringHash VAR_PARENT_CHANGED("ParentChanged");
 const ShortStringHash VAR_NO_AUTO_REMOVE("NoAutoRemove");
 
+const char* UI_CATEGORY = "UI";
+
 OBJECTTYPESTATIC(UI);
 
 UI::UI(Context* context) :

+ 3 - 1
Engine/UI/UIElement.cpp

@@ -79,6 +79,8 @@ static const char* layoutModes[] =
     0
 };
 
+extern const char* UI_CATEGORY;
+
 static bool CompareUIElements(const UIElement* lhs, const UIElement* rhs)
 {
     return lhs->GetPriority() < rhs->GetPriority();
@@ -163,7 +165,7 @@ UIElement::~UIElement()
 
 void UIElement::RegisterObject(Context* context)
 {
-    context->RegisterFactory<UIElement>();
+    context->RegisterFactory<UIElement>(UI_CATEGORY);
 
     REF_ACCESSOR_ATTRIBUTE(UIElement, VAR_STRING, "Name", GetName, SetName, String, String::EMPTY, AM_FILE);
     REF_ACCESSOR_ATTRIBUTE(UIElement, VAR_INTVECTOR2, "Position", GetPosition, SetPosition, IntVector2, IntVector2::ZERO, AM_FILE);

+ 3 - 1
Engine/UI/Window.cpp

@@ -34,6 +34,8 @@ namespace Urho3D
 
 static const int DEFAULT_RESIZE_BORDER = 4;
 
+extern const char* UI_CATEGORY;
+
 OBJECTTYPESTATIC(Window);
 
 Window::Window(Context* context) :
@@ -59,7 +61,7 @@ Window::~Window()
 
 void Window::RegisterObject(Context* context)
 {
-    context->RegisterFactory<Window>();
+    context->RegisterFactory<Window>(UI_CATEGORY);
 
     COPY_BASE_ATTRIBUTES(Window, BorderImage);
     UPDATE_ATTRIBUTE_DEFAULT_VALUE(Window, "Bring To Front", true);