From 3cac3f1ca45d15d69a7fb5036645ccee4ee652c9 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 15 Dec 2022 21:07:45 +0100 Subject: [PATCH] [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> --- code/game/machinery/computer/_computer.dm | 20 ++++++++++++-------- code/game/machinery/computer/law.dm | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm index 6cd3f95e14f..540e9a78ad0 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -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 diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index f554b64f967..423633d31ac 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -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) . = ..()