Fix handlabeler/utility belt misprediction (#26660)
* Fix handlabeler/utility belt misprediction * Partly moved HandLabelerSystem to shared And cleaned up HandLabelerComponent * WIP format the files so later commits look clearer Doesn't change individual code lines, but may move functions to another file * WIP some more code movement * Hand Labeler is now mostly predicted Only the UI isn't * WIP: Formatting and moved stuff * Using componentstates for prediction correction * review * Update label on label change * Don't overwrite label while editing --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com> Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
This commit is contained in:
30
Content.Shared/Labels/Components/HandLabelerComponent.cs
Normal file
30
Content.Shared/Labels/Components/HandLabelerComponent.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Content.Shared.Labels.EntitySystems;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Labels.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[Access(typeof(SharedHandLabelerSystem))]
|
||||
public sealed partial class HandLabelerComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), Access(Other = AccessPermissions.ReadWriteExecute)]
|
||||
[DataField]
|
||||
public string AssignedLabel = string.Empty;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public int MaxLabelChars = 50;
|
||||
|
||||
[DataField]
|
||||
public EntityWhitelist Whitelist = new();
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class HandLabelerComponentState(string assignedLabel) : IComponentState
|
||||
{
|
||||
public string AssignedLabel = assignedLabel;
|
||||
|
||||
public int MaxLabelChars;
|
||||
}
|
||||
Reference in New Issue
Block a user