Previous Panel Opening after closing

Zaddo

Active member
I control the inventory panels open/close with a custom script. I have a problem with the panels automatically opening after I close them.

The DisplayPanelManager doesn't support closing a panel without automatically opening the previous panel. I fixed this in my project with a minor mod, see below code that passes through the selectPrevious parameter, giving control over the open previous panel functionality. Would you please consider making this change to UIS?

Here is what is happening:
1. Call DisplayPanelManager.OpenPanel. This will call the DisplayPanel.Open, passing the current selectable in the second parameter.
2. The variable m_PreviousPanel is set to the current selectable parameter
3. I subsequently call DisplayPanelManager.ClosePanel for the panel opened in step 1. This calls DisplayPanel.Close, with no parameters
4. DisplayPanel.Close, defaults the selectPrevious parameter to true, because no parameter was passed
5. DisplayPanel.Close checks is selectPrevious is ture, which it is, it then automatically opens m_PreviousPanel that was set in step 2

The DisplayPanelManager currently has no methods that allow this situation to be avoided.

C#:
        public void ClosePanel(string uniqueName, bool selectPrevious = true)
        {
            var panel = GetPanel(uniqueName);
            if (panel != null) {
                panel.Close(selectPrevious);
            }
        }
 
Last edited:
That's a very good idea. thank you for the suggestion.
I made the change and it will be available in the next update.
 
Top