mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix OverlayManager.RemoveOverlay (#5623)
This commit is contained in:
@@ -43,7 +43,7 @@ END TEMPLATE-->
|
||||
|
||||
### Bugfixes
|
||||
|
||||
*None yet*
|
||||
* Fixed one of the `IOverlayManager.RemoveOverlay` overrides not fully removing the overlay.
|
||||
|
||||
### Other
|
||||
|
||||
|
||||
@@ -40,10 +40,9 @@ internal sealed class OverlayManager : IOverlayManagerInternal, IPostInjectInit
|
||||
|
||||
public bool AddOverlay(Overlay overlay)
|
||||
{
|
||||
if (_overlays.ContainsKey(overlay.GetType()))
|
||||
if (!_overlays.TryAdd(overlay.GetType(), overlay))
|
||||
return false;
|
||||
|
||||
_overlays.Add(overlay.GetType(), overlay);
|
||||
Sort();
|
||||
return true;
|
||||
}
|
||||
@@ -68,7 +67,7 @@ internal sealed class OverlayManager : IOverlayManagerInternal, IPostInjectInit
|
||||
|
||||
public bool RemoveOverlay(Overlay overlay)
|
||||
{
|
||||
return _overlays.Remove(overlay.GetType());
|
||||
return RemoveOverlay(overlay.GetType());
|
||||
}
|
||||
|
||||
public bool TryGetOverlay(Type overlayClass, [NotNullWhen(true)] out Overlay? overlay)
|
||||
|
||||
Reference in New Issue
Block a user