mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-09 00:13:55 +00:00
* Harddel Fix Pack #42 + Better Live Reftracking Support * awooga Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
@@ -15,25 +15,19 @@
|
||||
tgui_id = "NtosConfiguration"
|
||||
program_icon = "cog"
|
||||
|
||||
var/obj/item/modular_computer/movable = null
|
||||
|
||||
|
||||
/datum/computer_file/program/computerconfig/ui_data(mob/user)
|
||||
movable = computer
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = movable.all_components[MC_HDD]
|
||||
var/obj/item/computer_hardware/battery/battery_module = movable.all_components[MC_CELL]
|
||||
if(!istype(movable))
|
||||
movable = null
|
||||
|
||||
// No computer connection, we can't get data from that.
|
||||
if(!movable)
|
||||
if(!computer)
|
||||
return 0
|
||||
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
var/obj/item/computer_hardware/battery/battery_module = computer.all_components[MC_CELL]
|
||||
|
||||
var/list/data = get_header_data()
|
||||
|
||||
data["disk_size"] = hard_drive.max_capacity
|
||||
data["disk_used"] = hard_drive.used_capacity
|
||||
data["power_usage"] = movable.last_power_usage
|
||||
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
|
||||
@@ -43,8 +37,8 @@
|
||||
data["battery"] = list("max" = battery_module.battery.maxcharge, "charge" = round(battery_module.battery.charge))
|
||||
|
||||
var/list/all_entries[0]
|
||||
for(var/I in movable.all_components)
|
||||
var/obj/item/computer_hardware/H = movable.all_components[I]
|
||||
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,
|
||||
@@ -63,7 +57,7 @@
|
||||
return
|
||||
switch(action)
|
||||
if("PC_toggle_component")
|
||||
var/obj/item/computer_hardware/H = movable.find_hardware_by_name(params["name"])
|
||||
var/obj/item/computer_hardware/H = computer.find_hardware_by_name(params["name"])
|
||||
if(H && istype(H))
|
||||
H.enabled = !H.enabled
|
||||
. = TRUE
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
var/download_completion = FALSE //GQ of downloaded data.
|
||||
var/download_netspeed = 0
|
||||
var/downloaderror = ""
|
||||
var/obj/item/modular_computer/my_computer = null
|
||||
var/emagged = FALSE
|
||||
var/list/main_repo
|
||||
var/list/antag_repo
|
||||
@@ -130,9 +129,7 @@
|
||||
return FALSE
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/ui_data(mob/user)
|
||||
my_computer = computer
|
||||
|
||||
if(!istype(my_computer))
|
||||
if(!istype(computer))
|
||||
return
|
||||
var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD]
|
||||
var/list/access = card_slot?.GetAccess()
|
||||
@@ -150,7 +147,7 @@
|
||||
data["downloadspeed"] = download_netspeed
|
||||
data["downloadcompletion"] = round(download_completion, 0.1)
|
||||
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = my_computer.all_components[MC_HDD]
|
||||
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
|
||||
data["disk_size"] = hard_drive.max_capacity
|
||||
data["disk_used"] = hard_drive.used_capacity
|
||||
data["emagged"] = emagged
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
program_icon = "plug"
|
||||
|
||||
var/has_alert = 0
|
||||
var/obj/structure/cable/attached_wire
|
||||
var/obj/machinery/power/apc/local_apc
|
||||
var/datum/weakref/attached_wire_ref
|
||||
var/datum/weakref/local_apc_ref
|
||||
var/list/history = list()
|
||||
var/record_size = 60
|
||||
var/record_interval = 50
|
||||
@@ -38,19 +38,22 @@
|
||||
|
||||
/datum/computer_file/program/power_monitor/proc/search() //keep in sync with /obj/machinery/computer/monitor's version
|
||||
var/turf/T = get_turf(computer)
|
||||
attached_wire = locate(/obj/structure/cable) in T
|
||||
if(attached_wire)
|
||||
attached_wire_ref = WEAKREF(locate(/obj/structure/cable) in T)
|
||||
if(attached_wire_ref)
|
||||
return
|
||||
var/area/A = get_area(computer) //if the computer isn't directly connected to a wire, attempt to find the APC powering it to pull it's powernet instead
|
||||
if(!A)
|
||||
return
|
||||
local_apc = A.apc
|
||||
var/obj/machinery/power/apc/local_apc = WEAKREF(A.apc)
|
||||
if(!local_apc)
|
||||
return
|
||||
if(!local_apc.terminal) //this really shouldn't happen without badminnery.
|
||||
local_apc = null
|
||||
local_apc_ref = WEAKREF(local_apc)
|
||||
|
||||
/datum/computer_file/program/power_monitor/proc/get_powernet() //keep in sync with /obj/machinery/computer/monitor's version
|
||||
var/obj/structure/cable/attached_wire = attached_wire_ref?.resolve()
|
||||
var/obj/machinery/power/apc/local_apc = local_apc_ref?.resolve()
|
||||
if(attached_wire || (local_apc?.terminal))
|
||||
return attached_wire ? attached_wire.powernet : local_apc.terminal.powernet
|
||||
return FALSE
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
program_icon = "robot"
|
||||
///Number of simple robots on-station.
|
||||
var/botcount = 0
|
||||
///Used to find the location of the user for the purposes of summoning robots.
|
||||
var/mob/current_user
|
||||
///Access granted by the used to summon robots.
|
||||
var/list/current_access = list()
|
||||
|
||||
@@ -33,12 +31,11 @@
|
||||
data["access_on_card"] = id_card ? id_card.access : null
|
||||
|
||||
botcount = 0
|
||||
current_user = user
|
||||
|
||||
for(var/mob/living/simple_animal/bot/simple_bot as anything in GLOB.bots_list)
|
||||
if(simple_bot.z != zlevel || !(simple_bot.bot_mode_flags & BOT_MODE_REMOTE_ENABLED)) //Only non-emagged bots on the same Z-level are detected!
|
||||
continue
|
||||
if(computer && !simple_bot.check_access(current_user)) // Only check Bots we can access)
|
||||
if(computer && !simple_bot.check_access(user)) // Only check Bots we can access)
|
||||
continue
|
||||
var/list/newbot = list(
|
||||
"name" = simple_bot.name,
|
||||
@@ -71,10 +68,11 @@
|
||||
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/robocontrol/ui_act(action, list/params)
|
||||
/datum/computer_file/program/robocontrol/ui_act(action, list/params, datum/tgui/ui)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
var/mob/current_user = ui.user
|
||||
var/obj/item/computer_hardware/card_slot/card_slot
|
||||
var/obj/item/card/id/id_card
|
||||
if(computer)
|
||||
|
||||
@@ -14,12 +14,6 @@
|
||||
size = 5
|
||||
tgui_id = "NtosRobotact"
|
||||
program_icon = "terminal"
|
||||
///A typed reference to the computer, specifying the borg tablet type
|
||||
var/obj/item/modular_computer/tablet/integrated/tablet
|
||||
|
||||
/datum/computer_file/program/robotact/Destroy()
|
||||
tablet = null
|
||||
return ..()
|
||||
|
||||
/datum/computer_file/program/robotact/run_program(mob/living/user)
|
||||
if(!istype(computer, /obj/item/modular_computer/tablet/integrated))
|
||||
@@ -27,7 +21,7 @@
|
||||
return FALSE
|
||||
. = ..()
|
||||
if(.)
|
||||
tablet = computer
|
||||
var/obj/item/modular_computer/tablet/integrated/tablet = computer
|
||||
if(tablet.device_theme == "syndicate")
|
||||
program_icon_state = "command-syndicate"
|
||||
return TRUE
|
||||
@@ -37,6 +31,10 @@
|
||||
var/list/data = get_header_data()
|
||||
if(!iscyborg(user))
|
||||
return data
|
||||
|
||||
//Implied, since we can't run on non tablets
|
||||
var/obj/item/modular_computer/tablet/integrated/tablet = computer
|
||||
|
||||
var/mob/living/silicon/robot/borgo = tablet.borgo
|
||||
|
||||
data["name"] = borgo.name
|
||||
@@ -80,6 +78,8 @@
|
||||
if(!iscyborg(user))
|
||||
return data
|
||||
var/mob/living/silicon/robot/borgo = user
|
||||
//Implied
|
||||
var/obj/item/modular_computer/tablet/integrated/tablet = computer
|
||||
|
||||
data["Laws"] = borgo.laws.get_law_list(TRUE, TRUE, FALSE)
|
||||
data["borgLog"] = tablet.borglog
|
||||
@@ -90,7 +90,8 @@
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
//Implied type, memes
|
||||
var/obj/item/modular_computer/tablet/integrated/tablet = computer
|
||||
var/mob/living/silicon/robot/borgo = tablet.borgo
|
||||
|
||||
switch(action)
|
||||
@@ -149,7 +150,9 @@
|
||||
* law changes and borg log additions.
|
||||
*/
|
||||
/datum/computer_file/program/robotact/proc/force_full_update()
|
||||
if(tablet)
|
||||
var/datum/tgui/active_ui = SStgui.get_open_ui(tablet.borgo, src)
|
||||
if(active_ui)
|
||||
active_ui.send_full_update()
|
||||
if(!istype(computer, /obj/item/modular_computer/tablet/integrated))
|
||||
return
|
||||
var/obj/item/modular_computer/tablet/integrated/tablet = computer
|
||||
var/datum/tgui/active_ui = SStgui.get_open_ui(tablet.borgo, src)
|
||||
if(active_ui)
|
||||
active_ui.send_full_update()
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
program_icon = "eye"
|
||||
|
||||
var/list/network = list("ss13")
|
||||
var/obj/machinery/camera/active_camera
|
||||
/// Weakref to the active camera
|
||||
var/datum/weakref/camera_ref
|
||||
/// The turf where the camera was last updated.
|
||||
var/turf/last_camera_turf
|
||||
var/list/concurrent_users = list()
|
||||
@@ -92,6 +93,7 @@
|
||||
var/list/data = get_header_data()
|
||||
data["network"] = network
|
||||
data["activeCamera"] = null
|
||||
var/obj/machinery/camera/active_camera = camera_ref?.resolve()
|
||||
if(active_camera)
|
||||
data["activeCamera"] = list(
|
||||
name = active_camera.c_tag,
|
||||
@@ -121,7 +123,7 @@
|
||||
var/c_tag = params["name"]
|
||||
var/list/cameras = get_available_cameras()
|
||||
var/obj/machinery/camera/selected_camera = cameras[c_tag]
|
||||
active_camera = selected_camera
|
||||
camera_ref = WEAKREF(selected_camera)
|
||||
playsound(src, get_sfx("terminal_type"), 25, FALSE)
|
||||
|
||||
if(!selected_camera)
|
||||
@@ -141,10 +143,11 @@
|
||||
user.client.clear_map(map_name)
|
||||
// Turn off the console
|
||||
if(length(concurrent_users) == 0 && is_living)
|
||||
active_camera = null
|
||||
camera_ref = null
|
||||
playsound(src, 'sound/machines/terminal_off.ogg', 25, FALSE)
|
||||
|
||||
/datum/computer_file/program/secureye/proc/update_active_camera_screen()
|
||||
var/obj/machinery/camera/active_camera = camera_ref?.resolve()
|
||||
// Show static if can't use the camera
|
||||
if(!active_camera?.can_use())
|
||||
show_camera_static()
|
||||
|
||||
Reference in New Issue
Block a user