Cleaner BoundUserInterfaces (#17736)
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user