[MIRROR] Button sprite refactor [MDB IGNORE] (#21309)

* Button sprite refactor

* remove skyrat override

* Update dungeon.dmi

* Update dungeon.dm

---------

Co-authored-by: Andrew <mt.forspam@gmail.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-05-21 23:03:35 -07:00
committed by GitHub
co-authored by Andrew lessthanthree
parent d4e86c1255
commit 326d27d86c
11 changed files with 65 additions and 56 deletions
+56 -45
View File
@@ -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
@@ -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)
. = ..()
@@ -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
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

@@ -1,3 +0,0 @@
/obj/machinery/button
icon = 'modular_skyrat/modules/aesthetics/buttons/icons/buttons.dmi'
light_mask = "button-light-mask"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

@@ -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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

-1
View File
@@ -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"