Ok, done.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
var/icon_state_unpowered = null // Icon state when the computer is turned off.
|
||||
var/icon_state_powered = null // Icon state when the computer is turned on.
|
||||
var/icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
|
||||
var/display_overlays = TRUE // If FALSE, don't draw overlays on this device at all
|
||||
var/max_hardware_size = 0 // Maximal hardware w_class. Tablets/PDAs have 1, laptops 2, consoles 4.
|
||||
var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer.
|
||||
|
||||
@@ -208,20 +209,26 @@
|
||||
else if(obj_integrity < max_integrity)
|
||||
. += "<span class='warning'>It is damaged.</span>"
|
||||
|
||||
/obj/item/modular_computer/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/modular_computer/update_icon_state()
|
||||
if(!enabled)
|
||||
icon_state = icon_state_unpowered
|
||||
else
|
||||
icon_state = icon_state_powered
|
||||
|
||||
|
||||
/obj/item/modular_computer/update_overlays()
|
||||
. = ..()
|
||||
if(!display_overlays)
|
||||
return
|
||||
if(enabled)
|
||||
if(active_program)
|
||||
add_overlay(active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu)
|
||||
. += active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu
|
||||
else
|
||||
add_overlay(icon_state_menu)
|
||||
. += icon_state_menu
|
||||
|
||||
if(obj_integrity <= integrity_failure * max_integrity)
|
||||
add_overlay("bsod")
|
||||
add_overlay("broken")
|
||||
. += "bsod"
|
||||
. += "broken"
|
||||
|
||||
|
||||
// On-click handling. Turns on the computer if it's off and opens the GUI.
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
screen_on = 0 // Starts closed
|
||||
var/start_open = TRUE // unless this var is set to 1
|
||||
var/icon_state_closed = "laptop-closed"
|
||||
display_overlays = FALSE
|
||||
var/w_class_open = WEIGHT_CLASS_BULKY
|
||||
|
||||
/obj/item/modular_computer/laptop/examine(mob/user)
|
||||
@@ -31,12 +32,11 @@
|
||||
if(start_open && !screen_on)
|
||||
toggle_open()
|
||||
|
||||
/obj/item/modular_computer/laptop/update_icon()
|
||||
if(screen_on)
|
||||
..()
|
||||
else
|
||||
cut_overlays()
|
||||
/obj/item/modular_computer/laptop/update_icon_state()
|
||||
if(!screen_on)
|
||||
icon_state = icon_state_closed
|
||||
else
|
||||
. = ..()
|
||||
|
||||
/obj/item/modular_computer/laptop/attack_self(mob/user)
|
||||
if(!screen_on)
|
||||
@@ -97,6 +97,7 @@
|
||||
w_class = w_class_open
|
||||
|
||||
screen_on = !screen_on
|
||||
display_overlays = screen_on
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
machinery_computer.cpu = null
|
||||
machinery_computer = null
|
||||
|
||||
/obj/item/modular_computer/processor/New(comp)
|
||||
/obj/item/modular_computer/processor/Initialize(mapload)
|
||||
. = ..()
|
||||
if(!comp || !istype(comp, /obj/machinery/modular_computer))
|
||||
if(!loc || !istype(loc, /obj/machinery/modular_computer))
|
||||
CRASH("Inapropriate type passed to obj/item/modular_computer/processor/New()! Aborting.")
|
||||
return
|
||||
// Obtain reference to machinery computer
|
||||
all_components = list()
|
||||
idle_threads = list()
|
||||
machinery_computer = comp
|
||||
machinery_computer = loc
|
||||
machinery_computer.cpu = src
|
||||
hardware_flag = machinery_computer.hardware_flag
|
||||
max_hardware_size = machinery_computer.max_hardware_size
|
||||
@@ -34,14 +34,11 @@
|
||||
integrity_failure = machinery_computer.integrity_failure
|
||||
base_active_power_usage = machinery_computer.base_active_power_usage
|
||||
base_idle_power_usage = machinery_computer.base_idle_power_usage
|
||||
machinery_computer.RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, /atom/proc/update_icon) //when we update_icon, also update the computer
|
||||
|
||||
/obj/item/modular_computer/processor/relay_qdel()
|
||||
qdel(machinery_computer)
|
||||
|
||||
/obj/item/modular_computer/processor/update_icon()
|
||||
if(machinery_computer)
|
||||
return machinery_computer.update_icon()
|
||||
|
||||
// This thing is not meant to be used on it's own, get topic data from our machinery owner.
|
||||
//obj/item/modular_computer/processor/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
|
||||
// if(!machinery_computer)
|
||||
|
||||
@@ -15,14 +15,11 @@
|
||||
var/has_variants = TRUE
|
||||
var/finish_color = null
|
||||
|
||||
/obj/item/modular_computer/tablet/update_icon()
|
||||
..()
|
||||
/obj/item/modular_computer/tablet/update_icon_state()
|
||||
if(has_variants)
|
||||
if(!finish_color)
|
||||
finish_color = pick("red","blue","brown","green","black")
|
||||
icon_state = "tablet-[finish_color]"
|
||||
icon_state_unpowered = "tablet-[finish_color]"
|
||||
icon_state_powered = "tablet-[finish_color]"
|
||||
icon_state = icon_state_powered = icon_state_unpowered = "tablet-[finish_color]"
|
||||
|
||||
/obj/item/modular_computer/tablet/syndicate_contract_uplink
|
||||
name = "contractor tablet"
|
||||
|
||||
@@ -48,26 +48,28 @@
|
||||
if(cpu)
|
||||
. |= cpu.emag_act(user)
|
||||
|
||||
/obj/machinery/modular_computer/update_icon()
|
||||
cut_overlays()
|
||||
icon_state = icon_state_powered
|
||||
/obj/machinery/modular_computer/update_icon_state()
|
||||
if(cpu?.enabled)
|
||||
icon_state = icon_state_powered
|
||||
else if(stat & NOPOWER || !(cpu?.use_power()))
|
||||
icon_state = icon_state_unpowered
|
||||
|
||||
/obj/machinery/modular_computer/update_overlays()
|
||||
. = ..()
|
||||
if(!cpu || !cpu.enabled)
|
||||
if (!(stat & NOPOWER) && (cpu && cpu.use_power()))
|
||||
add_overlay(screen_icon_screensaver)
|
||||
else
|
||||
icon_state = icon_state_unpowered
|
||||
. += screen_icon_screensaver
|
||||
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)
|
||||
. += cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu
|
||||
else
|
||||
add_overlay(screen_icon_state_menu)
|
||||
. += screen_icon_state_menu
|
||||
|
||||
if(cpu && cpu.obj_integrity <= cpu.integrity_failure * cpu.max_integrity)
|
||||
add_overlay("bsod")
|
||||
add_overlay("broken")
|
||||
. += "bsod"
|
||||
. += "broken"
|
||||
|
||||
// Eject ID card from computer, if it has ID slot with card inside.
|
||||
/obj/machinery/modular_computer/proc/eject_id()
|
||||
|
||||
Reference in New Issue
Block a user