Adds the overlay changes (#12843)

Makes program overlays glow in the dark, unifies overlay code, and adds a system for adding program overlay skins
This commit is contained in:
nmajask
2021-12-11 11:24:26 -05:00
committed by GitHub
parent 5757959b28
commit 5734b61013
5 changed files with 40 additions and 37 deletions

View File

@@ -19,6 +19,7 @@
var/icon_state_powered = null // Icon state when the computer is turned on.
var/screen_icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
var/screen_icon_screensaver = "standby" // Icon state overlay when the computer is powered, but not 'switched on'.
var/overlay_skin = null
var/max_hardware_size = 0 // Maximal hardware size. Currently, tablets have 1, laptops 2 and consoles 3. Limits what hardware types can be installed.
var/steel_sheet_cost = 10 // Amount of steel sheets refunded when disassembling an empty frame of this computer.
var/light_strength = 0 // Light luminosity when turned on
@@ -54,26 +55,7 @@
return (cpu.emag_act(user))
/obj/machinery/modular_computer/update_icon()
cut_overlays()
icon_state = icon_state_powered
if(!cpu || !cpu.enabled)
if (!(stat & NOPOWER) && (cpu && cpu.use_power()))
add_overlay(screen_icon_screensaver)
else
icon_state = icon_state_unpowered
set_light(0)
else
set_light(light_strength)
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")
cpu.update_icon()
/obj/machinery/modular_computer/AltClick(mob/user)
if(cpu)