()
| 226 | } |
| 227 | |
| 228 | private void RefreshActorTabs() |
| 229 | { |
| 230 | // Remove tabs |
| 231 | var tabs = new List<Tab>(); |
| 232 | foreach (var child in _actorGroups.Children) |
| 233 | { |
| 234 | if (child is Tab tab) |
| 235 | { |
| 236 | if (tab.Text != "Search") |
| 237 | tabs.Add(tab); |
| 238 | } |
| 239 | } |
| 240 | foreach (var tab in tabs) |
| 241 | { |
| 242 | var group = _actorGroups.Children.Find(T => T == tab); |
| 243 | group.Dispose(); |
| 244 | } |
| 245 | |
| 246 | // Add primitives to primtives and search tab |
| 247 | groupPrimitives = CreateGroupWithList(_actorGroups, "Primitives"); |
| 248 | |
| 249 | groupPrimitives.AddChild(CreateEditorAssetItem("Cube", "Primitives/Cube.flax")); |
| 250 | _groupSearch.AddChild(CreateEditorAssetItem("Cube", "Primitives/Cube.flax")); |
| 251 | groupPrimitives.AddChild(CreateEditorAssetItem("Sphere", "Primitives/Sphere.flax")); |
| 252 | _groupSearch.AddChild(CreateEditorAssetItem("Sphere", "Primitives/Sphere.flax")); |
| 253 | groupPrimitives.AddChild(CreateEditorAssetItem("Plane", "Primitives/Plane.flax")); |
| 254 | _groupSearch.AddChild(CreateEditorAssetItem("Plane", "Primitives/Plane.flax")); |
| 255 | groupPrimitives.AddChild(CreateEditorAssetItem("Cylinder", "Primitives/Cylinder.flax")); |
| 256 | _groupSearch.AddChild(CreateEditorAssetItem("Cylinder", "Primitives/Cylinder.flax")); |
| 257 | groupPrimitives.AddChild(CreateEditorAssetItem("Cone", "Primitives/Cone.flax")); |
| 258 | _groupSearch.AddChild(CreateEditorAssetItem("Cone", "Primitives/Cone.flax")); |
| 259 | groupPrimitives.AddChild(CreateEditorAssetItem("Capsule", "Primitives/Capsule.flax")); |
| 260 | _groupSearch.AddChild(CreateEditorAssetItem("Capsule", "Primitives/Capsule.flax")); |
| 261 | |
| 262 | // Created first to order specific tabs |
| 263 | CreateGroupWithList(_actorGroups, "Lights"); |
| 264 | CreateGroupWithList(_actorGroups, "Visuals"); |
| 265 | CreateGroupWithList(_actorGroups, "Physics"); |
| 266 | CreateGroupWithList(_actorGroups, "GUI"); |
| 267 | CreateGroupWithList(_actorGroups, "Other"); |
| 268 | |
| 269 | // Add control types to tabs |
| 270 | foreach (var controlType in Editor.Instance.CodeEditing.Controls.Get()) |
| 271 | { |
| 272 | if (controlType.IsAbstract) |
| 273 | continue; |
| 274 | _groupSearch.AddChild(CreateControlItem(Utilities.Utils.GetPropertyNameUI(controlType.Name), controlType)); |
| 275 | ActorToolboxAttribute attribute = null; |
| 276 | foreach (var e in controlType.GetAttributes(false)) |
| 277 | { |
| 278 | if (e is ActorToolboxAttribute actorToolboxAttribute) |
| 279 | { |
| 280 | attribute = actorToolboxAttribute; |
| 281 | break; |
| 282 | } |
| 283 | } |
| 284 | if (attribute == null) |
| 285 | continue; |
nothing calls this directly
no test coverage detected