[MIRROR] adds a variable to let computer keyboards render the same icon off as on [MDB IGNORE] (#18164)

* adds a variable to let computer keyboards render the same icon off as on (#72001)

## About The Pull Request
what the title says
also makes the code better a bit

## Why It's Good For The Game
i need this for my map

## Changelog

doesnt affect players

* adds a variable to let computer keyboards render the same icon off as on

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-12-15 21:07:45 +01:00
committed by GitHub
parent 7d7eabb751
commit 3cac3f1ca4
2 changed files with 13 additions and 9 deletions
+12 -8
View File
@@ -7,20 +7,24 @@
integrity_failure = 0.5
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 40, ACID = 20)
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE|INTERACT_MACHINE_REQUIRES_LITERACY
/// How bright we are when turned on.
var/brightness_on = 1
/// Icon_state of the keyboard overlay.
var/icon_keyboard = "generic_key"
/// Should we render an unique icon for the keyboard when off?
var/keyboard_change_icon = TRUE
/// Icon_state of the emissive screen overlay.
var/icon_screen = "generic"
var/time_to_screwdrive = 20
var/authenticated = 0
/// Time it takes to deconstruct with a screwdriver.
var/time_to_unscrew = 2 SECONDS
/// Are we authenticated to use this? Used by things like comms console, security and medical data, and apc controller.
var/authenticated = FALSE
/obj/machinery/computer/Initialize(mapload, obj/item/circuitboard/C)
. = ..()
power_change()
/obj/machinery/computer/Destroy()
. = ..()
/obj/machinery/computer/process()
if(machine_stat & (NOPOWER|BROKEN))
return FALSE
@@ -29,12 +33,11 @@
/obj/machinery/computer/update_overlays()
. = ..()
if(icon_keyboard)
if(machine_stat & NOPOWER)
if(keyboard_change_icon && (machine_stat & NOPOWER))
. += "[icon_keyboard]_off"
else
. += icon_keyboard
// This whole block lets screens ignore lighting and be visible even in the darkest room
if(machine_stat & BROKEN)
. += mutable_appearance(icon, "[icon_state]_broken")
return // If we don't do this broken computers glow in the dark.
@@ -42,6 +45,7 @@
if(machine_stat & NOPOWER) // Your screen can't be on if you've got no damn charge
return
// This lets screens ignore lighting and be visible even in the darkest room
if(icon_screen)
. += mutable_appearance(icon, icon_screen)
. += emissive_appearance(icon, icon_screen, src)
@@ -58,7 +62,7 @@
return TRUE
if(circuit && !(flags_1&NODECONSTRUCT_1))
to_chat(user, span_notice("You start to disconnect the monitor..."))
if(I.use_tool(src, user, time_to_screwdrive, volume=50))
if(I.use_tool(src, user, time_to_unscrew, volume=50))
deconstruct(TRUE, user)
return TRUE
+1 -1
View File
@@ -3,7 +3,7 @@
/obj/machinery/computer/upload
var/mob/living/silicon/current = null //The target of future law uploads
icon_screen = "command"
time_to_screwdrive = 60
time_to_unscrew = 6 SECONDS
/obj/machinery/computer/upload/Initialize(mapload)
. = ..()