Progress on multiplayer campaign:
- Moved SaveUtils to the shared project. - Moved the "new game"/"load game" menu logic to a separate class. - Somewhat functional campaign UI in the server lobby (only the map view is usable atm though).
This commit is contained in:
@@ -525,9 +525,19 @@ namespace Barotrauma
|
||||
if (children.Contains(child)) children.Remove(child);
|
||||
}
|
||||
|
||||
public GUIComponent FindChild(object userData)
|
||||
public GUIComponent FindChild(object userData, bool recursive = false)
|
||||
{
|
||||
return children.FirstOrDefault(c => c.userData == userData);
|
||||
var matchingChild = children.FirstOrDefault(c => c.userData == userData);
|
||||
if (recursive && matchingChild == null)
|
||||
{
|
||||
foreach (GUIComponent child in children)
|
||||
{
|
||||
matchingChild = child.FindChild(userData, recursive);
|
||||
if (matchingChild != null) return matchingChild;
|
||||
}
|
||||
}
|
||||
|
||||
return matchingChild;
|
||||
}
|
||||
|
||||
public List<GUIComponent> FindChildren(object userData)
|
||||
|
||||
Reference in New Issue
Block a user