Improved solution container visuals (#13791)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.Chemistry.Reagent;
|
using Content.Shared.Chemistry.Reagent;
|
||||||
|
using Content.Shared.Rounding;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
@@ -41,7 +42,6 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem<SolutionCo
|
|||||||
Logger.Error("Attempted to set solution container visuals volume ratio on " + ToPrettyString(uid) + " to a value greater than 1. Volume should never be greater than max volume!");
|
Logger.Error("Attempted to set solution container visuals volume ratio on " + ToPrettyString(uid) + " to a value greater than 1. Volume should never be greater than max volume!");
|
||||||
fraction = 1f;
|
fraction = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (component.Metamorphic)
|
if (component.Metamorphic)
|
||||||
{
|
{
|
||||||
if (args.Sprite.LayerMapTryGet(component.BaseLayer, out var baseLayer))
|
if (args.Sprite.LayerMapTryGet(component.BaseLayer, out var baseLayer))
|
||||||
@@ -79,7 +79,7 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem<SolutionCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var closestFillSprite = (int) Math.Round(fraction * component.MaxFillLevels);
|
int closestFillSprite = ContentHelpers.RoundToLevels(fraction, 1, component.MaxFillLevels + 1);
|
||||||
|
|
||||||
if (closestFillSprite > 0)
|
if (closestFillSprite > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -254,6 +254,13 @@
|
|||||||
- type: Drink
|
- type: Drink
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Consumable/Drinks/water_cup.rsi
|
sprite: Objects/Consumable/Drinks/water_cup.rsi
|
||||||
|
layers:
|
||||||
|
- state: icon-0
|
||||||
|
- map: ["enum.SolutionContainerLayers.Fill"]
|
||||||
state: icon-1
|
state: icon-1
|
||||||
|
- type: Appearance
|
||||||
|
- type: SolutionContainerVisuals
|
||||||
|
maxFillLevels: 1
|
||||||
|
fillBaseName: icon-
|
||||||
- type: TrashOnEmpty
|
- type: TrashOnEmpty
|
||||||
solution: drink
|
solution: drink
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 284 B |
Binary file not shown.
|
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 165 B |
Reference in New Issue
Block a user