Fixed exceptions in GUIListBox.Select if any of the children have null userdata, option to add tooltips to GUIDropDown items
This commit is contained in:
@@ -115,10 +115,11 @@ namespace Barotrauma
|
||||
listBox.AddChild(child);
|
||||
}
|
||||
|
||||
public void AddItem(string text, object userData = null)
|
||||
public void AddItem(string text, object userData = null, string toolTip = "")
|
||||
{
|
||||
GUITextBlock textBlock = new GUITextBlock(new Rectangle(0,0,0,20), text, "ListBoxElement", Alignment.TopLeft, Alignment.CenterLeft, listBox);
|
||||
textBlock.UserData = userData;
|
||||
textBlock.ToolTip = toolTip;
|
||||
}
|
||||
|
||||
public override void ClearChildren()
|
||||
|
||||
Reference in New Issue
Block a user