Files
OldThink/Content.Client/Lathe/LatheSystem.cs

47 lines
2.1 KiB
C#
Raw Normal View History

using Robust.Client.GameObjects;
using Content.Shared.Lathe;
using Content.Shared.Power;
using Content.Client.Power;
using Content.Client.Wires.Visualizers;
using Content.Shared.Wires;
namespace Content.Client.Lathe
{
public sealed class LatheSystem : VisualizerSystem<LatheVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, LatheVisualsComponent component, ref AppearanceChangeEvent args)
{
if (TryComp(uid, out SpriteComponent? sprite))
{
if (args.Component.TryGetData(PowerDeviceVisuals.Powered, out bool powered))
sprite.LayerSetVisible(PowerDeviceVisualLayers.Powered, powered);
if (args.Component.TryGetData(WiresVisuals.MaintenancePanelState, out bool panel)
&& sprite.LayerMapTryGet(WiresVisualizer.WiresVisualLayers.MaintenancePanel, out var panelLayer))
sprite.LayerSetVisible(WiresVisualizer.WiresVisualLayers.MaintenancePanel, panel);
// Lathe specific stuff
if (args.Component.TryGetData(LatheVisuals.IsRunning, out bool isRunning))
{
var state = isRunning ? component.RunningState : component.IdleState;
sprite.LayerSetAnimationTime(LatheVisualLayers.IsRunning, 0f);
sprite.LayerSetState(LatheVisualLayers.IsRunning, state);
}
if (args.Component.TryGetData(LatheVisuals.IsInserting, out bool isInserting)
&& sprite.LayerMapTryGet(LatheVisualLayers.IsInserting, out var isInsertingLayer))
{
Salvage mining, ore processing, and material clean-up (#7406) * adding stuff cuz new computer * removed unused materials * remove unused materials and such, lathe things * material volume no longer hardcoded * fixed mining system * add 5 stacks of materials, and add them to the ore processor * fix copyright for ores and handdrill * comma momma * whyyyyy * more fixes to make the yaml linter happy * i should get my eyes checked * silver proper * more cleanup * leftovers * remove more references to material doors * couldn't bear to be without bearhide * added uranium, added more lathe recipes * copyright fix, stack fix * ore processor sprite and such * ore processing some binches * MaterialCotton removal * 1 uranium ore means 1 sheet * fix merge conflict? idk * time to ketchup * lathe recognizes material volume again * yaml cleanup * forgot to remove adamantine lol * re-added diamond for now * diamond stacks * functional ore processor * added ignoreColor to lathe visuals * ore processor machine board * add board to industrial tech and circuit printer * provided lathes their whitelists * fix wonky ore spawning, added insert sound to lathe, adjusted ore chance * re-added ore processor * typos and cleanup * Update Content.Client/Lathe/LatheSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Server/Lathe/LatheSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * revert mapchange * VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn * actually null canceltoken * remove five-stacks, ore processor produces full stacks or single sheets/ingots * VV proper * adjust ore chances * readd Cotton * Update Content.Server/Mining/MineableSystem.cs * tweaks * Material is now dict (material, volume) * removed unused property * Space crystal -> space quartz * forgor asteroid space quartz Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
if (args.Component.TryGetData(LatheVisuals.InsertingColor, out Color color)
&& !component.IgnoreColor)
sprite.LayerSetColor(isInsertingLayer, color);
Salvage mining, ore processing, and material clean-up (#7406) * adding stuff cuz new computer * removed unused materials * remove unused materials and such, lathe things * material volume no longer hardcoded * fixed mining system * add 5 stacks of materials, and add them to the ore processor * fix copyright for ores and handdrill * comma momma * whyyyyy * more fixes to make the yaml linter happy * i should get my eyes checked * silver proper * more cleanup * leftovers * remove more references to material doors * couldn't bear to be without bearhide * added uranium, added more lathe recipes * copyright fix, stack fix * ore processor sprite and such * ore processing some binches * MaterialCotton removal * 1 uranium ore means 1 sheet * fix merge conflict? idk * time to ketchup * lathe recognizes material volume again * yaml cleanup * forgot to remove adamantine lol * re-added diamond for now * diamond stacks * functional ore processor * added ignoreColor to lathe visuals * ore processor machine board * add board to industrial tech and circuit printer * provided lathes their whitelists * fix wonky ore spawning, added insert sound to lathe, adjusted ore chance * re-added ore processor * typos and cleanup * Update Content.Client/Lathe/LatheSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Server/Lathe/LatheSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * revert mapchange * VV ignorecolor, pass entitymanager, move canceltoken to pickaxe, removed foreach from orespawn * actually null canceltoken * remove five-stacks, ore processor produces full stacks or single sheets/ingots * VV proper * adjust ore chances * readd Cotton * Update Content.Server/Mining/MineableSystem.cs * tweaks * Material is now dict (material, volume) * removed unused property * Space crystal -> space quartz * forgor asteroid space quartz Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-04-28 03:41:04 -07:00
sprite.LayerSetAnimationTime(isInsertingLayer, 0f);
sprite.LayerSetVisible(isInsertingLayer, isInserting);
}
}
}
}
}
public enum LatheVisualLayers : byte
{
IsRunning,
IsInserting
}