Hey everyone!
I’m having a problem with creating a tabbed window that appears docked in the level editor, ala the scene outliner. I’ve gone over some of the relevant source code, but it seems that what happens is that the scene outliner is registered to the level editor’s tab manager during the initialization of the level editor (i.e. hardcoded into the source itself, and not created as the result of plugging into an extensibility point).
My understanding of a tab manager is that it is an object that is responsible for the instantiation (via a callback) of each tab, as well as its orientation and “dockedness” in relation to other tabs. It seems you have to register a tab with a unique string and a special callback, then you create the tab by telling the manager to instantiate a certain tab ID. So far so good…
But, since the level editor’s tab manager is null when my module starts, I can’t register a tab with it. When I try to create a tab using the level editor’s tab manager (later, as a result of pressing a button I added to the UI), but that tab is registered with the global tab manager, I get an “unknown tab” tab in the level editor. Which makes sense of course; I wouldn’t expect the tab managers to cascade tab definitions (but I had to try anyway).
So I seem to be stuck. I can think of a few possible solutions:
A) Can I create a new tab and parent it to the level editor? I’ve tried doing something like “newTab.SetParent(LevelManager.GetTab().GetParent())” but that has no effect (perhaps because LevelManager.GetTab().GetParent() returns the parent tab manager, i.e. the global tab manager).
B) Can I run code in my module after the level manager is created and fully loaded?
A third option is that I am completely missing the point somewhere, but I can’t seem to find where that may be. Any guidance on this topic would be greatly appreciated.
Thanks!