[REQUEST] Allow Dynamic Addition and Removal of DisplayPanels

WeiYiHua

Member
Hello, the latest version of DisplayPanel has introduced the UnInitialize method, which is a great improvement.

In a previous version, I also implemented a similar method on my own, and I added an UnregisterPanel method to the DisplayPanelManager.

I've noticed that in the latest version, the UnInitialize method in DisplayPanelManager calls UnInitialize on all panels stored in m_AllUIPanels. However, I've also found numerous instances where the Setup method of DisplayPanel is called to set up the panel within DisplayPanelManager, such as in ItemActionWithConfirmationPopUp. These Setup calls do not add the DisplayPanel to m_AllUIPanels; they only add them to m_PanelsByName. This might lead to issues.

In light of the above, I suggest adding an UnregisterPanel method to DisplayPanelManager. Within the RegisterPanel and UnregisterPanel methods, m_AllUIPanels can be dynamically updated. Finally, a call to UnregisterPanel should be included in the UnInitialize method of DisplayPanel. This approach should establish a comprehensive process for adding and removing DisplayPanel instances dynamically. It's possible that there are still undiscovered bugs related to dynamic DisplayPanel behavior, and I'll continue to monitor and track these issues.
 
That's a great point!
I added that function because someone requested it. But as you pointed out, I might have missed some edge cases.
I will look into what you mentioned in detail
 
Top