Merge pull request #1 from Karolis2011/modular-computers

Modular console
This commit is contained in:
atlantiscze
2015-07-05 08:48:05 +02:00
5 changed files with 35 additions and 2 deletions
@@ -54,10 +54,12 @@
/obj/machinery/modular_computer/
name = "laptop computer"
desc = "A portable computer."
var/open = 1 // Whether the laptop is open.
var/enabled = 1 // Whether the laptop is turned on.
var/datum/computer_file/program/active_program = null // A currently active program running on the computer.
var/obj/item/laptop/portable = null // Portable version of this computer, dropped on alt-click to allow transport. Used by laptops.
var/battery_powered = 1 // Whether computer shuold be battery powered.
use_power = 0
icon = 'icons/obj/computer3.dmi'
@@ -254,9 +256,11 @@
else
data["PC_batteryicon"] = "batt_5.gif"
data["PC_batterypercent"] = "[round(battery.percent())] %"
data["PC_showbatteryicon"] = 1
else // Computer without battery shouldn't work at all, but in case we implement computers without batteries in future that run solely on APC network, it's here.
data["PC_batteryicon"] = "batt_5.gif"
data["PC_batterypercent"] = "N/C"
data["PC_showbatteryicon"] = battery_powered
switch(get_ntnet_status())
if(0)
@@ -0,0 +1,28 @@
// Console itself
/obj/machinery/modular_computer/console/
name = "console"
desc = "A stationary computer."
enabled = 1
icon = 'icons/obj/computer3.dmi'
icon_state = "console"
icon_state_unpowered = "console"
icon_state_menu = "menu"
battery_powered = 0
anchored = 1
density = 1
/obj/machinery/modular_computer/console/New()
..()
battery = null
tesla_link.enabled = 1
/obj/machinery/modular_computer/console/update_icon()
icon_state = icon_state_unpowered
overlays.Cut()
if(!enabled)
return
if(active_program)
overlays.Add(active_program.laptop_icon_state ? active_program.laptop_icon_state : icon_state_menu)
else
overlays.Add(icon_state_menu)