diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index 20bdc18e560..737b01cb33a 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -1,9 +1,13 @@ /obj/machinery/button name = "button" desc = "A remote control switch." - icon = 'icons/obj/stationobjs.dmi'//ICON OVERRIDEN IN SKYRAT AESTHETICS - SEE MODULE - icon_state = "doorctrl" - var/skin = "doorctrl" + icon = 'icons/obj/buttons.dmi' + base_icon_state = "button" + icon_state = "button" + ///Icon suffix for the skin of the front pannel that is added to base_icon_state + var/skin = "" + ///Whether it is possible to change the panel skin + var/can_alter_skin = TRUE power_channel = AREA_USAGE_ENVIRON var/obj/item/assembly/device var/obj/item/electronics/airlock/board @@ -11,11 +15,9 @@ var/id = null var/initialized_button = 0 var/silicon_access_disabled = FALSE - ///The light mask used in the icon file for emissive layer - var/light_mask = null light_power = 0.5 // Minimums, we want the button to glow if it has a mask, not light an area light_range = 1.5 - light_color = LIGHT_COLOR_DARK_BLUE + light_color = LIGHT_COLOR_VIVID_GREEN armor_type = /datum/armor/machinery_button idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 0.02 resistance_flags = LAVA_PROOF | FIRE_PROOF @@ -60,33 +62,42 @@ return ..() /obj/machinery/button/update_icon_state() + icon_state = "[base_icon_state][skin]" if(panel_open) - icon_state = "button-open" - return ..() - if(machine_stat & (NOPOWER|BROKEN)) - icon_state = "[skin]-p" - return ..() - icon_state = skin + icon_state += "-open" + else if(machine_stat & (NOPOWER|BROKEN)) + icon_state += "-nopower" return ..() +/obj/machinery/button/update_appearance() + . = ..() + + if(panel_open || (machine_stat & (NOPOWER|BROKEN))) + set_light(0) + else + set_light(initial(light_range), light_power, light_color) + /obj/machinery/button/update_overlays() . = ..() - if(light_mask && !(machine_stat & (NOPOWER|BROKEN)) && !panel_open) - . += emissive_appearance(icon, light_mask, src, alpha = alpha) - if(!panel_open) - return - if(device) - . += "button-device" - if(board) - . += "button-board" + + if(panel_open && board) + . += "[base_icon_state]-overlay-board" + if(panel_open && device) + if(istype(device, /obj/item/assembly/signaler)) + . += "[base_icon_state]-overlay-signaler" + else + . += "[base_icon_state]-overlay-device" + + if(!(machine_stat & (NOPOWER|BROKEN)) && !panel_open) + . += emissive_appearance(icon, "[base_icon_state]-light-mask", src, alpha = src.alpha) /obj/machinery/button/screwdriver_act(mob/living/user, obj/item/tool) if(panel_open || allowed(user)) - default_deconstruction_screwdriver(user, "button-open", "[skin]", tool) + default_deconstruction_screwdriver(user, "[base_icon_state][skin]-open", "[base_icon_state][skin]", tool) update_appearance() else - to_chat(user, span_alert("Maintenance Access Denied.")) - flick("[skin]-denied", src) + balloon_alert(user, "access denied") + flick_overlay_view("[base_icon_state]-overlay-error", 1 SECONDS) return TRUE @@ -189,17 +200,19 @@ req_access = list() req_one_access = list() board = null - update_appearance() + update_appearance(UPDATE_ICON) balloon_alert(user, "electronics removed") to_chat(user, span_notice("You remove electronics from the button frame.")) - else - if(skin == "doorctrl") - skin = "launcher" + else if(can_alter_skin) + if(skin == "") + skin = "-warning" + to_chat(user, span_notice("You change the button frame's front panel to warning lines.")) else - skin = "doorctrl" - balloon_alert(user, "swapped button style") - to_chat(user, span_notice("You change the button frame's front panel.")) + skin = "" + to_chat(user, span_notice("You change the button frame's front panel to default.")) + update_appearance(UPDATE_ICON) + balloon_alert(user, "swapped style") return if((machine_stat & (NOPOWER|BROKEN))) @@ -209,19 +222,17 @@ return if(!allowed(user)) - to_chat(user, span_alert("Access Denied.")) - flick("[skin]-denied", src) + balloon_alert(user, "access denied") + flick_overlay_view("[base_icon_state]-overlay-error", 1 SECONDS) return use_power(5) - icon_state = "[skin]1" + flick_overlay_view("[base_icon_state]-overlay-success", 1 SECONDS) if(device) device.pulsed(user) SEND_GLOBAL_SIGNAL(COMSIG_GLOB_BUTTON_PRESSED,src) - addtimer(CALLBACK(src, TYPE_PROC_REF(/atom/, update_appearance)), 15) - /obj/machinery/button/door name = "door button" desc = "A door remote control switch." @@ -284,8 +295,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/button/door, 24) /obj/machinery/button/massdriver name = "mass driver button" desc = "A remote control switch for a mass driver." - icon_state = "launcher" - skin = "launcher" + icon_state= "button-warning" + skin = "-warning" device_type = /obj/item/assembly/control/massdriver /obj/machinery/button/massdriver/indestructible @@ -294,8 +305,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/button/door, 24) /obj/machinery/button/ignition name = "ignition switch" desc = "A remote control switch for a mounted igniter." - icon_state = "launcher" - skin = "launcher" + icon_state= "button-warning" + skin = "-warning" device_type = /obj/item/assembly/control/igniter /obj/machinery/button/ignition/indestructible @@ -317,8 +328,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/button/door, 24) /obj/machinery/button/flasher name = "flasher button" desc = "A remote control switch for a mounted flasher." - icon_state = "launcher" - skin = "launcher" + icon_state= "button-warning" + skin = "-warning" device_type = /obj/item/assembly/control/flasher /obj/machinery/button/flasher/indestructible @@ -327,8 +338,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/button/door, 24) /obj/machinery/button/curtain name = "curtain button" desc = "A remote control switch for a mechanical curtain." - icon_state = "launcher" - skin = "launcher" + icon_state= "button-warning" + skin = "-warning" device_type = /obj/item/assembly/control/curtain var/sync_doors = TRUE @@ -340,8 +351,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/button/door, 24) /obj/machinery/button/crematorium name = "crematorium igniter" desc = "Burn baby burn!" - icon_state = "launcher" - skin = "launcher" + icon_state= "button-warning" + skin = "-warning" device_type = /obj/item/assembly/control/crematorium req_access = list() id = 1 diff --git a/code/modules/industrial_lift/elevator/elevator_controller.dm b/code/modules/industrial_lift/elevator/elevator_controller.dm index 3e7fa510a10..41c845c4ef9 100644 --- a/code/modules/industrial_lift/elevator/elevator_controller.dm +++ b/code/modules/industrial_lift/elevator/elevator_controller.dm @@ -1,12 +1,13 @@ /obj/machinery/button/elevator name = "elevator button" desc = "Go back. Go back. Go back. Can you operate the elevator." - icon_state = "hallctrl" - skin = "hallctrl" + base_icon_state = "tram" + icon_state = "tram" + can_alter_skin = FALSE + light_color = LIGHT_COLOR_DARK_BLUE device_type = /obj/item/assembly/control/elevator req_access = list() id = 1 - light_mask = "hall-light-mask" /obj/machinery/button/elevator/Initialize(mapload, ndir, built) . = ..() diff --git a/code/modules/industrial_lift/tram/tram_machinery.dm b/code/modules/industrial_lift/tram/tram_machinery.dm index d16f6e8aad9..2c49ff42f8a 100644 --- a/code/modules/industrial_lift/tram/tram_machinery.dm +++ b/code/modules/industrial_lift/tram/tram_machinery.dm @@ -721,12 +721,13 @@ GLOBAL_LIST_EMPTY(tram_doors) /obj/machinery/button/tram name = "tram request" desc = "A button for calling the tram. It has a speakerbox in it with some internals." - icon_state = "tramctrl" - skin = "tramctrl" + base_icon_state = "tram" + icon_state = "tram" + light_color = LIGHT_COLOR_DARK_BLUE + can_alter_skin = FALSE device_type = /obj/item/assembly/control/tram req_access = list() id = 1 - light_mask = "tram-light-mask" /// The specific lift id of the tram we're calling. var/lift_id = MAIN_STATION_TRAM diff --git a/icons/obj/buttons.dmi b/icons/obj/buttons.dmi new file mode 100644 index 00000000000..98d7e3edeb9 Binary files /dev/null and b/icons/obj/buttons.dmi differ diff --git a/icons/obj/stationobjs.dmi b/icons/obj/stationobjs.dmi index baa98d4e66a..0cda9735d98 100644 Binary files a/icons/obj/stationobjs.dmi and b/icons/obj/stationobjs.dmi differ diff --git a/icons/obj/wallframe.dmi b/icons/obj/wallframe.dmi index 9d43fdbdc72..2fec99c42be 100644 Binary files a/icons/obj/wallframe.dmi and b/icons/obj/wallframe.dmi differ diff --git a/modular_skyrat/modules/aesthetics/buttons/code/buttons.dm b/modular_skyrat/modules/aesthetics/buttons/code/buttons.dm deleted file mode 100644 index a005f614574..00000000000 --- a/modular_skyrat/modules/aesthetics/buttons/code/buttons.dm +++ /dev/null @@ -1,3 +0,0 @@ -/obj/machinery/button - icon = 'modular_skyrat/modules/aesthetics/buttons/icons/buttons.dmi' - light_mask = "button-light-mask" diff --git a/modular_skyrat/modules/aesthetics/buttons/icons/buttons.dmi b/modular_skyrat/modules/aesthetics/buttons/icons/buttons.dmi deleted file mode 100644 index ddc942ee999..00000000000 Binary files a/modular_skyrat/modules/aesthetics/buttons/icons/buttons.dmi and /dev/null differ diff --git a/modular_skyrat/modules/mapping/code/dungeon.dm b/modular_skyrat/modules/mapping/code/dungeon.dm index 4cab2cb4607..cae78da39ac 100644 --- a/modular_skyrat/modules/mapping/code/dungeon.dm +++ b/modular_skyrat/modules/mapping/code/dungeon.dm @@ -114,8 +114,8 @@ name = "stone brick" desc = "A brick that's stuck out of the wall. Huh." icon = 'modular_skyrat/modules/mapping/icons/unique/dungeon.dmi' + base_icon_state = "doorctrl" icon_state = "doorctrl" - light_mask = null power_channel = AREA_USAGE_ENVIRON use_power = NO_POWER_USE idle_power_usage = 0 diff --git a/modular_skyrat/modules/mapping/icons/unique/dungeon.dmi b/modular_skyrat/modules/mapping/icons/unique/dungeon.dmi index c9c32682bdb..9804df5acf7 100644 Binary files a/modular_skyrat/modules/mapping/icons/unique/dungeon.dmi and b/modular_skyrat/modules/mapping/icons/unique/dungeon.dmi differ diff --git a/tgstation.dme b/tgstation.dme index e570fe80390..1ca233f7f5b 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5620,7 +5620,6 @@ #include "modular_skyrat\modules\aesthetics\apc\code\apc.dm" #include "modular_skyrat\modules\aesthetics\blast_door\code\blast_door.dm" #include "modular_skyrat\modules\aesthetics\bureaucracy\bureaucracy.dm" -#include "modular_skyrat\modules\aesthetics\buttons\code\buttons.dm" #include "modular_skyrat\modules\aesthetics\camera\code\camera.dm" #include "modular_skyrat\modules\aesthetics\cells\cell.dm" #include "modular_skyrat\modules\aesthetics\chemical_tanks\chemical_tanks.dm"