Water gun cargo crate (#16172)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Decals;
|
||||
using Content.Shared.Sprite;
|
||||
using Robust.Shared.GameStates;
|
||||
@@ -27,17 +26,29 @@ public sealed class RandomSpriteSystem: SharedRandomSpriteSystem
|
||||
if (component.Available.Count == 0)
|
||||
return;
|
||||
|
||||
var group = _random.Pick(component.Available);
|
||||
component.Selected.EnsureCapacity(group.Count);
|
||||
|
||||
foreach (var layer in group)
|
||||
var groups = new List<Dictionary<string, (string, string?)>>();
|
||||
if (component.GetAllGroups)
|
||||
{
|
||||
Color? color = null;
|
||||
groups = component.Available;
|
||||
}
|
||||
else
|
||||
{
|
||||
groups.Add(_random.Pick(component.Available));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(layer.Value.Color))
|
||||
color = _random.Pick(_prototype.Index<ColorPalettePrototype>(layer.Value.Color).Colors.Values);
|
||||
component.Selected.EnsureCapacity(groups.Count);
|
||||
|
||||
component.Selected.Add(layer.Key, (layer.Value.State, color));
|
||||
foreach (var group in groups)
|
||||
{
|
||||
foreach (var layer in group)
|
||||
{
|
||||
Color? color = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(layer.Value.Item2))
|
||||
color = _random.Pick(_prototype.Index<ColorPalettePrototype>(layer.Value.Item2).Colors.Values);
|
||||
|
||||
component.Selected.Add(layer.Key, (layer.Value.Item1, color));
|
||||
}
|
||||
}
|
||||
|
||||
Dirty(component);
|
||||
|
||||
Reference in New Issue
Block a user