paper
Paper also scraps of paper
lipstick wiping is in code/game/objects/items/weapons/cosmetics.dm!
Paper is now using markdown (like in github pull notes) for ALL rendering so we do loose a bit of functionality but we gain in easy of use of paper and getting rid of that crashing bug
Vars | |
camera_holder | Paper can be shown via cameras. When that is done, a deep copy of the paper is made and stored as a var on the camera. The paper is located in nullspace, and holds a weak ref to the camera that once contained it so the paper can do some state checking on if it should be shown to a viewer. |
---|---|
can_become_message_in_bottle | If this paper can be selected as a candidate for a future message in a bottle when spawned outside of mapload. Doesn't affect manually doing that. |
contact_poison | Reagent to transfer to the user when they pick the paper up without proper protection. |
contact_poison_volume | Volume of contact_poison to transfer to the user when they pick the paper up without proper protection. |
default_raw_text | Default raw text to fill this paper with on init. |
input_field_count | The number of input fields |
raw_field_input_data | Lazylist of all fields that have had some input added to them. |
raw_stamp_data | Lazylist of all raw stamp data to be sent to tgui. |
raw_text_inputs | Lazylist of raw, unsanitised, unparsed text inputs that have been made to the paper. |
request_state | If TRUE, staff can read paper everywhere, but usually from requests panel. |
show_written_words | Whether the icon should show little scribbly written words when the paper has some text on it. |
stamp_cache | Helper cache that contains a list of all icon_states that are currently stamped on the paper. |
Procs | |
add_field_input | This simple helper adds the supplied input field data to the paper. |
add_raw_text | This simple helper adds the supplied raw text to the paper, appending to the end of any existing contents. |
add_stamp | This simple helper adds the supplied stamp to the paper, appending to the end of any existing stamps. |
clear_paper | Removes all input and all stamps from the paper, clearing it completely. |
copy | This proc copies this sheet of paper to a new sheet. Used by carbon papers and the photocopier machine. |
copy_field_text | Returns a deep copy list of raw_field_input_data, or null if the list is empty or doesn't exist. |
copy_raw_stamps | Returns a deep copy list of raw_stamp_data, or null if the list is empty or doesn't exist. Does not copy overlays or stamp_cache, only the tgui rendered stamps. |
copy_raw_text | Returns a deep copy list of raw_text_inputs, or null if the list is empty or doesn't exist. |
get_raw_text | Get a single string representing the text on a page |
is_empty | Determines whether this paper has been written or stamped to. |
item_interaction_secondary | Secondary right click interaction to quickly stamp things |
make_plane | Paper plane folding Makes a paperplane depending on args and returns it. |
show_through_camera | Attempts to ui_interact the paper to the given user, with some sanity checking to make sure the camera still exists via the weakref and that this paper is still attached to it. |
Var Details
camera_holder
Paper can be shown via cameras. When that is done, a deep copy of the paper is made and stored as a var on the camera. The paper is located in nullspace, and holds a weak ref to the camera that once contained it so the paper can do some state checking on if it should be shown to a viewer.
can_become_message_in_bottle
If this paper can be selected as a candidate for a future message in a bottle when spawned outside of mapload. Doesn't affect manually doing that.
contact_poison
Reagent to transfer to the user when they pick the paper up without proper protection.
contact_poison_volume
Volume of contact_poison to transfer to the user when they pick the paper up without proper protection.
default_raw_text
Default raw text to fill this paper with on init.
input_field_count
The number of input fields
raw_field_input_data
Lazylist of all fields that have had some input added to them.
raw_stamp_data
Lazylist of all raw stamp data to be sent to tgui.
raw_text_inputs
Lazylist of raw, unsanitised, unparsed text inputs that have been made to the paper.
request_state
If TRUE, staff can read paper everywhere, but usually from requests panel.
show_written_words
Whether the icon should show little scribbly written words when the paper has some text on it.
stamp_cache
Helper cache that contains a list of all icon_states that are currently stamped on the paper.
Proc Details
add_field_input
This simple helper adds the supplied input field data to the paper.
It will not overwrite any existing input field data by default and will early return FALSE if this scenario happens unless overwrite is set properly.
Other than that, this is a God proc that does not care about max length or out-of-range IDs and expects sanity checking beforehand if you want to respect it.
- Arguments:
- field_id - The ID number of the field to which this data applies.
- text - The text to append to the paper.
- font - The font to use.
- color - The font color to use.
- bold - Whether this text should be rendered completely bold.
- overwrite - If TRUE, will overwrite existing field ID's data if it exists.
add_raw_text
This simple helper adds the supplied raw text to the paper, appending to the end of any existing contents.
This a God proc that does not care about paper max length and expects sanity checking beforehand if you want to respect it.
The caller is expected to handle updating icons and appearance after adding text, to allow for more efficient batch adding loops.
- Arguments:
- text - The text to append to the paper.
- font - The font to use.
- color - The font color to use.
- bold - Whether this text should be rendered completely bold.
- advanced_html - Boolean that is true when the writer has R_FUN permission, which sanitizes less HTML (such as images) from the new paper_input
add_stamp
This simple helper adds the supplied stamp to the paper, appending to the end of any existing stamps.
This a God proc that does not care about stamp max count and expects sanity checking beforehand if you want to respect it.
It does however respect the overlay limit and will not apply any overlays past the cap.
The caller is expected to handle updating icons and appearance after adding text, to allow for more efficient batch adding loops.
- Arguments:
- stamp_class - Div class for the stamp.
- stamp_x - X coordinate to render the stamp in tgui.
- stamp_y - Y coordinate to render the stamp in tgui.
- rotation - Degrees of rotation for the stamp to be rendered with in tgui.
- stamp_icon_state - Icon state for the stamp as part of overlay rendering.
clear_paper
Removes all input and all stamps from the paper, clearing it completely.
copy
This proc copies this sheet of paper to a new sheet. Used by carbon papers and the photocopier machine.
Arguments
- paper_type - Type path of the new paper to create. Can copy anything to anything.
- location - Where to spawn in the new copied paper.
- colored - If true, the copied paper will be coloured and will inherit all colours.
- greyscale_override - If set to a colour string and coloured is false, it will override the default of COLOR_WEBSAFE_DARK_GRAY when copying.
copy_field_text
Returns a deep copy list of raw_field_input_data, or null if the list is empty or doesn't exist.
copy_raw_stamps
Returns a deep copy list of raw_stamp_data, or null if the list is empty or doesn't exist. Does not copy overlays or stamp_cache, only the tgui rendered stamps.
copy_raw_text
Returns a deep copy list of raw_text_inputs, or null if the list is empty or doesn't exist.
get_raw_text
Get a single string representing the text on a page
is_empty
Determines whether this paper has been written or stamped to.
item_interaction_secondary
Secondary right click interaction to quickly stamp things
make_plane
Paper plane folding Makes a paperplane depending on args and returns it.
Arguments:
- mob/living/user - who's folding
- plane_type - what it will be folded into (path)
show_through_camera
Attempts to ui_interact the paper to the given user, with some sanity checking to make sure the camera still exists via the weakref and that this paper is still attached to it.