mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Port current /tg/ lighting system
This commit is contained in:
@@ -72,22 +72,34 @@
|
||||
/obj/item/modular_computer/update_icon()
|
||||
icon_state = icon_state_unpowered
|
||||
|
||||
overlays.Cut()
|
||||
cut_overlays()
|
||||
|
||||
. = list()
|
||||
|
||||
if(bsod)
|
||||
overlays += image(icon = overlay_icon, icon_state = "bsod")
|
||||
return
|
||||
. += mutable_appearance(overlay_icon, "bsod")
|
||||
. += emissive_appearance(overlay_icon, "bsod")
|
||||
return add_overlay(.)
|
||||
if(!enabled)
|
||||
if(icon_state_screensaver)
|
||||
overlays += image(icon = overlay_icon, icon_state = icon_state_screensaver)
|
||||
. += mutable_appearance(overlay_icon, icon_state_screensaver)
|
||||
. += emissive_appearance(overlay_icon, icon_state_screensaver)
|
||||
set_light(0)
|
||||
return
|
||||
return add_overlay(.)
|
||||
|
||||
set_light(light_strength)
|
||||
|
||||
if(active_program)
|
||||
overlays += image(icon = overlay_icon, icon_state = active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu)
|
||||
var/program_state = active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu
|
||||
. += mutable_appearance(overlay_icon, program_state)
|
||||
. += emissive_appearance(overlay_icon, program_state)
|
||||
if(active_program.program_key_state)
|
||||
overlays += image(icon = overlay_icon, icon_state = active_program.program_key_state)
|
||||
. += mutable_appearance(overlay_icon, active_program.program_key_state)
|
||||
else
|
||||
overlays += image(icon = overlay_icon, icon_state = icon_state_menu)
|
||||
. += mutable_appearance(overlay_icon, icon_state_menu)
|
||||
. += emissive_appearance(overlay_icon, icon_state_menu)
|
||||
|
||||
return add_overlay(.)
|
||||
|
||||
/obj/item/modular_computer/proc/turn_on(var/mob/user)
|
||||
if(bsod)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
// If you create a program which is limited to Laptops and Consoles you don't have to add it's icon_state overlay for Tablets too, for example.
|
||||
|
||||
icon = null // This thing isn't meant to be used on it's own. Subtypes should supply their own icon.
|
||||
blocks_emissive = FALSE
|
||||
var/overlay_icon = null // Icon file used for overlays
|
||||
icon_state = null
|
||||
center_of_mass = null // No pixelshifting by placing on tables, etc.
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
if(anchored)
|
||||
..()
|
||||
else
|
||||
overlays.Cut()
|
||||
cut_overlays()
|
||||
set_light(0) // No glow from closed laptops
|
||||
icon_state = icon_state_closed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user