Files
VOREStation/code/ATMOSPHERICS/_atmos_setup.dm
Cameron Lennox 84dc5535dc var/global/list -> GLOB. conversion (#17928)
* These two are easy

* !!!runlevel_flags

the fact it was global.runlevel_flags.len has me a bit...iffy on this.

* !!!json_cache

Same as above. used global.

* player_list & observer_mob_list

* mechas_list

* this wasn't even used

* surgery_steps

* event_triggers

* landmarks_list

* dead_mob_list

* living_mob_list

* ai_list

* cable_list

* cleanbot_reserved_turfs

* listening_objects

* silicon_mob_list

* human_mob_list

* Update global_lists.dm

* joblist

* mob_list

* Update global_lists.dm

* holomap_markers

* mapping_units

* mapping_beacons

* hair_styles_list

* facial_hair_styles_list

* Update global_lists.dm

* facial_hair_styles_male_list

* facial_hair_styles_female_list

* body_marking_styles_list

* body_marking_nopersist_list

* ear_styles_list

* hair_styles_male_list

* tail_styles_list

* wing_styles_list

* escape_list & rune_list & endgame_exits

these were all really small

* endgame_safespawns

* stool_cache

* emotes_by_key

* random_maps & map_count

* item_tf_spawnpoints

* narsie_list

* active_radio_jammers

* unused

* paikeys

* pai_software_by_key & default_pai_software

* plant_seed_sprites

* magazine_icondata_keys  & magazine_icondata_states

* unused

* ashtray_cache

* light_type_cache

* HOLIDAY!!!

this one was annoying

* faction stuff (red?!)

* Update preferences_factions.dm

* vs edit removal

* backbaglist, pdachoicelist, exclude_jobs

* item_digestion_blacklist, edible_tech, blacklisted_artifact_effect, selectable_footstep, hexNums, syndicate_access

* string_slot_flags and hexdigits->hexNums

* possible_changeling_IDs

* vr_mob_tf_options

* vr_mob_spawner_options

* pipe_colors

* vr_mob_spawner_options

* common_tools

* newscaster_standard_feeds

* Update periodic_news.dm

* changeling_fabricated_clothing

* semirandom_mob_spawner_decisions

* id_card_states

* Update syndicate_ids.dm

* overlay_cache & gear_distributed_to

* more

* radio_channels_by_freq

* Update global_lists.dm

* proper

* default_medbay_channels & default_internal_channels

default_internal_channels is weird as it has a mapbased proc() but that proc is never called...

* valid_ringtones

* move this

* possible_plants

* more

* separate these

moves xeno2chemlist from a hook to a new global list.

* tube_dir_list

* valid_bloodreagents & monitor_states

* Junk

* valid_bloodtypes

* breach_burn_descriptors & burn

* more!!

appliance_available_recipes seems uber cursed, re-look at later

* Appliance code is cursed

* wide_chassis & flying_chassis

* allows_eye_color

* all_tooltip_styles

* direction_table

* gun_choices

* severity_to_string

* old event_viruses

* description_icons

* MOVE_KEY_MAPPINGS

* more more

* pai & robot modules

* Update global_lists.dm

* GEOSAMPLES

Also swaps a .len to LAZYLEN()

* shieldgens

* reagent recipies

* global ammo types

* rad collector

* old file and unused global

* nif_look_messages

* FESH

* nifsoft

* chamelion

* the death of sortAtom

* globulins

* lazylen that

* Update global_lists.dm

* LAZY

* Theese too

* quick fix

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-07-14 20:14:31 +02:00

282 lines
8.8 KiB
Plaintext

//--------------------------------------------
// Pipe colors
//
// Add them here and to the GLOB.pipe_colors list
// to automatically add them to all relevant
// atmospherics devices.
//--------------------------------------------
GLOBAL_LIST_INIT(pipe_colors, list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "black" = PIPE_COLOR_BLACK, "orange" = PIPE_COLOR_ORANGE, "white" = PIPE_COLOR_WHITE, "purple" = PIPE_COLOR_PURPLE))
/proc/pipe_color_lookup(var/color)
for(var/C in GLOB.pipe_colors)
if(color == GLOB.pipe_colors[C])
return "[C]"
/proc/pipe_color_check(var/color)
if(!color)
return 1
for(var/C in GLOB.pipe_colors)
if(color == GLOB.pipe_colors[C])
return 1
return 0
//--------------------------------------------
// Icon cache generation
//--------------------------------------------
/datum/pipe_icon_manager
var/list/pipe_icons[]
var/list/manifold_icons[]
var/list/device_icons[]
var/list/underlays[]
//var/list/underlays_down[]
//var/list/underlays_exposed[]
//var/list/underlays_intact[]
//var/list/pipe_underlays_exposed[]
//var/list/pipe_underlays_intact[]
var/list/omni_icons[]
/datum/pipe_icon_manager/New()
check_icons()
/datum/pipe_icon_manager/proc/get_atmos_icon(var/device, var/dir, var/color, var/state)
check_icons()
device = "[device]"
state = "[state]"
color = "[color]"
dir = "[dir]"
switch(device)
if("pipe")
return pipe_icons[state + color]
if("manifold")
return manifold_icons[state + color]
if("device")
return device_icons[state]
if("omni")
return omni_icons[state]
if("underlay")
return underlays[state + dir + color]
// if("underlay_intact")
// return underlays_intact[state + dir + color]
// if("underlay_exposed")
// return underlays_exposed[state + dir + color]
// if("underlay_down")
// return underlays_down[state + dir + color]
// if("pipe_underlay_exposed")
// return pipe_underlays_exposed[state + dir + color]
// if("pipe_underlay_intact")
// return pipe_underlays_intact[state + dir + color]
/datum/pipe_icon_manager/proc/check_icons()
if(!pipe_icons)
gen_pipe_icons()
if(!manifold_icons)
gen_manifold_icons()
if(!device_icons)
gen_device_icons()
if(!omni_icons)
gen_omni_icons()
//if(!underlays_intact || !underlays_down || !underlays_exposed || !pipe_underlays_exposed || !pipe_underlays_intact)
if(!underlays)
gen_underlay_icons()
/datum/pipe_icon_manager/proc/gen_pipe_icons()
if(!pipe_icons)
pipe_icons = new()
var/icon/pipe = new('icons/atmos/pipes.dmi')
for(var/state in pipe.IconStates())
if(!state || findtext(state, "map"))
continue
var/cache_name = state
var/image/I = image('icons/atmos/pipes.dmi', icon_state = state)
pipe_icons[cache_name] = I
for(var/pipe_color in GLOB.pipe_colors)
I = image('icons/atmos/pipes.dmi', icon_state = state)
I.color = GLOB.pipe_colors[pipe_color]
pipe_icons[state + "[GLOB.pipe_colors[pipe_color]]"] = I
pipe = new ('icons/atmos/heat.dmi')
for(var/state in pipe.IconStates())
if(!state || findtext(state, "map"))
continue
pipe_icons["hepipe" + state] = image('icons/atmos/heat.dmi', icon_state = state)
pipe = new ('icons/atmos/junction.dmi')
for(var/state in pipe.IconStates())
if(!state || findtext(state, "map"))
continue
pipe_icons["hejunction" + state] = image('icons/atmos/junction.dmi', icon_state = state)
/datum/pipe_icon_manager/proc/gen_manifold_icons()
if(!manifold_icons)
manifold_icons = new()
var/icon/pipe = new('icons/atmos/manifold.dmi')
for(var/state in pipe.IconStates())
if(findtext(state, "clamps"))
var/image/I = image('icons/atmos/manifold.dmi', icon_state = state)
manifold_icons[state] = I
continue
if(findtext(state, "core") || findtext(state, "4way"))
var/image/I = image('icons/atmos/manifold.dmi', icon_state = state)
manifold_icons[state] = I
for(var/pipe_color in GLOB.pipe_colors)
I = image('icons/atmos/manifold.dmi', icon_state = state)
I.color = GLOB.pipe_colors[pipe_color]
manifold_icons[state + GLOB.pipe_colors[pipe_color]] = I
/datum/pipe_icon_manager/proc/gen_device_icons()
if(!device_icons)
device_icons = new()
var/icon/device
device = new('icons/atmos/vent_pump.dmi')
for(var/state in device.IconStates())
if(!state || findtext(state, "map"))
continue
device_icons["vent" + state] = image('icons/atmos/vent_pump.dmi', icon_state = state)
device = new('icons/atmos/vent_scrubber.dmi')
for(var/state in device.IconStates())
if(!state || findtext(state, "map"))
continue
device_icons["scrubber" + state] = image('icons/atmos/vent_scrubber.dmi', icon_state = state)
/datum/pipe_icon_manager/proc/gen_omni_icons()
if(!omni_icons)
omni_icons = new()
var/icon/omni = new('icons/atmos/omni_devices_vr.dmi') //VOREStation Edit - New Icons
for(var/state in omni.IconStates())
if(!state || findtext(state, "map"))
continue
omni_icons[state] = image('icons/atmos/omni_devices_vr.dmi', icon_state = state) //VOREStation Edit - New Icons
/datum/pipe_icon_manager/proc/gen_underlay_icons()
if(!underlays)
underlays = new()
var/icon/pipe = new('icons/atmos/pipe_underlays.dmi')
for(var/state in pipe.IconStates())
if(state == "")
continue
var/cache_name = state
for(var/D in GLOB.cardinal)
var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
underlays[cache_name + "[D]"] = I
for(var/pipe_color in GLOB.pipe_colors)
I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
I.color = GLOB.pipe_colors[pipe_color]
underlays[state + "[D]" + "[GLOB.pipe_colors[pipe_color]]"] = I
/*
Leaving the old icon manager code commented out for now, as we may want to rewrite the new code to cleanly
separate the newpipe icon caching (speshul supply and scrubber lines) from the rest of the pipe code.
*/
/*
/datum/pipe_icon_manager/proc/gen_underlay_icons()
if(!underlays_intact)
underlays_intact = new()
if(!underlays_exposed)
underlays_exposed = new()
if(!underlays_down)
underlays_down = new()
if(!pipe_underlays_exposed)
pipe_underlays_exposed = new()
if(!pipe_underlays_intact)
pipe_underlays_intact = new()
var/icon/pipe = new('icons/atmos/pipe_underlays.dmi')
for(var/state in pipe.IconStates())
if(state == "")
continue
for(var/D in GLOB.cardinal)
var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
switch(state)
if("intact")
underlays_intact["[D]"] = I
if("exposed")
underlays_exposed["[D]"] = I
if("down")
underlays_down["[D]"] = I
if("pipe_exposed")
pipe_underlays_exposed["[D]"] = I
if("pipe_intact")
pipe_underlays_intact["[D]"] = I
if("intact-supply")
underlays_intact["[D]"] = I
if("exposed-supply")
underlays_exposed["[D]"] = I
if("down-supply")
underlays_down["[D]"] = I
if("pipe_exposed-supply")
pipe_underlays_exposed["[D]"] = I
if("pipe_intact-supply")
pipe_underlays_intact["[D]"] = I
if("intact-scrubbers")
underlays_intact["[D]"] = I
if("exposed-scrubbers")
underlays_exposed["[D]"] = I
if("down-scrubbers")
underlays_down["[D]"] = I
if("pipe_exposed-scrubbers")
pipe_underlays_exposed["[D]"] = I
if("pipe_intact-scrubbers")
pipe_underlays_intact["[D]"] = I
for(var/pipe_color in GLOB.pipe_colors)
I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
I.color = GLOB.pipe_colors[pipe_color]
switch(state)
if("intact")
underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("exposed")
underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("down")
underlays_down["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_exposed")
pipe_underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_intact")
pipe_underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("intact-supply")
underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("exposed-supply")
underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("down-supply")
underlays_down["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_exposed-supply")
pipe_underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_intact-supply")
pipe_underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("intact-scrubbers")
underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("exposed-scrubbers")
underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("down-scrubbers")
underlays_down["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_exposed-scrubbers")
pipe_underlays_exposed["[D]" + GLOB.pipe_colors[pipe_color]] = I
if("pipe_intact-scrubbers")
pipe_underlays_intact["[D]" + GLOB.pipe_colors[pipe_color]] = I
*/