* THE RETURN OF ITEM STATUS Item status is now inline with the hands again. You can now see item status for both hands at once. If you have more than 2 hands, the last active hand of that side is displayed in the respective item status. The item status for the active hand is also highlighted. Item status has been given a new look so it looks unique and matches every UI theme. * Shrink item status to 125px This is going to require fixing the existing controls. Do that later. * New bullet item status rendering sex * Make gun item status look just a little bit nicer. Avoid only one or two bullets ending up on a single row of an item status. * Delete Eris theme files * More improvements Fixed the fact that left/right were flipped around when assigning status panel locations. Involved renaming all the UI textures. Redid how content margins are set from the theme. Less complex and cleaner now. Made the item name always left-aligned, just looks better since other UI elements don't adapt anyways. * Compact down item status text Now it fits 3 lines of text on one line. Yay. This is achieved by compacting RichTextLabels by reducing their line height and giving them a negative bottom margin. * Add item status sprites for Ashen theme. * Add status control to show beaker/bucket/jug solution/transfer volumes Also PollingItemStatusControl I'll be using that more. * Fix welder item status, clean up welder code The item status control implementation was ancient and bad. That's why it was buggy. Removed all the complex dated networking stuff for welders, we just sync the solution contents now anyways so none of that is needed anymore. This moves a buncha stuff to shared and just removes code. Cleanup. The code was doing some really dumb stuff. * Spray bottles show contents in item status. * cowtools * Fix plasmafire and clockwork themes. Actual git gaslighting wtf. --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
64 lines
2.2 KiB
C#
64 lines
2.2 KiB
C#
using Content.Server.Atmos.EntitySystems;
|
|
using Content.Shared.Chemistry.Components.SolutionManager;
|
|
using Content.Shared.FixedPoint;
|
|
using Content.Shared.Tools.Components;
|
|
using Robust.Server.GameObjects;
|
|
|
|
using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
|
|
|
|
namespace Content.Server.Tools;
|
|
|
|
public sealed class ToolSystem : SharedToolSystem
|
|
{
|
|
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
|
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
|
|
|
public override void TurnOn(Entity<WelderComponent> entity, EntityUid? user)
|
|
{
|
|
base.TurnOn(entity, user);
|
|
var xform = Transform(entity);
|
|
if (xform.GridUid is { } gridUid)
|
|
{
|
|
var position = _transformSystem.GetGridOrMapTilePosition(entity.Owner, xform);
|
|
_atmosphereSystem.HotspotExpose(gridUid, position, 700, 50, entity.Owner, true);
|
|
}
|
|
}
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
|
|
UpdateWelders(frameTime);
|
|
}
|
|
|
|
//todo move to shared once you can remove reagents from shared without it freaking out.
|
|
private void UpdateWelders(float frameTime)
|
|
{
|
|
var query = EntityQueryEnumerator<WelderComponent, SolutionContainerManagerComponent>();
|
|
while (query.MoveNext(out var uid, out var welder, out var solutionContainer))
|
|
{
|
|
if (!welder.Enabled)
|
|
continue;
|
|
|
|
welder.WelderTimer += frameTime;
|
|
|
|
if (welder.WelderTimer < welder.WelderUpdateTimer)
|
|
continue;
|
|
|
|
if (!SolutionContainerSystem.TryGetSolution((uid, solutionContainer), welder.FuelSolutionName, out var solutionComp, out var solution))
|
|
continue;
|
|
|
|
SolutionContainerSystem.RemoveReagent(solutionComp.Value, welder.FuelReagent, welder.FuelConsumption * welder.WelderTimer);
|
|
|
|
if (solution.GetTotalPrototypeQuantity(welder.FuelReagent) <= FixedPoint2.Zero)
|
|
{
|
|
ItemToggle.Toggle(uid, predicted: false);
|
|
}
|
|
|
|
Dirty(uid, welder);
|
|
welder.WelderTimer -= welder.WelderUpdateTimer;
|
|
}
|
|
}
|
|
}
|
|
|