diff --git a/.github/workflows/byond.yml b/.github/workflows/byond.yml index 07fa61efb1f..c4659c0bd70 100644 --- a/.github/workflows/byond.yml +++ b/.github/workflows/byond.yml @@ -15,7 +15,7 @@ on: env: MACRO_COUNT: 0 GENDER_COUNT: 6 - TO_WORLD_COUNT: 179 + TO_WORLD_COUNT: 178 #These variables are filled from dependencies.sh inside the steps, DO NOT SET THEM HERE BYOND_MAJOR: "" diff --git a/aurorastation.dme b/aurorastation.dme index 1b1bcbf5fe8..b5aa22ab2ef 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -2438,6 +2438,7 @@ #include "code\modules\hydroponics\spreading\spreading.dm" #include "code\modules\hydroponics\spreading\spreading_growth.dm" #include "code\modules\hydroponics\spreading\spreading_response.dm" +#include "code\modules\hydroponics\trays\_defines.dm" #include "code\modules\hydroponics\trays\tray.dm" #include "code\modules\hydroponics\trays\tray_process.dm" #include "code\modules\hydroponics\trays\tray_reagents.dm" diff --git a/code/__DEFINES/spatial_gridmap.dm b/code/__DEFINES/spatial_gridmap.dm index 97a6f991539..4a59339875b 100644 --- a/code/__DEFINES/spatial_gridmap.dm +++ b/code/__DEFINES/spatial_gridmap.dm @@ -16,8 +16,10 @@ #define SPATIAL_GRID_CONTENTS_TYPE_CLIENTS RECURSIVE_CONTENTS_CLIENT_MOBS ///all atmos machines are stored in this channel (I'm sorry kyler) #define SPATIAL_GRID_CONTENTS_TYPE_ATMOS "spatial_grid_contents_type_atmos" +/// everything that can be targeted +#define SPATIAL_GRID_CONTENTS_TYPE_TARGETS RECURSIVE_CONTENTS_AI_TARGETS -#define ALL_CONTENTS_OF_CELL(cell) (cell.hearing_contents | cell.client_contents | cell.atmos_contents) +#define ALL_CONTENTS_OF_CELL(cell) (cell.hearing_contents | cell.client_contents | cell.atmos_contents | cell.target_contents) ///whether movable is itself or containing something which should be in one of the spatial grid channels. #define HAS_SPATIAL_GRID_CONTENTS(movable) (movable.spatial_grid_key) @@ -52,4 +54,5 @@ #define GRID_CELL_REMOVE_ALL(cell, movable) \ GRID_CELL_REMOVE(cell.hearing_contents, movable) \ GRID_CELL_REMOVE(cell.client_contents, movable) \ - GRID_CELL_REMOVE(cell.atmos_contents, movable) + GRID_CELL_REMOVE(cell.atmos_contents, movable) \ + GRID_CELL_REMOVE(cell.target_contents, movable) diff --git a/code/controllers/subsystems/spatial_gridmap.dm b/code/controllers/subsystems/spatial_gridmap.dm index 8c25e5f91d6..b6216dd042e 100644 --- a/code/controllers/subsystems/spatial_gridmap.dm +++ b/code/controllers/subsystems/spatial_gridmap.dm @@ -28,6 +28,8 @@ var/list/client_contents ///every atmos machine inside this cell var/list/atmos_contents + ///every valid ai turret target inside this cell + var/list/target_contents /datum/spatial_grid_cell/New(cell_x, cell_y, cell_z) . = ..() @@ -43,6 +45,7 @@ hearing_contents = dummy_list client_contents = dummy_list atmos_contents = dummy_list + target_contents = dummy_list /datum/spatial_grid_cell/Destroy(force) if(force)//the response to someone trying to qdel this is a right proper fuck you @@ -85,7 +88,7 @@ SUBSYSTEM_DEF(spatial_grid) ///list of the spatial_grid_cell datums per z level, arranged in the order of y index then x index var/list/grids_by_z_level = list() ///everything that spawns before us is added to this list until we initialize - var/list/waiting_to_add_by_type = list(SPATIAL_GRID_CONTENTS_TYPE_HEARING = list(), SPATIAL_GRID_CONTENTS_TYPE_CLIENTS = list(), SPATIAL_GRID_CONTENTS_TYPE_ATMOS = list()) + var/list/waiting_to_add_by_type = list(SPATIAL_GRID_CONTENTS_TYPE_HEARING = list(), SPATIAL_GRID_CONTENTS_TYPE_CLIENTS = list(), SPATIAL_GRID_CONTENTS_TYPE_ATMOS = list(), SPATIAL_GRID_CONTENTS_TYPE_TARGETS = list()) ///associative list of the form: movable.spatial_grid_key (string) -> inner list of spatial grid types for that key. ///inner lists contain contents channel types such as SPATIAL_GRID_CONTENTS_TYPE_HEARING etc. ///we use this to make adding to a cell static cost, and to save on memory @@ -257,6 +260,12 @@ SUBSYSTEM_DEF(spatial_grid) for(var/x_index in BOUNDING_BOX_MIN(center_x) to BOUNDING_BOX_MAX(center_x, cells_on_x_axis)) . += grid_level[row][x_index].atmos_contents + if(SPATIAL_GRID_CONTENTS_TYPE_TARGETS) + for(var/row in BOUNDING_BOX_MIN(center_y) to BOUNDING_BOX_MAX(center_y, cells_on_y_axis)) + for(var/x_index in BOUNDING_BOX_MIN(center_x) to BOUNDING_BOX_MAX(center_x, cells_on_x_axis)) + + . += grid_level[row][x_index].target_contents + return . ///get the grid cell encomapassing targets coordinates @@ -378,6 +387,11 @@ SUBSYSTEM_DEF(spatial_grid) GRID_CELL_SET(intersecting_cell.hearing_contents, new_target.important_recursive_contents[SPATIAL_GRID_CONTENTS_TYPE_HEARING]) SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_ENTERED(SPATIAL_GRID_CONTENTS_TYPE_HEARING), new_target_contents[SPATIAL_GRID_CONTENTS_TYPE_HEARING]) + if(SPATIAL_GRID_CONTENTS_TYPE_TARGETS) + var/list/new_target_contents = new_target.important_recursive_contents + GRID_CELL_SET(intersecting_cell.target_contents, new_target.important_recursive_contents[SPATIAL_GRID_CONTENTS_TYPE_TARGETS]) + SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_ENTERED(SPATIAL_GRID_CONTENTS_TYPE_TARGETS), new_target_contents[SPATIAL_GRID_CONTENTS_TYPE_TARGETS]) + if(SPATIAL_GRID_CONTENTS_TYPE_ATMOS) GRID_CELL_SET(intersecting_cell.atmos_contents, new_target) SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_ENTERED(SPATIAL_GRID_CONTENTS_TYPE_ATMOS), new_target) @@ -408,6 +422,11 @@ SUBSYSTEM_DEF(spatial_grid) GRID_CELL_SET(intersecting_cell.hearing_contents, new_target.important_recursive_contents[SPATIAL_GRID_CONTENTS_TYPE_HEARING]) SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_ENTERED(SPATIAL_GRID_CONTENTS_TYPE_HEARING), new_target_contents[SPATIAL_GRID_CONTENTS_TYPE_HEARING]) + if(SPATIAL_GRID_CONTENTS_TYPE_TARGETS) + var/list/new_target_contents = new_target.important_recursive_contents + GRID_CELL_SET(intersecting_cell.target_contents, new_target.important_recursive_contents[SPATIAL_GRID_CONTENTS_TYPE_TARGETS]) + SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_ENTERED(SPATIAL_GRID_CONTENTS_TYPE_TARGETS), new_target_contents[SPATIAL_GRID_CONTENTS_TYPE_TARGETS]) + if(SPATIAL_GRID_CONTENTS_TYPE_ATMOS) GRID_CELL_SET(intersecting_cell.atmos_contents, new_target) SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_ENTERED(SPATIAL_GRID_CONTENTS_TYPE_ATMOS), new_target) @@ -447,6 +466,11 @@ SUBSYSTEM_DEF(spatial_grid) GRID_CELL_REMOVE(intersecting_cell.hearing_contents, old_target_contents) SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_EXITED(type), old_target_contents) + if(SPATIAL_GRID_CONTENTS_TYPE_TARGETS) + var/list/old_target_contents = old_target.important_recursive_contents?[type] || old_target + GRID_CELL_REMOVE(intersecting_cell.target_contents, old_target_contents) + SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_EXITED(type), old_target_contents) + if(SPATIAL_GRID_CONTENTS_TYPE_ATMOS) GRID_CELL_REMOVE(intersecting_cell.atmos_contents, old_target) SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_EXITED(type), old_target) @@ -479,6 +503,11 @@ SUBSYSTEM_DEF(spatial_grid) GRID_CELL_REMOVE(intersecting_cell.hearing_contents, old_target_contents) SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_EXITED(exclusive_type), old_target_contents) + if(SPATIAL_GRID_CONTENTS_TYPE_TARGETS) + var/list/old_target_contents = old_target.important_recursive_contents?[exclusive_type] || old_target + GRID_CELL_REMOVE(intersecting_cell.target_contents, old_target_contents) + SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_EXITED(exclusive_type), old_target_contents) + if(SPATIAL_GRID_CONTENTS_TYPE_ATMOS) GRID_CELL_REMOVE(intersecting_cell.atmos_contents, old_target) SEND_SIGNAL(intersecting_cell, SPATIAL_GRID_CELL_EXITED(exclusive_type), old_target) @@ -521,6 +550,12 @@ SUBSYSTEM_DEF(spatial_grid) if(movable_to_check in cell.hearing_contents) contents = "hearing" + if(movable_to_check in cell.target_contents) + if(length(contents) > 0) + contents = "[contents], target" + else + contents = "target" + if(movable_to_check in cell.client_contents) if(length(contents) > 0) contents = "[contents], client" @@ -566,7 +601,7 @@ SUBSYSTEM_DEF(spatial_grid) remove_from_pre_init_queue(to_remove)//the spatial grid doesnt exist yet, so just take it out of the queue return -#ifdef UNIT_TESTS +#ifdef UNIT_TEST if(untracked_movable_error(to_remove)) find_hanging_cell_refs_for_movable(to_remove, remove_from_cells=FALSE) //dont remove from cells because we should be able to see 2 errors return @@ -604,7 +639,7 @@ SUBSYSTEM_DEF(spatial_grid) for(var/list/z_level_grid as anything in grids_by_z_level) for(var/list/cell_row as anything in z_level_grid) for(var/datum/spatial_grid_cell/cell as anything in cell_row) - if(to_remove in (cell.hearing_contents | cell.client_contents | cell.atmos_contents)) + if(to_remove in (cell.hearing_contents | cell.client_contents | cell.atmos_contents | cell.target_contents)) containing_cells += cell if(remove_from_cells) force_remove_from_cell(to_remove, cell) @@ -677,14 +712,17 @@ SUBSYSTEM_DEF(spatial_grid) var/raw_clients = 0 var/raw_hearables = 0 var/raw_atmos = 0 + var/raw_targets = 0 var/cells_with_clients = 0 var/cells_with_hearables = 0 var/cells_with_atmos = 0 + var/cells_with_targets = 0 var/list/client_list = list() var/list/hearable_list = list() var/list/atmos_list = list() + var/list/target_list = list() var/x_cell_count = world.maxx / SPATIAL_GRID_CELLSIZE var/y_cell_count = world.maxy / SPATIAL_GRID_CELLSIZE @@ -694,6 +732,7 @@ SUBSYSTEM_DEF(spatial_grid) var/average_clients_per_cell = 0 var/average_hearables_per_cell = 0 var/average_atmos_mech_per_call = 0 + var/average_targets_per_cell var/hearable_min_x = x_cell_count var/hearable_max_x = 1 @@ -707,6 +746,12 @@ SUBSYSTEM_DEF(spatial_grid) var/client_min_y = y_cell_count var/client_max_y = 1 + var/target_min_x = x_cell_count + var/target_max_x = 1 + + var/target_min_y = y_cell_count + var/target_max_y = 1 + var/atmos_min_x = x_cell_count var/atmos_max_x = 1 @@ -727,7 +772,7 @@ SUBSYSTEM_DEF(spatial_grid) for(var/client_to_insert in 0 to insert_clients) var/turf/random_turf = pick(turfs) var/mob/fake_client = new() - fake_client.important_recursive_contents = list(SPATIAL_GRID_CONTENTS_TYPE_HEARING = list(fake_client), SPATIAL_GRID_CONTENTS_TYPE_CLIENTS = list(fake_client)) + fake_client.important_recursive_contents = list(SPATIAL_GRID_CONTENTS_TYPE_HEARING = list(fake_client), SPATIAL_GRID_CONTENTS_TYPE_CLIENTS = list(fake_client), SPATIAL_GRID_CONTENTS_TYPE_TARGETS = list(fake_client)) fake_client.forceMove(random_turf) inserted_clients += fake_client @@ -737,10 +782,12 @@ SUBSYSTEM_DEF(spatial_grid) var/client_length = length(cell.client_contents) var/hearable_length = length(cell.hearing_contents) var/atmos_length = length(cell.atmos_contents) + var/target_length = length(cell.target_contents) raw_clients += client_length raw_hearables += hearable_length raw_atmos += atmos_length + raw_targets += target_length if(client_length) cells_with_clients++ @@ -776,6 +823,23 @@ SUBSYSTEM_DEF(spatial_grid) if(cell.cell_y > hearable_max_y) hearable_max_y = cell.cell_y + if(target_length) + cells_with_targets++ + + target_list += cell.target_contents + + if(cell.cell_x < hearable_min_x) + target_min_x = cell.cell_x + + if(cell.cell_x > hearable_max_x) + target_max_x = cell.cell_x + + if(cell.cell_y < hearable_min_y) + target_min_y = cell.cell_y + + if(cell.cell_y > hearable_max_y) + target_max_y = cell.cell_y + if(raw_atmos) cells_with_atmos++ @@ -796,10 +860,12 @@ SUBSYSTEM_DEF(spatial_grid) var/total_client_distance = 0 var/total_hearable_distance = 0 var/total_atmos_distance = 0 + var/total_target_distance = 0 var/average_client_distance = 0 var/average_hearable_distance = 0 var/average_atmos_distance = 0 + var/average_target_distance = 0 for(var/hearable in hearable_list)//n^2 btw for(var/other_hearable in hearable_list) @@ -813,6 +879,12 @@ SUBSYSTEM_DEF(spatial_grid) continue total_client_distance += get_dist(client, other_client) + for(var/target in target_list)//n^2 btw + for(var/other_target in target_list) + if(target == other_target) + continue + total_target_distance += get_dist(target, other_target) + for(var/atmos in atmos_list)//n^2 btw for(var/other_atmos in atmos_list) if(atmos == other_atmos) @@ -825,24 +897,28 @@ SUBSYSTEM_DEF(spatial_grid) average_client_distance = total_client_distance / length(client_list) if(length(atmos_list)) average_atmos_distance = total_atmos_distance / length(atmos_list) + if(length(target_list)) + average_target_distance = total_target_distance / length(target_list) average_clients_per_cell = raw_clients / total_cells average_hearables_per_cell = raw_hearables / total_cells average_atmos_mech_per_call = raw_atmos / total_cells + average_targets_per_cell = raw_targets / total_cells for(var/mob/inserted_client as anything in inserted_clients) qdel(inserted_client) message_admins("on z level [z] there are [raw_clients] clients ([insert_clients] of whom are fakes inserted to random station turfs)\ - , [raw_hearables] hearables, and [raw_atmos] atmos machines. all of whom are inside the bounding box given by \ + , [raw_hearables] hearables, [raw_targets] targets, and [raw_atmos] atmos machines. all of whom are inside the bounding box given by \ clients: ([client_min_x], [client_min_y]) x ([client_max_x], [client_max_y]), \ hearables: ([hearable_min_x], [hearable_min_y]) x ([hearable_max_x], [hearable_max_y]) \ + targets: ([target_min_x], [target_min_y] x [target_max_x], [target_max_y]) \ and atmos machines: ([atmos_min_x], [atmos_min_y]) x ([atmos_max_x], [atmos_max_y]), \ on average there are [average_clients_per_cell] clients per cell, [average_hearables_per_cell] hearables per cell, \ - and [average_atmos_mech_per_call] per cell, \ - [cells_with_clients] cells have clients, [cells_with_hearables] have hearables, and [cells_with_atmos] have atmos machines \ + [average_targets_per_cell] targets per cell, and [average_atmos_mech_per_call] atmos machines per cell, \ + [cells_with_clients] cells have clients, [cells_with_hearables] have hearables, [cells_with_targets] have targets, and [cells_with_atmos] have atmos machines \ the average client distance is: [average_client_distance], the average hearable_distance is [average_hearable_distance], \ - and the average atmos distance is [average_atmos_distance] ") + the average target distance is [average_target_distance], and the average atmos distance is [average_atmos_distance] ") #undef BOUNDING_BOX_MAX #undef BOUNDING_BOX_MIN diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 5dcd6d9a5d9..b0aa198a85b 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -580,7 +580,7 @@ LAZYINITLIST(recursive_contents[channel]) recursive_contents[channel] -= gone.important_recursive_contents[channel] switch(channel) - if(RECURSIVE_CONTENTS_CLIENT_MOBS, RECURSIVE_CONTENTS_HEARING_SENSITIVE) + if(RECURSIVE_CONTENTS_CLIENT_MOBS, RECURSIVE_CONTENTS_HEARING_SENSITIVE,RECURSIVE_CONTENTS_AI_TARGETS) if(!length(recursive_contents[channel])) // This relies on a nice property of the linked recursive and gridmap types // They're defined in relation to each other, so they have the same value @@ -601,7 +601,7 @@ var/list/recursive_contents = location.important_recursive_contents // blue hedgehog velocity LAZYINITLIST(recursive_contents[channel]) switch(channel) - if(RECURSIVE_CONTENTS_CLIENT_MOBS, RECURSIVE_CONTENTS_HEARING_SENSITIVE) + if(RECURSIVE_CONTENTS_CLIENT_MOBS, RECURSIVE_CONTENTS_HEARING_SENSITIVE,RECURSIVE_CONTENTS_AI_TARGETS) if(!length(recursive_contents[channel])) SSspatial_grid.add_grid_awareness(location, channel) recursive_contents[channel] |= arrived.important_recursive_contents[channel] @@ -701,25 +701,29 @@ // This proc adds atom/movables to the AI targetable list, i.e. things that the AI (turrets, hostile animals) will attempt to target /atom/movable/proc/add_to_target_grid() for (var/atom/movable/location as anything in get_nested_locs(src) + src) - LAZYADDASSOCLIST(location.important_recursive_contents, RECURSIVE_CONTENTS_AI_TARGETS, src) + LAZYINITLIST(location.important_recursive_contents) + var/list/recursive_contents = location.important_recursive_contents + if(!length(recursive_contents[RECURSIVE_CONTENTS_AI_TARGETS])) + SSspatial_grid.add_grid_awareness(location, SPATIAL_GRID_CONTENTS_TYPE_TARGETS) + LAZYINITLIST(recursive_contents[RECURSIVE_CONTENTS_AI_TARGETS]) + recursive_contents[RECURSIVE_CONTENTS_AI_TARGETS] |= src var/turf/our_turf = get_turf(src) - if(our_turf && SSspatial_grid.initialized) - SSspatial_grid.add_grid_awareness(src, RECURSIVE_CONTENTS_AI_TARGETS) - SSspatial_grid.add_grid_membership(src, our_turf, RECURSIVE_CONTENTS_AI_TARGETS) - - else if(our_turf && !SSspatial_grid.initialized)//SSspatial_grid isnt init'd yet, add ourselves to the queue - SSspatial_grid.enter_pre_init_queue(src, RECURSIVE_CONTENTS_AI_TARGETS) + SSspatial_grid.add_grid_membership(src, our_turf, SPATIAL_GRID_CONTENTS_TYPE_TARGETS) /atom/movable/proc/clear_from_target_grid() var/turf/our_turf = get_turf(src) - if(our_turf && SSspatial_grid.initialized) - SSspatial_grid.exit_cell(src, our_turf, RECURSIVE_CONTENTS_AI_TARGETS) - else if(our_turf && !SSspatial_grid.initialized) - SSspatial_grid.remove_from_pre_init_queue(src, RECURSIVE_CONTENTS_AI_TARGETS) + SSspatial_grid.remove_grid_membership(src, our_turf, SPATIAL_GRID_CONTENTS_TYPE_TARGETS) - for(var/atom/movable/location as anything in get_nested_locs(src) + src) - LAZYREMOVEASSOC(location.important_recursive_contents, RECURSIVE_CONTENTS_AI_TARGETS, src) + for(var/atom/movable/movable_loc as anything in get_nested_locs(src) + src) + LAZYINITLIST(movable_loc.important_recursive_contents) + var/list/recursive_contents = movable_loc.important_recursive_contents // blue hedgehog velocity + LAZYINITLIST(recursive_contents[RECURSIVE_CONTENTS_AI_TARGETS]) + recursive_contents[RECURSIVE_CONTENTS_AI_TARGETS] -= src + if(!length(recursive_contents[RECURSIVE_CONTENTS_AI_TARGETS])) + SSspatial_grid.remove_grid_awareness(movable_loc, SPATIAL_GRID_CONTENTS_TYPE_TARGETS) + ASSOC_UNSETEMPTY(recursive_contents, RECURSIVE_CONTENTS_AI_TARGETS) + UNSETEMPTY(movable_loc.important_recursive_contents) /atom/movable/proc/do_simple_ranged_interaction(var/mob/user) return FALSE diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 59dfa61b5eb..cbfc2c77d6d 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -38,22 +38,20 @@ if (!target) src.target = locate(/obj/machinery/atmospherics/pipe) in loc -/obj/machinery/meter/process() - ClearOverlays() - if(!target) - AddOverlays("pressure_off") - AddOverlays("buttons-x") - return FALSE - - if(stat & (BROKEN|NOPOWER)) - AddOverlays("pressure_off") - return FALSE +/obj/machinery/meter/update_icon() + var/list/new_overlays = get_rebuild_overlays() + if(LAZYLEN(new_overlays)) + ClearOverlays() + AddOverlays(new_overlays) +/obj/machinery/meter/proc/get_rebuild_overlays() + if (!target) + return list("pressure_off", "buttons_x") + if (stat & (BROKEN|NOPOWER)) + return list("pressure_off") var/datum/gas_mixture/environment = target.return_air() if(!environment) - AddOverlays("buttons_x") - AddOverlays("pressure0") - return FALSE + return list("pressure0", "buttons_x") var/button_overlay_name var/atmos_overlay_name @@ -76,19 +74,16 @@ else atmos_overlay_name = "pressure4" - button_overlay = overlay_image(icon, button_overlay_name) - atmos_overlay = overlay_image(icon, atmos_overlay_name) - button_emissive = emissive_appearance(icon, button_overlay_name) - atmos_emissive = emissive_appearance(icon, atmos_overlay_name) + if (!button_overlay || button_overlay.icon_state != button_overlay_name) + button_overlay = overlay_image(icon, button_overlay_name) + button_emissive = emissive_appearance(icon, button_overlay_name) + . = TRUE var/env_temperature = environment.temperature - var/temp_color + var/temp_color = COLOR_GRAY - if(env_pressure == 0 || env_temperature == 0) - temp_color = COLOR_GRAY - - else + if(env_pressure != 0 && env_temperature != 0) switch(env_temperature) if((BODYTEMP_HEAT_DAMAGE_LIMIT + 360) to INFINITY) temp_color = COLOR_RED @@ -105,13 +100,23 @@ else temp_color = COLOR_VIOLET - if(atmos_overlay.color != temp_color) + if (!atmos_overlay || atmos_overlay.icon_state != atmos_overlay_name || atmos_overlay.color != temp_color) + atmos_overlay = overlay_image(icon, atmos_overlay_name) + atmos_emissive = emissive_appearance(icon, atmos_overlay_name) atmos_overlay.color = temp_color + . = TRUE - AddOverlays(button_overlay) - AddOverlays(atmos_overlay) - AddOverlays(button_emissive) - AddOverlays(atmos_emissive) + if (.) + return list(button_overlay, button_emissive, atmos_overlay, atmos_emissive) + +/obj/machinery/meter/process() + update_icon() + if (!target || (stat & (BROKEN|NOPOWER))) + return FALSE + var/datum/gas_mixture/environment = target.return_air() + if(!environment) + return FALSE + var/env_pressure = environment.return_pressure() if(frequency) var/datum/radio_frequency/radio_connection = SSradio.return_frequency(frequency) diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm index b697f63693b..df534df99da 100644 --- a/code/game/machinery/biogenerator.dm +++ b/code/game/machinery/biogenerator.dm @@ -13,6 +13,7 @@ var/build_eff = 1 var/eat_eff = 1 var/capacity = 100 + var/ref_for_ui component_types = list( /obj/item/circuitboard/biogenerator, @@ -536,6 +537,7 @@ EMAG/ILLEGAL R.my_atom = src beaker = new /obj/item/reagent_containers/glass/bottle(src) update_icon() + ref_for_ui = "[REF(src)]" /obj/machinery/biogenerator/on_reagent_change() //When the reagents change, change the icon as well. update_icon() @@ -618,8 +620,8 @@ EMAG/ILLEGAL if("menu") if (beaker) dat += "
Commands | |||||||
| Activate Biogenerator | |||||||
| Detach Container | |||||||
| Activate Biogenerator | |||||||
| Detach Container | |||||||
| Name | Cost | Production Amount | |||||