diff --git a/_maps/map_files/Talos/TGS_Talos.dmm b/_maps/map_files/Talos/TGS_Talos.dmm index 470f7bfbf1d..8316466457c 100644 --- a/_maps/map_files/Talos/TGS_Talos.dmm +++ b/_maps/map_files/Talos/TGS_Talos.dmm @@ -14071,8 +14071,7 @@ "iDP" = ( /obj/machinery/door_control/mainship/cic{ id = "bot_armory"; - name = "Armory Lockdown"; - pixel_x = -5 + name = "Armory Lockdown" }, /turf/open/floor/mainship/metal/full, /area/mainship/command/cic) @@ -28366,14 +28365,16 @@ }, /obj/machinery/door_control/mainship/cic{ dir = 1; - pixel_x = 5 + pixel_x = 5; + pixel_y = -16 }, /obj/effect/turf_decal/siding/metal, /obj/machinery/door_control{ id = "Brig Lockdown"; name = "Brig Lockdown"; dir = 1; - pixel_x = -6 + pixel_x = -6; + pixel_y = -16 }, /turf/open/floor/mainship/metal, /area/mainship/command/cic) diff --git a/code/game/objects/machinery/buttons.dm b/code/game/objects/machinery/buttons.dm index 0194113a664..b31c4ff8404 100644 --- a/code/game/objects/machinery/buttons.dm +++ b/code/game/objects/machinery/buttons.dm @@ -4,32 +4,59 @@ name = "button" desc = "A remote control switch." icon = 'icons/obj/machines/buttons.dmi' - icon_state = "doorctrl" + icon_state = "door" power_channel = ENVIRON use_power = IDLE_POWER_USE idle_power_usage = 2 active_power_usage = 5 soft_armor = list(MELEE = 50, BULLET = 50, LASER = 50, ENERGY = 50, BOMB = 10, BIO = 100, FIRE = 90, ACID = 70) + light_range = 1 + light_power = 0.3 var/id = null var/next_activate = 0 /obj/machinery/button/indestructible resistance_flags = RESIST_ALL -/obj/machinery/button/Initialize(mapload, ndir = 0) +/obj/machinery/button/Initialize(mapload) . = ..() - setDir(ndir) - pixel_x = ( (dir & 3) ? 0 : (dir == 4 ? -24 : 24) ) - pixel_y = ( (dir & 3) ? (dir == 1 ? -24 : 24) : 0 ) - update_icon() + set_offsets() + +///Proc that sets pixel offsets on Initialize if the button doesn't have it map-edited +/obj/machinery/button/proc/set_offsets() + if(pixel_x || pixel_y) + return + + switch(dir) + if(NORTH) + pixel_y = -32 + if(SOUTH) + pixel_y = 32 + if(EAST) + pixel_x = -32 + if(WEST) + pixel_x = 32 + +/obj/machinery/button/update_icon() + . = ..() + if(machine_stat & (NOPOWER|BROKEN)) + set_light(0) + else + set_light(initial(light_range)) /obj/machinery/button/update_icon_state() . = ..() if(machine_stat & (NOPOWER|BROKEN)) - icon_state = "[initial(icon_state)]-p" + icon_state = "[initial(icon_state)]_off" else icon_state = initial(icon_state) +/obj/machinery/button/update_overlays() + . = ..() + if(machine_stat & (NOPOWER|BROKEN)) + return + . += emissive_appearance(icon, "[icon_state]_emissive") + /obj/machinery/button/attack_ai(mob/user) return attack_hand(user) @@ -43,11 +70,11 @@ if(!allowed(user)) to_chat(user, span_danger("Access Denied")) - flick("[initial(icon_state)]-denied", src) + flick("[initial(icon_state)]_denied", src) return use_power(active_power_usage) - icon_state = "[initial(icon_state)]1" + icon_state = "[initial(icon_state)]_on" pulsed() @@ -108,7 +135,9 @@ /obj/machinery/button/door/open_only/landing_zone name = "lockdown override" id = "landing_zone" - icon_state = "shutterctrl" + icon_state = "shutter" + light_range = 0 + light_power = 0 use_power = NO_POWER_USE resistance_flags = RESIST_ALL req_one_access = list(ACCESS_MARINE_DROPSHIP) @@ -130,10 +159,10 @@ #endif if(!allowed(user)) to_chat(user, span_danger("Access Denied")) - flick("[initial(icon_state)]-denied", src) + flick("[initial(icon_state)]_denied", src) return if(alarm_played) - flick("[initial(icon_state)]-denied", src) + flick("[initial(icon_state)]_denied", src) return use_power(active_power_usage) icon_state = "[initial(icon_state)]1" @@ -152,8 +181,8 @@ /obj/machinery/driver_button name = "mass driver button" - icon = 'icons/obj/objects.dmi' - icon_state = "launcherbtt" + icon = 'icons/obj/machines/buttons.dmi' + icon_state = "launcher" desc = "A remote control switch for a mass driver." anchored = TRUE use_power = IDLE_POWER_USE @@ -185,7 +214,7 @@ use_power(active_power_usage) active = TRUE - icon_state = "launcheract" + icon_state = "launcher_on" for(var/obj/machinery/door/poddoor/M in GLOB.machines) if(M.id == id) @@ -197,32 +226,32 @@ if(M.id == id) M.close() - icon_state = "launcherbtt" + icon_state = "launcher" active = 0 /obj/machinery/ignition_switch name = "ignition switch" - icon = 'icons/obj/objects.dmi' - icon_state = "launcherbtt" + icon = 'icons/obj/machines/buttons.dmi' + icon_state = "launcher" desc = "A remote control switch for a mounted igniter." - var/id = null - var/active = 0 anchored = TRUE use_power = IDLE_POWER_USE idle_power_usage = 2 active_power_usage = 4 + var/id = null + var/active = 0 /obj/machinery/flasher_button name = "flasher button" desc = "A remote control switch for a mounted flasher." - icon = 'icons/obj/objects.dmi' - icon_state = "launcherbtt" - var/id = null - var/active = 0 + icon = 'icons/obj/machines/buttons.dmi' + icon_state = "launcher" anchored = TRUE use_power = IDLE_POWER_USE idle_power_usage = 2 active_power_usage = 4 + var/id = null + var/active = 0 /obj/machinery/crema_switch desc = "Burn baby burn!" @@ -238,14 +267,14 @@ /obj/machinery/medical_help_button name = "Medical attention required" - icon = 'icons/obj/stationobjs.dmi' - icon_state = "doorctrl0" + icon = 'icons/obj/machines/buttons.dmi' + icon_state = "button" desc = "A button for alerting doctors that you require assistance." - var/active = FALSE anchored = TRUE use_power = IDLE_POWER_USE idle_power_usage = 2 active_power_usage = 4 + var/active = FALSE var/obj/item/radio/radio /obj/machinery/medical_help_button/Initialize(mapload) @@ -268,7 +297,7 @@ if(active) return use_power(active_power_usage) - icon_state = "doorctrl1" + icon_state = "button" radio.talk_into(src, "[user.name] is requesting medical attention at: [get_area(src)].", RADIO_CHANNEL_MEDICAL) visible_message("Remain calm, someone will be with you shortly.") @@ -283,9 +312,9 @@ /obj/machinery/medical_help_button/update_icon_state() . = ..() if(machine_stat & NOPOWER) - icon_state = "doorctrl-p" + icon_state = "door_off" else - icon_state = "doorctrl0" + icon_state = "door" /obj/machinery/button/valhalla resistance_flags = INDESTRUCTIBLE diff --git a/code/game/objects/machinery/door_control.dm b/code/game/objects/machinery/door_control.dm index 0db211a9303..587b861a35c 100644 --- a/code/game/objects/machinery/door_control.dm +++ b/code/game/objects/machinery/door_control.dm @@ -4,8 +4,9 @@ /obj/machinery/door_control name = "remote door-control" desc = "It controls doors, remotely." - icon = 'icons/obj/stationobjs.dmi' - icon_state = "doorctrl0" + icon = 'icons/obj/machines/buttons.dmi' + icon_state = "button" + base_icon_state = "button" desc = "A remote control-switch for a door." power_channel = ENVIRON anchored = TRUE @@ -18,17 +19,27 @@ /// Zero is closed, 1 is open. var/desiredstate = 0 var/specialfunctions = 1 - /// if true we apply directional offsets, if not the door control is free floating - var/directional = TRUE + ///If the button was pressed recently var/pressed = FALSE -/obj/machinery/door_control/Initialize(mapload, ndir = 0) +/obj/machinery/door_control/Initialize(mapload) . = ..() - if(directional) - setDir(ndir) - pixel_x = ( (dir & 3) ? 0 : (dir == 4 ? -22 : 22) ) - pixel_y = ( (dir & 3) ? (dir == 1 ? -16 : 28) : 0 ) - update_icon() + set_offsets() + +///Proc that sets pixel offsets on Initialize if the button doesn't have it map-edited +/obj/machinery/door_control/proc/set_offsets() + if(pixel_x || pixel_y) + return + + switch(dir) + if(NORTH) + pixel_y = -22 + if(SOUTH) + pixel_y = 28 + if(EAST) + pixel_x = -22 + if(WEST) + pixel_x = 22 /obj/machinery/door_control/attackby(obj/item/I, mob/user, params) . = ..() @@ -41,86 +52,88 @@ /obj/machinery/door_control/proc/handle_door() for(var/obj/machinery/door/airlock/D in range(range)) - if(D.id_tag == src.id) - if(specialfunctions & OPEN) - if (D.density) - D.open() - else - D.close() - if(desiredstate == 1) - if(specialfunctions & IDSCAN) - D.aiDisabledIdScanner = 1 - if(specialfunctions & BOLTS) - D.lock() - if(specialfunctions & SHOCK) - D.secondsElectrified = -1 - if(specialfunctions & SAFE) - D.safe = 0 + if(D.id_tag != src.id) + continue + + if(specialfunctions & OPEN) + if(D.density) + D.open() else - if(specialfunctions & IDSCAN) - D.aiDisabledIdScanner = 0 - if(specialfunctions & BOLTS) - if(!D.wires.is_cut(WIRE_BOLTS) && D.hasPower()) - D.unlock() - if(specialfunctions & SHOCK) - D.secondsElectrified = 0 - if(specialfunctions & SAFE) - D.safe = 1 + D.close() + if(desiredstate == 1) + if(specialfunctions & IDSCAN) + D.aiDisabledIdScanner = 1 + if(specialfunctions & BOLTS) + D.lock() + if(specialfunctions & SHOCK) + D.secondsElectrified = -1 + if(specialfunctions & SAFE) + D.safe = 0 + else + if(specialfunctions & IDSCAN) + D.aiDisabledIdScanner = 0 + if(specialfunctions & BOLTS) + if(!D.wires.is_cut(WIRE_BOLTS) && D.hasPower()) + D.unlock() + if(specialfunctions & SHOCK) + D.secondsElectrified = 0 + if(specialfunctions & SAFE) + D.safe = 1 /obj/machinery/door_control/proc/handle_pod() for(var/obj/machinery/door/poddoor/M in GLOB.machines) - if(M.id == id) - if(M.density) - M.open() - else - M.close() + if(M.id != id) + continue + + if(M.density) + M.open() + else + M.close() /obj/machinery/door_control/attack_hand(mob/living/user) . = ..() if(.) return - if(istype(user,/mob/living/carbon/xenomorph)) - return if(machine_stat & (NOPOWER|BROKEN)) to_chat(user, span_warning("[src] doesn't seem to be working.")) return + if(pressed) + return + if(!allowed(user)) to_chat(user, span_warning("Access Denied")) - if(directional) - flick("doorctrl-denied",src) - if(!directional) //nondirectional door controls use the old door denied sprites - flick("olddoorctrl-denied",src) + flick("[base_icon_state]_denied", src) + pressed = TRUE + addtimer(VARSET_CALLBACK(src, pressed, FALSE), 0.5 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE) return use_power(active_power_usage) pressed = TRUE - update_icon() + flick("[base_icon_state]_on", src) + + on_press() + addtimer(VARSET_CALLBACK(src, pressed, FALSE), 1 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE) + +///What do we on the button press? +/obj/machinery/door_control/proc/on_press() switch(normaldoorcontrol) if(CONTROL_NORMAL_DOORS) handle_door() if(CONTROL_POD_DOORS) handle_pod() - desiredstate = !desiredstate - addtimer(CALLBACK(src, PROC_REF(unpress)), 15, TIMER_OVERRIDE|TIMER_UNIQUE) /obj/machinery/door_control/attack_ai(mob/living/silicon/ai/AI) return attack_hand(AI) -/obj/machinery/door_control/proc/unpress() - pressed = FALSE - update_icon() - /obj/machinery/door_control/update_icon_state() . = ..() if(machine_stat & NOPOWER) - icon_state = "doorctrl-p" - else if(pressed) - icon_state = "doorctrl1" + icon_state = "[base_icon_state]_off" else - icon_state = "doorctrl0" + icon_state = base_icon_state /obj/machinery/door_control/unmeltable resistance_flags = RESIST_ALL @@ -242,17 +255,11 @@ resistance_flags = RESIST_ALL /obj/machinery/door_control/old //sometimes we need a button that has the appearance of the old button and isn't initialized to an x or y value - icon_state = "olddoorctrl0" - directional = FALSE + icon_state = "table" + base_icon_state = "table" -/obj/machinery/door_control/old/update_icon_state() - . = ..() - if(machine_stat & NOPOWER) - icon_state = "olddoorctrl-p" - else if(pressed) - icon_state = "olddoorctrl1" - else - icon_state = "olddoorctrl0" +/obj/machinery/door_control/old/set_offsets() + return /obj/machinery/door_control/old/req name = "RO Line Shutters" diff --git a/code/game/objects/machinery/flasher.dm b/code/game/objects/machinery/flasher.dm index 19e1e98cd50..11153c6c5db 100644 --- a/code/game/objects/machinery/flasher.dm +++ b/code/game/objects/machinery/flasher.dm @@ -137,7 +137,7 @@ use_power(active_power_usage) active = 1 - icon_state = "launcheract" + icon_state = "launcheron" for(var/obj/machinery/flasher/M in GLOB.machines) if(M.id == id) @@ -145,6 +145,6 @@ sleep(5 SECONDS) - icon_state = "launcherbtt" + icon_state = "launcher" active = 0 diff --git a/code/game/objects/machinery/igniter.dm b/code/game/objects/machinery/igniter.dm index 4cd84718ca1..89977fa8aef 100644 --- a/code/game/objects/machinery/igniter.dm +++ b/code/game/objects/machinery/igniter.dm @@ -122,7 +122,7 @@ use_power(active_power_usage) active = 1 - icon_state = "launcheract" + icon_state = "launcher_on" for(var/obj/machinery/sparker/M in GLOB.machines) if (M.id == src.id) @@ -136,6 +136,6 @@ sleep(5 SECONDS) - icon_state = "launcherbtt" + icon_state = "launcher" active = 0 diff --git a/code/game/objects/machinery/line_nexter.dm b/code/game/objects/machinery/line_nexter.dm index add6e694b92..9ae04bc0a4e 100644 --- a/code/game/objects/machinery/line_nexter.dm +++ b/code/game/objects/machinery/line_nexter.dm @@ -33,8 +33,8 @@ /obj/machinery/line_nexter_control name = "Next Button" - icon = 'icons/obj/stationobjs.dmi' - icon_state = "doorctrl0" + icon = 'icons/obj/machines/buttons.dmi' + icon_state = "button" var/id /obj/machinery/line_nexter_control/attack_hand(mob/living/user) @@ -44,11 +44,9 @@ if(istype(user,/mob/living/carbon/xenomorph)) return - icon_state = "doorctrl1" + flick("button_on", src) for(var/obj/machinery/line_nexter/L in GLOB.machines) - if(id == L.id) - L.next() - - spawn(15) - icon_state = "doorctrl0" + if(id != L.id) + continue + L.next() diff --git a/code/game/objects/machinery/practice/medical.dm b/code/game/objects/machinery/practice/medical.dm index f09f0764a1f..2a2d4ac8441 100644 --- a/code/game/objects/machinery/practice/medical.dm +++ b/code/game/objects/machinery/practice/medical.dm @@ -2,16 +2,22 @@ name = "Practice Button (Surgery)" desc = "A button used to simulate situations for training purposes." icon = 'icons/obj/machines/buttons.dmi' - icon_state = "doorctrl" + icon_state = "door" resistance_flags = RESIST_ALL var/mob/living/carbon/human/humanspawned = null -/obj/machinery/practice/medical/surgery/Initialize(mapload, ndir = 0) +/obj/machinery/practice/medical/surgery/Initialize(mapload) . = ..() - setDir(ndir) - pixel_x = ( (dir & 3) ? 0 : (dir == 4 ? -24 : 24) ) - pixel_y = ( (dir & 3) ? (dir == 1 ? -24 : 24) : 0 ) - update_icon() + + switch(dir) + if(NORTH) + pixel_y = -24 + if(SOUTH) + pixel_y = 24 + if(EAST) + pixel_x = -24 + if(WEST) + pixel_x = 24 /obj/machinery/practice/medical/surgery/attack_hand(mob/living/user) if(user.a_intent == INTENT_HARM) diff --git a/code/game/objects/machinery/scoreboard.dm b/code/game/objects/machinery/scoreboard.dm index e47cb74d3cf..a06cff9d500 100644 --- a/code/game/objects/machinery/scoreboard.dm +++ b/code/game/objects/machinery/scoreboard.dm @@ -48,14 +48,14 @@ /obj/machinery/scoreboard_button name = "scoreboard button" desc = "A remote control button to reset a scoreboard." - icon = 'icons/obj/objects.dmi' - icon_state = "launcherbtt" - var/id = null - var/active = 0 + icon = 'icons/obj/machines/buttons.dmi' + icon_state = "launcher" anchored = TRUE use_power = IDLE_POWER_USE idle_power_usage = 2 active_power_usage = 4 + var/id = null + var/active = 0 /obj/machinery/scoreboard_button/attack_hand(mob/living/user) . = ..() @@ -69,7 +69,7 @@ use_power(active_power_usage) active = 1 - icon_state = "launcheract" + icon_state = "launcher_on" for(var/obj/machinery/scoreboard/X in GLOB.machines) if(X.id == id) @@ -77,6 +77,6 @@ sleep(5 SECONDS) - icon_state = "launcherbtt" + icon_state = "launcher" active = 0 diff --git a/code/modules/shuttle/marine_dropship.dm b/code/modules/shuttle/marine_dropship.dm index b1c25ff5e17..b4213f0f7ee 100644 --- a/code/modules/shuttle/marine_dropship.dm +++ b/code/modules/shuttle/marine_dropship.dm @@ -818,36 +818,18 @@ D.right_airlocks += src /obj/machinery/door_control/dropship - var/obj/docking_port/mobile/marine_dropship/D req_one_access = list(ACCESS_MARINE_BRIG, ACCESS_MARINE_DROPSHIP) pixel_y = -19 name = "Dropship Lockdown" + var/obj/docking_port/mobile/marine_dropship/D /obj/machinery/door_control/dropship/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override) . = ..() D = port -/obj/machinery/door_control/dropship/attack_hand(mob/living/user) - . = ..() - if(isxeno(user)) - return - if(!is_operational()) - to_chat(user, span_warning("[src] doesn't seem to be working.")) - return - - if(!allowed(user)) - to_chat(user, span_warning("Access Denied")) - flick("doorctrl-denied",src) - return - - use_power(5) - pressed = TRUE - update_icon() - +/obj/machinery/door_control/dropship/on_press() D.lockdown_all() - addtimer(CALLBACK(src, PROC_REF(unpress)), 15, TIMER_OVERRIDE|TIMER_UNIQUE) - // half-tile structure pieces /obj/structure/dropship_piece icon = 'icons/obj/structures/dropship_structures.dmi' diff --git a/icons/obj/machines/buttons.dmi b/icons/obj/machines/buttons.dmi index 5b8b2f2d168..f667b6dc5ac 100644 Binary files a/icons/obj/machines/buttons.dmi and b/icons/obj/machines/buttons.dmi differ diff --git a/icons/obj/objects.dmi b/icons/obj/objects.dmi index 36f4ff999fd..551ab5ccd52 100644 Binary files a/icons/obj/objects.dmi and b/icons/obj/objects.dmi differ diff --git a/icons/obj/stationobjs.dmi b/icons/obj/stationobjs.dmi index 60a24c57a0c..e34db7aff80 100644 Binary files a/icons/obj/stationobjs.dmi and b/icons/obj/stationobjs.dmi differ