Cleaner BoundUserInterfaces (#17736)

This commit is contained in:
TemporalOroboros
2023-07-08 09:02:17 -07:00
committed by GitHub
parent 55b4fb1649
commit 3ac4cf85db
137 changed files with 1069 additions and 972 deletions

View File

@@ -18,7 +18,9 @@ public abstract class SharedRadarConsoleSystem : EntitySystem
private void OnHandleState(EntityUid uid, RadarConsoleComponent component, ref ComponentHandleState args)
{
if (args.Current is not RadarConsoleComponentState state) return;
if (args.Current is not RadarConsoleComponentState state)
return;
component.MaxRange = state.Range;
}
@@ -30,14 +32,18 @@ public abstract class SharedRadarConsoleSystem : EntitySystem
};
}
protected virtual void UpdateState(RadarConsoleComponent component) {}
public void SetRange(RadarConsoleComponent component, float value)
protected virtual void UpdateState(EntityUid uid, RadarConsoleComponent component)
{
if (component.MaxRange.Equals(value)) return;
}
public void SetRange(EntityUid uid, float value, RadarConsoleComponent component)
{
if (component.MaxRange.Equals(value))
return;
component.MaxRange = value;
Dirty(component);
UpdateState(component);
Dirty(uid, component);
UpdateState(uid, component);
}
[Serializable, NetSerializable]