external

System for drawing organs with overlays. These overlays are drawn directly on the bodypart, attached to a person or not Works in tandem with the /datum/sprite_accessory datum to generate sprites Unlike normal organs, we're actually inside a persons limbs at all times
Vars | |
all_layers | Convert the bitflag define into the actual layer define |
---|---|
apply_color_to_layer | FALSE will set the color on the organ, TRUE will call get_overlay_color() for every layer and put it directly on the overlay |
cache_key | Key of the icon states of all the sprite_datums for easy caching |
color_source | Where does this organ inherit it's color from? |
dna_block | With what DNA block do we mutate in mutate_feature() ? For genetics |
draw_color | The color this organ draws with. Updated by bodypart/inherit_color() |
external_bodytypes | Does this organ have any bodytypes to pass to it's ownerlimb? |
feature_key | Defines what kind of 'organ' we're looking at. Sprites have names like 'm_mothwings_firemoth'. 'mothwings' would then be feature_key |
layers | Sometimes we need multiple layers, for like the back, middle and front of the person |
ownerlimb | Reference to the limb we're inside of |
preference | The savefile_key of the preference this relates to. Used for the preferences UI. |
render_key | Similar to feature key, but overrides it in the case you need more fine control over the iconstate, like with Tails. |
restyle_flags | Which flags does a 'modification tool' need to have to restyle us, if it all possible (located in code/_DEFINES/mobs) |
sprite_datum | Sprite datum we use to draw on the bodypart |
stored_feature_id | Stores the dna.features[feature_key], used for external organs that can be surgically removed or inserted. |
use_mob_sprite_as_obj_sprite | Set to EXTERNAL_BEHIND, EXTERNAL_FRONT or EXTERNAL_ADJACENT if you want to draw one of those layers as the object sprite. FALSE to use your own |
Procs | |
Initialize | mob_sprite is optional if you havent set sprite_datums for the object, and is used mostly to generate sprite_datums from a persons DNA For _mob_sprite we make a distinction between "Round Snout" and "round". Round Snout is the name of the sprite datum, while "round" would be part of the sprite I'm sorry |
attempt_feature_restyle | Restyles the external organ from a list of valid options |
bitflag_to_layer | Converts a bitflag to the right layer. I'd love to make this a static index list, but byond made an attempt on my life when i did |
can_draw_on_bodypart | Check whether we can draw the overlays. You generally don't want lizard snouts to draw over an EVA suit |
generate_and_retrieve_overlays | Add the overlays we need to draw on a person. Called from _bodyparts.dm |
generate_icon_cache | Generate a unique key based on our sprites. So that if we've aleady drawn these sprites, they can be found in the cache and wont have to be drawn again (blessing and curse) |
get_global_feature_list | Return a dumb glob list for this specific feature (called from parse_sprite) |
get_overlay_color | Return a color for our specific layer |
get_sprite_datum | Because all the preferences have names like "Beautiful Sharp Snout" we need to get the sprite datum with the actual important info |
get_valid_restyles | Helper proc to fetch a list of styles a player might want to restyle their features into during the round : returns list("Cabbage" = /datum/sprite_accessory/cabbage) |
inherit_color | Give the organ it's color. Force will override the existing one. |
mutant_bodyparts_layertext | This exists so sprite accessories can still be per-layer without having to include that layer's number in their sprite name, which causes issues when those numbers change. |
mutate_feature | Update our features after something changed our appearance |
on_attempt_feature_restyle | Invoke async so we dont break signals |
override_color | Colorizes the limb it's inserted to, if required. |
set_sprite | Change our accessory sprite, using the accesssory name. If you need to change the sprite for something, use simple_change_sprite() |
simple_change_sprite | Also give the icon to the obj If you need to change an external_organ for simple one-offs, use this. Pass the accessory type : /datum/accessory/something |
transfer_to_limb | Transfers the organ to the limb, and to the limb's owner, if it has one. |
Var Details
all_layers

Convert the bitflag define into the actual layer define
apply_color_to_layer

FALSE will set the color on the organ, TRUE will call get_overlay_color() for every layer and put it directly on the overlay
cache_key

Key of the icon states of all the sprite_datums for easy caching
color_source

Where does this organ inherit it's color from?
dna_block

With what DNA block do we mutate in mutate_feature() ? For genetics
draw_color

The color this organ draws with. Updated by bodypart/inherit_color()
external_bodytypes

Does this organ have any bodytypes to pass to it's ownerlimb?
feature_key

Defines what kind of 'organ' we're looking at. Sprites have names like 'm_mothwings_firemoth'. 'mothwings' would then be feature_key
layers

Sometimes we need multiple layers, for like the back, middle and front of the person
ownerlimb

Reference to the limb we're inside of
preference

The savefile_key of the preference this relates to. Used for the preferences UI.
render_key

Similar to feature key, but overrides it in the case you need more fine control over the iconstate, like with Tails.
restyle_flags

Which flags does a 'modification tool' need to have to restyle us, if it all possible (located in code/_DEFINES/mobs)
sprite_datum

Sprite datum we use to draw on the bodypart
stored_feature_id

Stores the dna.features[feature_key], used for external organs that can be surgically removed or inserted.
use_mob_sprite_as_obj_sprite

Set to EXTERNAL_BEHIND, EXTERNAL_FRONT or EXTERNAL_ADJACENT if you want to draw one of those layers as the object sprite. FALSE to use your own
Proc Details
Initialize
mob_sprite is optional if you havent set sprite_datums for the object, and is used mostly to generate sprite_datums from a persons DNA For _mob_sprite we make a distinction between "Round Snout" and "round". Round Snout is the name of the sprite datum, while "round" would be part of the sprite I'm sorry
attempt_feature_restyle
Restyles the external organ from a list of valid options
bitflag_to_layer
Converts a bitflag to the right layer. I'd love to make this a static index list, but byond made an attempt on my life when i did
can_draw_on_bodypart
Check whether we can draw the overlays. You generally don't want lizard snouts to draw over an EVA suit
generate_and_retrieve_overlays
Add the overlays we need to draw on a person. Called from _bodyparts.dm
generate_icon_cache
Generate a unique key based on our sprites. So that if we've aleady drawn these sprites, they can be found in the cache and wont have to be drawn again (blessing and curse)
get_global_feature_list
Return a dumb glob list for this specific feature (called from parse_sprite)
get_overlay_color
Return a color for our specific layer
get_sprite_datum
Because all the preferences have names like "Beautiful Sharp Snout" we need to get the sprite datum with the actual important info
get_valid_restyles
Helper proc to fetch a list of styles a player might want to restyle their features into during the round : returns list("Cabbage" = /datum/sprite_accessory/cabbage)
inherit_color
Give the organ it's color. Force will override the existing one.
mutant_bodyparts_layertext
This exists so sprite accessories can still be per-layer without having to include that layer's number in their sprite name, which causes issues when those numbers change.
mutate_feature
Update our features after something changed our appearance
on_attempt_feature_restyle
Invoke async so we dont break signals
override_color
Colorizes the limb it's inserted to, if required.
set_sprite
Change our accessory sprite, using the accesssory name. If you need to change the sprite for something, use simple_change_sprite()
simple_change_sprite
Also give the icon to the obj If you need to change an external_organ for simple one-offs, use this. Pass the accessory type : /datum/accessory/something
transfer_to_limb
Transfers the organ to the limb, and to the limb's owner, if it has one.