Skip to content

Commit

Permalink
make computer glow brighter and match screen color (#27484)
Browse files Browse the repository at this point in the history
  • Loading branch information
warriorstar-orion authored Dec 7, 2024
1 parent 35b2b48 commit ffe23af
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions code/game/machinery/computer/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
var/obj/item/circuitboard/circuit = null //if circuit==null, computer can't disassembly
var/icon_keyboard = "generic_key"
var/icon_screen = "generic"
var/light_range_on = 1
var/light_power_on = 0.7
var/light_range_on = 2
var/light_power_on = 0.9
/// Are we in the middle of a flicker event?
var/flickering = FALSE
/// Are we forcing the icon to be represented in a no-power state?
Expand Down Expand Up @@ -86,6 +86,14 @@
. += "[icon_keyboard]"
underlays += emissive_appearance(icon, "[icon_keyboard]_lightmask")

if(!(stat & BROKEN))
// Get the average color of the computer screen so it can be used as a tinted glow
// Shamelessly stolen from /tg/'s /datum/component/customizable_reagent_holder.
var/icon/emissive_avg_screen_color = new(icon, overlay_state)
emissive_avg_screen_color.Scale(1, 1)
var/screen_emissive_color = copytext(emissive_avg_screen_color.GetPixel(1, 1), 1, 8) // remove opacity
set_light(light_range_on, light_power_on, screen_emissive_color)

/obj/machinery/computer/power_change()
. = ..() //we don't check parent return due to this also being contigent on the BROKEN stat flag
if((stat & (BROKEN|NOPOWER)))
Expand Down

0 comments on commit ffe23af

Please sign in to comment.