public void BoxClosed(IUIBox origin)
{
this.infoDisplay.UnregisterChanges();
if (origin == this.attributeBox)
{
attributeBox = null;
}
}
public override void Close(bool closeImmediately)
{
if (UIBoxSetting.IsActive(this.attributeBox))
{
if (closeImmediately)
{
this.infoDisplay.UnregisterChanges();
this.attributeBox.Control = null;
this.attributeBox.CloseImmediately();
this.attributeBox = null;
}
else
{
attributeBox.Close();
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
if (this.attributeBox == null || this.attributeBox.IsClosingOrClosed)
{
//Background UI box
attributeBox = attributeButtonUIBox.Create();
}
However the background UI still does not close when I press the close button and I am trying to figure out why.
this.screen.CloseImmediate();
underneath attributeBox.Close() the background closes as well and the menu functions normally.
Is there a reason that the background isn't closing when I press the close key with 3 menu parts attached, 2 of them custom (1 custom one is essentially just a single button rather than a button list)? Kinda pointless to include when you could just use a button list with a single item, but I dunno, I seperated it out. It seems like the close function of the background UI just isn't being called and after messing with settings I haven't found a solution other than inserting the line above.
A simple one line change to the source code fixes this but I should bring it to your attention because it seems to have been missed. Image attached (if you can zoom in and read the font, basically its the Close() and DoCloseFades() methods of the MenuScreen class)
Alternatively I suppose you could put the line of code at the end of the close function.
Otherwise I'd probably need to see more of your code to see what's going on. Regarding backgrounds, did you add your own backgrounds code to your menu part or are you refering to the menu screen's background settings?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Adding the FinishClosing line fixed everything.