label
The label component.
This component is used to manage labels applied by the hand labeler.
Atoms can only have one instance of this component, and therefore only one label at a time. This is to avoid having names like "Backpack (label1) (label2) (label3)". This is annoying and abnoxious to read.
When a player clicks the atom with a hand labeler to apply a label, this component gets applied to it. If the labeler is off, the component will be removed from it, and the label will be removed from its name.
Vars | |
label_name | The name of the label the player is applying to the parent. |
---|---|
Procs | |
InheritComponent | This proc will fire after the parent is hit by a hand labeler which is trying to apply another label. Since the parent already has a label, it will remove the old one from the parent's name, and apply the new one. |
apply_label | Applies a label to the name of the parent in the format of: "parent_name (label)" |
on_attack_by | This proc will trigger when any object is used to attack the parent. |
on_update_name | This proc will trigger when someone examines the parent.
It will attach the text found in the body of the proc to the examine_list and display it to the player examining the parent. |
remove_label | Removes the label from the parent's name |
Var Details
label_name
The name of the label the player is applying to the parent.
Proc Details
InheritComponent
This proc will fire after the parent is hit by a hand labeler which is trying to apply another label. Since the parent already has a label, it will remove the old one from the parent's name, and apply the new one.
apply_label
Applies a label to the name of the parent in the format of: "parent_name (label)"
on_attack_by
This proc will trigger when any object is used to attack the parent.
If the attacking object is not a hand labeler, it will return. If the attacking object is a hand labeler it will restore the name of the parent to what it was before this component was added to it, and the component will be deleted.
Arguments:
- source: The parent.
- attacker: The object that is hitting the parent.
- user: The mob who is wielding the attacking object.
on_update_name
This proc will trigger when someone examines the parent.
It will attach the text found in the body of the proc to the examine_list
and display it to the player examining the parent.
Arguments:
- source: The parent.
- user: The mob exmaining the parent.
- examine_list: The current list of text getting passed from the parent's normal examine() proc. Reapplies label when update_name is called on the parent object. Attempts to remove it first just in case.
remove_label
Removes the label from the parent's name