diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index fe8aaf8369..ef4b80e154 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -19,7 +19,7 @@ power_rating = 30000 //7500 W ~ 10 HP //VOREStation Edit - 30000 W connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_SUPPLY //connects to regular and supply pipes - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE var/area/initial_loc level = 1 diff --git a/code/__defines/lighting.dm b/code/__defines/lighting.dm index d775800ab3..85d7c8ccbd 100644 --- a/code/__defines/lighting.dm +++ b/code/__defines/lighting.dm @@ -75,9 +75,11 @@ // Emissive blocking. /// Uses vis_overlays to leverage caching so that very few new items need to be made for the overlay. For anything that doesn't change outline or opaque area much or at all. -#define EMISSIVE_BLOCK_GENERIC 1 +#define EMISSIVE_BLOCK_GENERIC 0 /// Uses a dedicated render_target object to copy the entire appearance in real time to the blocking layer. For things that can change in appearance a lot from the base state, like humans. -#define EMISSIVE_BLOCK_UNIQUE 2 +#define EMISSIVE_BLOCK_UNIQUE 1 +/// Don't block any emissives. Useful for things like, pieces of paper? +#define EMISSIVE_BLOCK_NONE 2 /// The color matrix applied to all emissive overlays. Should be solely dependent on alpha and not have RGB overlap with [EM_BLOCK_COLOR]. #define EMISSIVE_COLOR list(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1, 1,1,1,0) diff --git a/code/_helpers/_lists.dm b/code/_helpers/_lists.dm index d83253a83f..194a8e9966 100644 --- a/code/_helpers/_lists.dm +++ b/code/_helpers/_lists.dm @@ -69,7 +69,7 @@ #define DET_AUTO 0x04 //Returns a newline-separated list that counts equal-ish items, outputting count and item names, optionally with icons and specific determiners -/proc/counting_english_list(var/list/input, var/mob/user, output_icons = TRUE, determiners = DET_NONE, nothing_text = "nothing", line_prefix = "\t", first_item_prefix = "\n", last_item_suffix = "\n", and_text = "\n", comma_text = "\n", final_comma_text = ",") //CHOMPEdit +/proc/counting_english_list(client/viewer, var/list/input, output_icons = TRUE, determiners = DET_NONE, nothing_text = "nothing", line_prefix = "\t", first_item_prefix = "\n", last_item_suffix = "\n", and_text = "\n", comma_text = "\n", final_comma_text = ",") var/list/counts = list() // counted input items var/list/items = list() // actual objects for later reference (for icons and formatting) @@ -96,7 +96,7 @@ // atoms/items/objects can be pretty and whatnot var/atom/A = item if(output_icons && isicon(A.icon) && !ismob(A)) // mobs tend to have unusable icons - item_str += "[icon2html(A,user)] " //CHOMPEdit + item_str += "[icon2html(A, viewer)] " switch(determiners) if(DET_NONE) item_str += A.name if(DET_DEFINITE) item_str += "\the [A]" @@ -118,8 +118,8 @@ return english_list(out, nothing_text, and_text, comma_text, final_comma_text) //A "preset" for counting_english_list that displays the list "inline" (comma separated) -/proc/inline_counting_english_list(var/list/input, output_icons = TRUE, determiners = DET_NONE, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "", line_prefix = "", first_item_prefix = "", last_item_suffix = "") - return counting_english_list(input, output_icons, determiners, nothing_text, and_text, comma_text, final_comma_text) +/proc/inline_counting_english_list(client/viewer, var/list/input, output_icons = TRUE, determiners = DET_NONE, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "", line_prefix = "", first_item_prefix = "", last_item_suffix = "") + return counting_english_list(viewer, input, output_icons, determiners, nothing_text, and_text, comma_text, final_comma_text) //Returns list element or null. Should prevent "index out of bounds" error. /proc/listgetindex(var/list/list,index) diff --git a/code/controllers/admin.dm b/code/controllers/admin.dm index 6c5235dd48..834b5d2caa 100644 --- a/code/controllers/admin.dm +++ b/code/controllers/admin.dm @@ -1,7 +1,7 @@ // Clickable stat() button. /obj/effect/statclick name = "Initializing..." - blocks_emissive = FALSE // EMISSIVE_BLOCK_NONE + blocks_emissive = EMISSIVE_BLOCK_NONE var/target INITIALIZE_IMMEDIATE(/obj/effect/statclick) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 89a415ea5f..e89ac029c2 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -37,20 +37,27 @@ /atom/movable/Initialize(mapload) . = ..() - switch(blocks_emissive) - if(EMISSIVE_BLOCK_GENERIC) - var/mutable_appearance/gen_emissive_blocker = mutable_appearance(icon, icon_state, plane = PLANE_EMISSIVE, alpha = src.alpha) - gen_emissive_blocker.color = GLOB.em_block_color - gen_emissive_blocker.dir = dir - gen_emissive_blocker.appearance_flags |= appearance_flags - // Note, this should be refactored to drop priority overlays - add_overlay(list(gen_emissive_blocker), TRUE) - if(EMISSIVE_BLOCK_UNIQUE) + +#if EMISSIVE_BLOCK_GENERIC != 0 + #error EMISSIVE_BLOCK_GENERIC is expected to be 0 to facilitate a weird optimization hack where we rely on it being the most common. + #error Read the comment in code/game/atoms_movable.dm for details. +#endif + + if (blocks_emissive) + if (blocks_emissive == EMISSIVE_BLOCK_UNIQUE) render_target = ref(src) - em_block = new(src, render_target) + em_block = new(null, src) // Note, this should be refactored to drop priority overlays add_overlay(list(em_block), TRUE) RegisterSignal(em_block, COMSIG_QDELETING, PROC_REF(emblocker_gc)) + else + var/mutable_appearance/gen_emissive_blocker = mutable_appearance(icon, icon_state, plane = PLANE_EMISSIVE, alpha = src.alpha) + gen_emissive_blocker.color = GLOB.em_block_color + gen_emissive_blocker.dir = dir + gen_emissive_blocker.appearance_flags |= appearance_flags + // Note, this should be refactored to drop priority overlays + add_overlay(list(gen_emissive_blocker), TRUE) + if(opacity) AddElement(/datum/element/light_blocking) if(icon_scale_x != DEFAULT_ICON_SCALE_X || icon_scale_y != DEFAULT_ICON_SCALE_Y || icon_rotation != DEFAULT_ICON_ROTATION) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index d1ce461fed..d0321ab0ed 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -8,7 +8,7 @@ use_power = USE_POWER_IDLE idle_power_usage = 300 active_power_usage = 300 - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE var/processing = 0 var/icon_keyboard = "generic_key" diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index 88b4cdccca..6582e4a94f 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -7,7 +7,7 @@ FIRE ALARM icon = 'icons/obj/monitors.dmi' icon_state = "fire" layer = ABOVE_WINDOW_LAYER - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature var/detecting = 1.0 var/working = 1.0 diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index d8809a3485..68ab64ffac 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -11,7 +11,7 @@ use_power = USE_POWER_IDLE idle_power_usage = 10 power_channel = LIGHT - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature var/on = 1 var/area/area = null diff --git a/code/game/objects/effects/misc.dm b/code/game/objects/effects/misc.dm index 6c45740e24..cc81dccdad 100644 --- a/code/game/objects/effects/misc.dm +++ b/code/game/objects/effects/misc.dm @@ -73,7 +73,7 @@ light_color = COLOR_WHITE mouse_opacity = MOUSE_OPACITY_TRANSPARENT light_on = TRUE - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE /obj/effect/dummy/lighting_obj/Initialize(mapload, _range, _power, _color, _duration) . = ..() diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index 56ba5a2656..ae8a7b41d7 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -144,7 +144,7 @@ mouse_opacity = MOUSE_OPACITY_TRANSPARENT alpha = 0 vis_flags = NONE - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE /obj/effect/overlay/light_visible/Destroy(force) if(!force) @@ -161,7 +161,7 @@ mouse_opacity = MOUSE_OPACITY_TRANSPARENT vis_flags = NONE alpha = 110 - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE var/static/matrix/normal_transform diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a22d4240e8..2e6d9a760b 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -139,7 +139,7 @@ var/digest_stage = null var/d_mult_old = 1 //digest stage descriptions var/d_mult = 1 //digest stage descriptions - var/d_stage_overlay //digest stage effects + var/image/d_stage_overlay //digest stage effects var/gurgled = FALSE var/oldname var/cleanname @@ -169,6 +169,7 @@ M.update_held_icons() /obj/item/Destroy() + d_stage_overlay = null if(item_tf_spawn_allowed) GLOB.item_tf_spawnpoints -= src if(ismob(loc)) diff --git a/code/game/objects/items/devices/communicator/phone.dm b/code/game/objects/items/devices/communicator/phone.dm index 68260d6cc8..b3585e4af4 100644 --- a/code/game/objects/items/devices/communicator/phone.dm +++ b/code/game/objects/items/devices/communicator/phone.dm @@ -357,12 +357,10 @@ // Proc: end_video() // Parameters: reason - the text reason to print for why it ended // Description: Ends the video call by clearing video_source -/obj/item/communicator/proc/end_video(var/reason) +/obj/item/communicator/proc/end_video() UnregisterSignal(video_source, COMSIG_MOVABLE_ATTEMPTED_MOVE) show_static() video_source = null - . = span_danger("[bicon(src)] [reason ? reason : "Video session ended"].") - visible_message(.) update_icon() diff --git a/code/game/objects/structures/crates_lockers/__closets.dm b/code/game/objects/structures/crates_lockers/__closets.dm index fc56b5ed28..f91b948819 100644 --- a/code/game/objects/structures/crates_lockers/__closets.dm +++ b/code/game/objects/structures/crates_lockers/__closets.dm @@ -97,7 +97,7 @@ . += "It is full." if(!opened && isobserver(user)) - . += "It contains: [counting_english_list(contents, user)]" //CHOMPEdit + . += "It contains: [counting_english_list(user.client, contents)]" /obj/structure/closet/CanPass(atom/movable/mover, turf/target) if(wall_mounted) diff --git a/code/game/objects/structures/flora/trees.dm b/code/game/objects/structures/flora/trees.dm index 2f2d369084..7b13ae9628 100644 --- a/code/game/objects/structures/flora/trees.dm +++ b/code/game/objects/structures/flora/trees.dm @@ -311,7 +311,7 @@ icon = 'icons/obj/flora/deadtrees.dmi' icon_state = "tree_sif" base_state = "tree_sif" - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE product = /obj/item/stack/material/log/sif catalogue_data = list(/datum/category_item/catalogue/flora/sif_tree) randomize_size = TRUE diff --git a/code/modules/admin/view_variables/view_variables.dm b/code/modules/admin/view_variables/view_variables.dm index 4bf0a2ec4f..222e674901 100644 --- a/code/modules/admin/view_variables/view_variables.dm +++ b/code/modules/admin/view_variables/view_variables.dm @@ -6,8 +6,6 @@ ADMIN_VERB_AND_CONTEXT_MENU(debug_variables, (R_DEBUG|R_SERVER|R_ADMIN|R_SPAWN|R // This is kept as a separate proc because admins are able to show VV to non-admins /client/proc/debug_variables(datum/thing in world) - set category = "Debug.Investigate" - set name = "View Variables" //set src in world var/static/cookieoffset = rand(1, 9999) //to force cookies to reset after the round. diff --git a/code/modules/anomalies/anomaly.dm b/code/modules/anomalies/anomaly.dm index 5d888ae634..ffd7271a4c 100644 --- a/code/modules/anomalies/anomaly.dm +++ b/code/modules/anomalies/anomaly.dm @@ -98,7 +98,7 @@ /obj/item/anomaly_scanner/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state) var/list/data = list() - var/obj/effect/anomaly/anom = buffered_anomaly.resolve() + var/obj/effect/anomaly/anom = buffered_anomaly?.resolve() if(!istype(anom)) return data diff --git a/code/modules/client/preferences_tgui.dm b/code/modules/client/preferences_tgui.dm index 3e1c5069ba..c7580d909b 100644 --- a/code/modules/client/preferences_tgui.dm +++ b/code/modules/client/preferences_tgui.dm @@ -24,9 +24,11 @@ get_asset_datum(/datum/asset/simple/preferences), get_asset_datum(/datum/asset/spritesheet/preferences), get_asset_datum(/datum/asset/json/preferences), - get_asset_datum(/datum/asset/spritesheet_batched/pai_icons), ) + if(GLOB.asset_datums[/datum/asset/spritesheet_batched/pai_icons]) + assets += get_asset_datum(/datum/asset/spritesheet_batched/pai_icons) + for (var/datum/preference_middleware/preference_middleware as anything in middleware) assets += preference_middleware.get_ui_assets() diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm index e5e0f80124..ef072a9119 100644 --- a/code/modules/clothing/clothing_accessories.dm +++ b/code/modules/clothing/clothing_accessories.dm @@ -65,10 +65,10 @@ usr.put_in_l_hand(src) src.add_fingerprint(usr) -/obj/item/clothing/examine(var/mob/user) +/obj/item/clothing/examine(mob/user) . = ..(user) if(LAZYLEN(accessories)) - . += "It has the following attached: [counting_english_list(accessories, user)]" //CHOMPEdit + . += "It has the following attached: [counting_english_list(user.client, accessories)]" /** * Attach accessory A to src diff --git a/code/modules/lighting/lighting_atom.dm b/code/modules/lighting/lighting_atom.dm index ec33bc962a..9ee5785fe8 100644 --- a/code/modules/lighting/lighting_atom.dm +++ b/code/modules/lighting/lighting_atom.dm @@ -26,7 +26,7 @@ ///Lazylist to keep track on the sources of illumination. var/list/affected_dynamic_lights ///Either FALSE, [EMISSIVE_BLOCK_GENERIC], or [EMISSIVE_BLOCK_UNIQUE] - var/blocks_emissive = FALSE + var/blocks_emissive = EMISSIVE_BLOCK_NONE ///Internal holder for emissive blocker object, do not use directly use blocks_emissive var/atom/movable/emissive_blocker/em_block diff --git a/code/modules/mob/living/carbon/human/human_species.dm b/code/modules/mob/living/carbon/human/human_species.dm index fccac1b114..51ccb5f1f8 100644 --- a/code/modules/mob/living/carbon/human/human_species.dm +++ b/code/modules/mob/living/carbon/human/human_species.dm @@ -2,7 +2,7 @@ real_name = "Test Dummy" status_flags = CANPUSH has_huds = FALSE - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE no_vore = TRUE //Dummies don't need bellies. /mob/living/carbon/human/dummy/Initialize(mapload) diff --git a/code/modules/mob/living/simple_mob/simple_mob.dm b/code/modules/mob/living/simple_mob/simple_mob.dm index 2a70d3886d..4502635101 100644 --- a/code/modules/mob/living/simple_mob/simple_mob.dm +++ b/code/modules/mob/living/simple_mob/simple_mob.dm @@ -185,6 +185,7 @@ //no stripping of simplemobs strip_pref = FALSE + blocks_emissive = EMISSIVE_BLOCK_UNIQUE // Note, this should be refactored to drop priority overlays /mob/living/simple_mob/Initialize(mapload) remove_verb(src, /mob/verb/observe) diff --git a/code/modules/modular_computers/computers/modular_computer/variables.dm b/code/modules/modular_computers/computers/modular_computer/variables.dm index 2aa4eda0e8..be7e28afd9 100644 --- a/code/modules/modular_computers/computers/modular_computer/variables.dm +++ b/code/modules/modular_computers/computers/modular_computer/variables.dm @@ -24,7 +24,7 @@ // If you create a program which is limited to Laptops and Consoles you don't have to add it's icon_state overlay for Tablets too, for example. icon = null // This thing isn't meant to be used on it's own. Subtypes should supply their own icon. - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE var/overlay_icon = null // Icon file used for overlays icon_state = null center_of_mass_x = 0 diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 261337018a..cff2676765 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -100,7 +100,7 @@ GLOBAL_LIST_EMPTY(apcs) use_power = USE_POWER_OFF clicksound = "switch" req_access = list(ACCESS_ENGINE_EQUIP) - blocks_emissive = FALSE + blocks_emissive = EMISSIVE_BLOCK_NONE vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature var/area/area var/areastring = null diff --git a/code/modules/tgui_input/matrix.dm b/code/modules/tgui_input/matrix.dm index f5def9d076..24ca10bb89 100644 --- a/code/modules/tgui_input/matrix.dm +++ b/code/modules/tgui_input/matrix.dm @@ -209,6 +209,7 @@ playsound(src, 'sound/effects/spray3.ogg', 50, 1) temp = "Cleared Successfully!" color_matrix_last = DEFAULT_COLORMATRIX + update_tgui_static_data(ui.user, ui) return TRUE if("set_matrix_color") color_matrix_last[params["color"]] = params["value"] diff --git a/code/modules/xenoarcheaology/finds/find_spawning.dm b/code/modules/xenoarcheaology/finds/find_spawning.dm index c4a97ae1ab..95c2d1eb8d 100644 --- a/code/modules/xenoarcheaology/finds/find_spawning.dm +++ b/code/modules/xenoarcheaology/finds/find_spawning.dm @@ -86,10 +86,9 @@ additional_desc = "There appear to be [pick("dark","faintly glowing","pungent","bright")] [pick("red","purple","green","blue")] stains inside." if(ARCHAEO_URN) item_type = "urn" - new_item = new /obj/item/reagent_containers/glass/replenishing(src.loc) + new_item = new /obj/item/reagent_containers/glass/beaker(src.loc) if(prob(33)) LAZYSET(new_item.origin_tech, TECH_ARCANE, 1) - new_item = new /obj/item/reagent_containers/glass/beaker(src.loc) new_item.icon = 'icons/obj/xenoarchaeology.dmi' new_item.icon_state = "urn[rand(1,2)]" apply_image_decorations = TRUE