Files
Bubberstation/code/modules/modular_computers/file_system/programs/configurator.dm
John Willard f1f46275f0 Removes tablet hard drives entirely (HDD & SSD) (#70678)
* Removes HDD's entirely

HDDs have been removed, though the code for it is still currently lingering as it's required for portable disks. I'll have to find a solution to this one day, but as I am going to sleep, this is a problem for future me.

* starts on removing SSD

* updatepaths and kills off SSD

* update path :D

* Fixes to programs and icons

* Ready for review now

I read over everything I did and tried to fix anything I saw wasn't done right. Hopefully better comments now.

* merge conflict  fix

* can't win them all

* takes viruses into account in paths, fixes it in snowcabin

* Renames the updatepaths

* removes the qdel loop

* accidentally new'ed programs twice

* Fix program's computer var

* destroy pen and disk, dont run kill program on something killed

* more fixes for pens and idle threads

* Fixes PDAs installing apps twice.

* simplifies inserted disk & PDA disk

* fuck's sake

* Use istype instead

* revert

* Revert "revert"

This reverts commit 9ede628c6fef9c7c86417234f6d8ada1ff9e2fef.

* why did that happen

* Update code/modules/modular_computers/computers/item/tablet.dm

* MC_SSD added to master lol

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
2022-10-26 00:29:50 +00:00

62 lines
1.8 KiB
Plaintext

// This is special hardware configuration program.
// It is to be used only with modular computers.
// It allows you to toggle components of your device.
/datum/computer_file/program/computerconfig
filename = "compconfig"
filedesc = "Hardware Configuration Tool"
extended_desc = "This program allows configuration of computer's hardware"
program_icon_state = "generic"
undeletable = TRUE
size = 4
available_on_ntnet = FALSE
requires_ntnet = FALSE
tgui_id = "NtosConfiguration"
program_icon = "cog"
/datum/computer_file/program/computerconfig/ui_data(mob/user)
// No computer connection, we can't get data from that.
if(!computer)
return 0
var/obj/item/computer_hardware/battery/battery_module = computer.all_components[MC_CELL]
var/list/data = get_header_data()
data["disk_size"] = computer.max_capacity
data["disk_used"] = computer.used_capacity
data["power_usage"] = computer.last_power_usage
data["battery_exists"] = battery_module ? 1 : 0
if(battery_module?.battery)
data["battery_rating"] = battery_module.battery.maxcharge
data["battery_percent"] = round(battery_module.battery.percent())
if(battery_module?.battery)
data["battery"] = list("max" = battery_module.battery.maxcharge, "charge" = round(battery_module.battery.charge))
var/list/all_entries[0]
for(var/I in computer.all_components)
var/obj/item/computer_hardware/H = computer.all_components[I]
all_entries.Add(list(list(
"name" = H.name,
"desc" = H.desc,
"enabled" = H.enabled,
"critical" = H.critical,
"powerusage" = H.power_usage
)))
data["hardware"] = all_entries
return data
/datum/computer_file/program/computerconfig/ui_act(action,params)
. = ..()
if(.)
return
switch(action)
if("PC_toggle_component")
var/obj/item/computer_hardware/H = computer.find_hardware_by_name(params["name"])
if(H && istype(H))
H.enabled = !H.enabled
. = TRUE