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:
Joonas Rikkonen
2017-08-31 18:53:37 +03:00
parent c7ae91da42
commit c1f5e3cbda
18 changed files with 856 additions and 601 deletions
@@ -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)