diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_golem_ship.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_golem_ship.dmm index a6d99cc4bb8fc..752f7e624e7ac 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_golem_ship.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_golem_ship.dmm @@ -525,7 +525,7 @@ "bG" = ( /obj/machinery/computer/shuttle_flight{ dir = 4; - icon_state = "computer" + icon_state = "computer-0" }, /obj/effect/decal/cleanable/dirt, /turf/open/floor/carpet/purple, @@ -661,7 +661,7 @@ "ce" = ( /obj/machinery/computer/monitor/secret{ dir = 1; - icon_state = "computer" + icon_state = "computer-0" }, /obj/effect/decal/cleanable/dirt, /turf/open/floor/pod/dark, @@ -699,7 +699,7 @@ "ck" = ( /obj/machinery/computer/operating{ dir = 4; - icon_state = "computer" + icon_state = "computer-0" }, /turf/open/floor/pod/dark, /area/ruin/powered/golem_ship) diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_seed_vault.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_seed_vault.dmm index 362ad815f9f84..77109279a7cd1 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_seed_vault.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_seed_vault.dmm @@ -497,7 +497,7 @@ "wa" = ( /obj/machinery/computer/shuttle_flight{ dir = 4; - icon_state = "computer" + icon_state = "computer-0" }, /turf/open/floor/pod/light, /area/ruin/powered/seedvault) @@ -1079,7 +1079,7 @@ "Po" = ( /obj/machinery/computer/monitor/secret{ dir = 4; - icon_state = "computer" + icon_state = "computer-0" }, /turf/open/floor/pod/light, /area/ruin/powered/seedvault) diff --git a/code/__DEFINES/icon_smoothing.dm b/code/__DEFINES/icon_smoothing.dm index 5ee61045c703c..0e48fa04f5b46 100644 --- a/code/__DEFINES/icon_smoothing.dm +++ b/code/__DEFINES/icon_smoothing.dm @@ -11,7 +11,8 @@ #define SMOOTH_QUEUED (1<<4) /// Smooths with objects, and will thus need to scan turfs for contents. #define SMOOTH_OBJ (1<<5) - +/// Smooths with atoms facing the same direction only +#define SMOOTH_DIRECTIONAL (1<<6) DEFINE_BITFIELD(smoothing_flags, list( "SMOOTH_CORNERS" = SMOOTH_CORNERS, @@ -20,6 +21,7 @@ DEFINE_BITFIELD(smoothing_flags, list( "SMOOTH_BORDER" = SMOOTH_BORDER, "SMOOTH_QUEUED" = SMOOTH_QUEUED, "SMOOTH_OBJ" = SMOOTH_OBJ, + "SMOOTH_DIRECTIONAL" = SMOOTH_DIRECTIONAL, )) @@ -114,6 +116,8 @@ DEFINE_BITFIELD(smoothing_flags, list( #define SMOOTH_GROUP_HEDGE_FLUFF S_OBJ(65) ///obj/structure/fluff/hedge #define SMOOTH_GROUP_SHUTTLE_PARTS S_OBJ(66) ///obj/structure/window/shuttle, /obj/structure/window/plasma/reinforced/plastitanium, /turf/closed/indestructible/opsglass, /obj/structure/shuttle #define SMOOTH_GROUP_CLEANABLE_DIRT S_OBJ(67) ///obj/effect/decal/cleanable/dirt +///obj/machinery/computer/_computer +#define SMOOTH_GROUP_COMPUTERS S_OBJ (68) //LIQUIDS diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index 1e11a6ec1ccff..401c0f3ac3e22 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -241,29 +241,36 @@ DEFINE_BITFIELD(smoothing_junction, list( if((source_area.area_limited_icon_smoothing && !istype(target_area, source_area.area_limited_icon_smoothing)) || (target_area.area_limited_icon_smoothing && !istype(source_area, target_area.area_limited_icon_smoothing))) return NO_ADJ_FOUND + var/atom/match //Used later in a special check + if(isnull(canSmoothWith)) //special case in which it will only smooth with itself if(isturf(src)) - return (type == target_turf.type) ? ADJ_FOUND : NO_ADJ_FOUND - var/atom/matching_obj = locate(type) in target_turf - return (matching_obj && matching_obj.type == type) ? ADJ_FOUND : NO_ADJ_FOUND + match = (type == target_turf.type) ? target_turf : null + else + var/atom/matching_obj = locate(type) in target_turf + match = (matching_obj && matching_obj.type == type) ? matching_obj : null - if(!isnull(target_turf.smoothing_groups)) + if(isnull(match) && !isnull(target_turf.smoothing_groups)) for(var/target in canSmoothWith) - if(!(canSmoothWith[target] & target_turf.smoothing_groups[target])) - continue - return ADJ_FOUND + if(canSmoothWith[target] & target_turf.smoothing_groups[target]) + match = target_turf - if(smoothing_flags & SMOOTH_OBJ) + if(isnull(match) && smoothing_flags & SMOOTH_OBJ) for(var/am in target_turf) var/atom/movable/thing = am if(!thing.anchored || isnull(thing.smoothing_groups)) continue for(var/target in canSmoothWith) - if(!(canSmoothWith[target] & thing.smoothing_groups[target])) - continue - return ADJ_FOUND + if(canSmoothWith[target] & thing.smoothing_groups[target]) + match = thing - return NO_ADJ_FOUND + if(isnull(match)) + return NO_ADJ_FOUND + . = ADJ_FOUND + + if(smoothing_flags & SMOOTH_DIRECTIONAL) + if(match.dir != dir) + return NO_ADJ_FOUND /** * Basic smoothing proc. The atom checks for adjacent directions to smooth with and changes the icon_state based on that. @@ -279,6 +286,14 @@ DEFINE_BITFIELD(smoothing_junction, list( var/smooth_border = (smoothing_flags & SMOOTH_BORDER) var/smooth_obj = (smoothing_flags & SMOOTH_OBJ) + var/smooth_directional = (smoothing_flags & SMOOTH_DIRECTIONAL) + + #define EXTRA_CHECKS(atom) \ + if(smooth_directional) { \ + if(atom.dir != dir) { \ + break set_adj_in_dir; \ + }; \ + }; \ #define SET_ADJ_IN_DIR(direction, direction_flag) \ set_adj_in_dir: { \ @@ -289,6 +304,7 @@ DEFINE_BITFIELD(smoothing_junction, list( if(neighbor_smoothing_groups) { \ for(var/target in canSmoothWith) { \ if(canSmoothWith[target] & neighbor_smoothing_groups[target]) { \ + EXTRA_CHECKS(neighbor); \ new_junction |= direction_flag; \ break set_adj_in_dir; \ }; \ @@ -302,6 +318,7 @@ DEFINE_BITFIELD(smoothing_junction, list( }; \ for(var/target in canSmoothWith) { \ if(canSmoothWith[target] & thing_smoothing_groups[target]) { \ + EXTRA_CHECKS(thing); \ new_junction |= direction_flag; \ break set_adj_in_dir; \ }; \ @@ -338,7 +355,7 @@ DEFINE_BITFIELD(smoothing_junction, list( set_smoothed_icon_state(new_junction) #undef SET_ADJ_IN_DIR - + #undef EXTRA_CHECKS ///Changes the icon state based on the new junction bitmask. Returns the old junction value. /atom/proc/set_smoothed_icon_state(new_junction) diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm index 4d6c9d6779ad8..85bda5cde9f7f 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -1,7 +1,11 @@ /obj/machinery/computer name = "computer" icon = 'icons/obj/computer.dmi' - icon_state = "computer" + icon_state = "computer-0" + base_icon_state = "computer" + smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIRECTIONAL + smoothing_groups = list(SMOOTH_GROUP_COMPUTERS) + canSmoothWith = list(SMOOTH_GROUP_COMPUTERS) density = TRUE use_power = IDLE_POWER_USE idle_power_usage = 300 @@ -26,6 +30,9 @@ /obj/machinery/computer/Initialize(mapload, obj/item/circuitboard/C) . = ..() + if(smoothing_flags & SMOOTH_BITMASK) + QUEUE_SMOOTH(src) + QUEUE_SMOOTH_NEIGHBORS(src) power_change() if(!QDELETED(C)) qdel(circuit) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 804d7c4022abc..758be27d3c8da 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -71,11 +71,18 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( icon_state = "arcade" icon_keyboard = "no_keyboard" icon_screen = "invaders" + + //these muthafuckas arent supposed to smooth + base_icon_state = null + smoothing_flags = null + smoothing_groups = null + canSmoothWith = null + clockwork = TRUE //it'd look weird broken_overlay_emissive = TRUE + light_color = LIGHT_COLOR_GREEN var/list/prize_override var/prizeselect = /obj/item/coin/arcade_token - light_color = LIGHT_COLOR_GREEN /obj/machinery/computer/arcade/proc/Reset() return diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 1b0feb1bc5e6a..98ca8c0d0d025 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -2,8 +2,6 @@ name = "atmospheric alert console" desc = "Used to monitor the station's air alarms." circuit = /obj/item/circuitboard/computer/atmos_alert - - icon_screen = "alert:0" icon_keyboard = "atmos_key" var/list/priority_alarms = list() diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index bf2627496eaea..9d968c7b3fefe 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -227,6 +227,13 @@ icon_state = "television" icon_keyboard = "no_keyboard" icon_screen = "detective_tv" + + //these muthafuckas arent supposed to smooth + base_icon_state = null + smoothing_flags = null + smoothing_groups = null + canSmoothWith = null + clockwork = TRUE //it'd look weird broken_overlay_emissive = TRUE pass_flags = PASSTABLE @@ -270,6 +277,13 @@ desc = "Used for watching an empty arena." icon = 'icons/obj/stationobjs.dmi' icon_state = "telescreen" + + //these muthafuckas arent supposed to smooth + base_icon_state = null + smoothing_flags = null + smoothing_groups = null + canSmoothWith = null + layer = SIGN_LAYER network = list("thunder") density = FALSE diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 47ef94de0934b..37fc014ee75b4 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -16,7 +16,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) name = "identification console" desc = "You can use this to manage jobs and ID access." icon_screen = "id" - icon_keyboard = "id_key" + icon_keyboard = "generic_key" req_one_access = list(ACCESS_HEADS, ACCESS_CHANGE_IDS) circuit = /obj/item/circuitboard/computer/card var/mode = 0 diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 3ab882a2eda29..51308b21e7b83 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -604,6 +604,13 @@ icon_state = "laptop" icon_screen = "medlaptop" icon_keyboard = "laptop_key" + + //these muthafuckas arent supposed to smooth + base_icon_state = null + smoothing_flags = null + smoothing_groups = null + canSmoothWith = null + clockwork = TRUE //it'd look weird broken_overlay_emissive = TRUE pass_flags = PASSTABLE diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index ff114675818b8..dc39ff1b81109 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -180,6 +180,13 @@ icon_state = "laptop" icon_screen = "seclaptop" icon_keyboard = "laptop_key" + + //these muthafuckas arent supposed to smooth + base_icon_state = null + smoothing_flags = null + smoothing_groups = null + canSmoothWith = null + clockwork = TRUE //it'd look weird broken_overlay_emissive = TRUE pass_flags = PASSTABLE diff --git a/code/game/objects/structures/showcase.dm b/code/game/objects/structures/showcase.dm index c7d4f98f248f4..038134f41c3d5 100644 --- a/code/game/objects/structures/showcase.dm +++ b/code/game/objects/structures/showcase.dm @@ -15,18 +15,18 @@ name = "\improper CentCom identification console" desc = "You can use this to change ID's." icon = 'icons/obj/computer.dmi' - icon_state = "computer" + icon_state = "computer-0" /obj/structure/showcase/fakeid/Initialize(mapload) . = ..() add_overlay("id") - add_overlay("id_key") + add_overlay("generic_key") /obj/structure/showcase/fakesec name = "\improper CentCom security records" desc = "Used to view and edit personnel's security records." icon = 'icons/obj/computer.dmi' - icon_state = "computer" + icon_state = "computer-0" /obj/structure/showcase/fakesec/Initialize(mapload) . = ..() diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index c6fd689d57a2c..462297899e13d 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -19,15 +19,22 @@ icon_state = "oldcomp" icon_screen = "library" icon_keyboard = null + + //these muthafuckas arent supposed to smooth + base_icon_state = null + smoothing_flags = null + smoothing_groups = null + canSmoothWith = null + circuit = /obj/item/circuitboard/computer/libraryconsole desc = "Checked out books MUST be returned on time." + clockwork = TRUE //it'd look weird + broken_overlay_emissive = TRUE var/screenstate = 0 var/title var/category = "Any" var/author var/search_page = 0 - clockwork = TRUE //it'd look weird - broken_overlay_emissive = TRUE /obj/machinery/computer/libraryconsole/ui_interact(mob/user) . = ..() diff --git a/code/modules/modular_computers/computers/machinery/modular_console.dm b/code/modules/modular_computers/computers/machinery/modular_console.dm index b38815fa4ebb4..d789d641454b3 100644 --- a/code/modules/modular_computers/computers/machinery/modular_console.dm +++ b/code/modules/modular_computers/computers/machinery/modular_console.dm @@ -1,12 +1,13 @@ /obj/machinery/modular_computer/console name = "console" desc = "A stationary computer." - icon = 'icons/obj/modular_console.dmi' - icon_state = "console" - icon_state_powered = "console" - icon_state_unpowered = "console-off" + icon_state = "console-0" screen_icon_state_menu = "menu" + base_icon_state = "console" + smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIRECTIONAL + smoothing_groups = list(SMOOTH_GROUP_COMPUTERS) + canSmoothWith = list(SMOOTH_GROUP_COMPUTERS) hardware_flag = PROGRAM_CONSOLE density = TRUE base_idle_power_usage = 100 @@ -30,6 +31,10 @@ /obj/machinery/modular_computer/console/Initialize(mapload) . = ..() + if(smoothing_flags & SMOOTH_BITMASK) + QUEUE_SMOOTH(src) + QUEUE_SMOOTH_NEIGHBORS(src) + var/obj/item/computer_hardware/battery/battery_module = cpu.all_components[MC_CELL] if(battery_module) qdel(battery_module) @@ -53,3 +58,21 @@ if(cpu) cpu.screen_on = 1 update_icon() + +// Same as parent code, but without the smoothing handling +/obj/machinery/modular_computer/update_icon() + cut_overlays() + + if(!cpu || !cpu.enabled) + if (!(machine_stat & NOPOWER) && (cpu && cpu.use_power())) + add_overlay(screen_icon_screensaver) + else + if(cpu.active_program) + add_overlay(cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu) + else + add_overlay(screen_icon_state_menu) + + if(cpu && cpu.obj_integrity <= cpu.integrity_failure) + add_overlay("bsod") + add_overlay("broken") + diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 0d90881ed49d7..39ce1aa8ac8ef 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -257,7 +257,11 @@ name = "solar panel control" desc = "A controller for solar panel arrays." icon = 'icons/obj/computer.dmi' - icon_state = "computer" + icon_state = "computer-0" + base_icon_state = "computer" + smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIRECTIONAL + smoothing_groups = list(SMOOTH_GROUP_COMPUTERS) + canSmoothWith = list(SMOOTH_GROUP_COMPUTERS) density = TRUE use_power = IDLE_POWER_USE idle_power_usage = 250 @@ -278,6 +282,9 @@ /obj/machinery/power/solar_control/Initialize(mapload) . = ..() + if(smoothing_flags & SMOOTH_BITMASK) + QUEUE_SMOOTH(src) + QUEUE_SMOOTH_NEIGHBORS(src) if(powernet) set_panels(currentdir) connect_to_network() diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 1938e97185e1f..f868dfb08f35a 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -606,6 +606,13 @@ possible_destinations = "pod_asteroid" icon = 'icons/obj/terminals.dmi' icon_state = "dorm_available" + + //these muthafuckas arent supposed to smooth + base_icon_state = null + smoothing_flags = null + smoothing_groups = null + canSmoothWith = null + light_color = LIGHT_COLOR_BLUE density = FALSE clockwork = TRUE //it'd look weird diff --git a/icons/obj/computer.dmi b/icons/obj/computer.dmi index cd93e4d3878ac..d7d8943a4f475 100644 Binary files a/icons/obj/computer.dmi and b/icons/obj/computer.dmi differ diff --git a/icons/obj/modular_console.dmi b/icons/obj/modular_console.dmi index fba79f7a8879e..01b1bfec7091e 100644 Binary files a/icons/obj/modular_console.dmi and b/icons/obj/modular_console.dmi differ