Add Sprite changes to Logic Gates to show the input/output state (#33277)
This commit is contained in:
@@ -102,10 +102,12 @@ public sealed class LogicGateSystem : EntitySystem
|
||||
if (args.Port == comp.InputPortA)
|
||||
{
|
||||
comp.StateA = state;
|
||||
_appearance.SetData(uid, LogicGateVisuals.InputA, state == SignalState.High); //If A == High => Sets input A sprite to True
|
||||
}
|
||||
else if (args.Port == comp.InputPortB)
|
||||
{
|
||||
comp.StateB = state;
|
||||
_appearance.SetData(uid, LogicGateVisuals.InputB, state == SignalState.High); //If B == High => Sets input B sprite to True
|
||||
}
|
||||
|
||||
UpdateOutput(uid, comp);
|
||||
@@ -143,6 +145,8 @@ public sealed class LogicGateSystem : EntitySystem
|
||||
break;
|
||||
}
|
||||
|
||||
_appearance.SetData(uid, LogicGateVisuals.Output, output);
|
||||
|
||||
// only send a payload if it actually changed
|
||||
if (output != comp.LastOutput)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user