From 7fdaa4d682aba2585d10bded23aa76ffa4135fcc Mon Sep 17 00:00:00 2001 From: forest2001 Date: Thu, 29 Aug 2024 14:04:55 +0100 Subject: [PATCH 1/4] backend overhaul --- code/game/machinery/ARES/ARES_interface.dm | 160 +------- .../machinery/ARES/ARES_interface_admin.dm | 199 +--------- .../machinery/ARES/ARES_interface_apollo.dm | 77 +--- .../machinery/ARES/ARES_interface_data.dm | 197 ++++++++++ code/game/machinery/ARES/ARES_procs.dm | 16 - .../game/machinery/ARES/ARES_step_triggers.dm | 1 + code/game/machinery/ARES/apollo_pda.dm | 78 +--- colonialmarines.dme | 1 + maps/map_files/USS_Almayer/USS_Almayer.dmm | 16 +- tgui/packages/tgui/interfaces/AresAdmin.jsx | 358 ++++++++++-------- .../tgui/interfaces/AresInterface.jsx | 284 +++++++------- tgui/packages/tgui/interfaces/WorkingJoe.jsx | 139 ++++--- 12 files changed, 681 insertions(+), 845 deletions(-) create mode 100644 code/game/machinery/ARES/ARES_interface_data.dm diff --git a/code/game/machinery/ARES/ARES_interface.dm b/code/game/machinery/ARES/ARES_interface.dm index 0316274774be..b6aeb538b1d5 100644 --- a/code/game/machinery/ARES/ARES_interface.dm +++ b/code/game/machinery/ARES/ARES_interface.dm @@ -69,156 +69,30 @@ ui.open() /obj/structure/machinery/computer/ares_console/ui_data(mob/user) - var/list/data = list() - - data["current_menu"] = current_menu - data["last_page"] = last_menu - - data["logged_in"] = last_login - data["sudo"] = sudo_holder ? TRUE : FALSE - - data["access_text"] = "[sudo_holder ? "(SUDO)," : ""] access level [authentication], [ares_auth_to_text(authentication)]." - data["access_level"] = authentication - - data["alert_level"] = GLOB.security_level - data["evac_status"] = SShijack.evac_status - data["worldtime"] = world.time - - data["access_log"] = datacore.interface_access_list - data["apollo_log"] = datacore.apollo_log - - data["deleted_conversation"] = deleted_1to1 - - data["distresstime"] = datacore.ares_distress_cooldown - data["distresstimelock"] = DISTRESS_TIME_LOCK - data["quarterstime"] = datacore.ares_quarters_cooldown - data["mission_failed"] = SSticker.mode.is_in_endgame - data["nuketimelock"] = NUCLEAR_TIME_LOCK - data["nuke_available"] = datacore.nuke_available - - data["printer_cooldown"] = !COOLDOWN_FINISHED(src, printer_cooldown) - - var/list/logged_announcements = list() - for(var/datum/ares_record/announcement/broadcast as anything in datacore.records_announcement) - var/list/current_broadcast = list() - current_broadcast["time"] = broadcast.time - current_broadcast["title"] = broadcast.title - current_broadcast["details"] = broadcast.details - current_broadcast["ref"] = "\ref[broadcast]" - logged_announcements += list(current_broadcast) - data["records_announcement"] = logged_announcements - - var/list/logged_alerts = list() - for(var/datum/ares_record/security/security_alert as anything in datacore.records_security) - var/list/current_alert = list() - current_alert["time"] = security_alert.time - current_alert["title"] = security_alert.title - current_alert["details"] = security_alert.details - current_alert["ref"] = "\ref[security_alert]" - logged_alerts += list(current_alert) - data["records_security"] = logged_alerts - - var/list/logged_flights = list() - for(var/datum/ares_record/flight/flight_log as anything in datacore.records_flight) - var/list/current_flight = list() - current_flight["time"] = flight_log.time - current_flight["title"] = flight_log.title - current_flight["details"] = flight_log.details - current_flight["user"] = flight_log.user - current_flight["ref"] = "\ref[flight_log]" - logged_flights += list(current_flight) - data["records_flight"] = logged_flights - - var/list/logged_bioscans = list() - for(var/datum/ares_record/bioscan/scan as anything in datacore.records_bioscan) - var/list/current_scan = list() - current_scan["time"] = scan.time - current_scan["title"] = scan.title - current_scan["details"] = scan.details - current_scan["ref"] = "\ref[scan]" - logged_bioscans += list(current_scan) - data["records_bioscan"] = logged_bioscans - - var/list/logged_bombs = list() - for(var/datum/ares_record/bombardment/bomb as anything in datacore.records_bombardment) - var/list/current_bomb = list() - current_bomb["time"] = bomb.time - current_bomb["title"] = bomb.title - current_bomb["details"] = bomb.details - current_bomb["user"] = bomb.user - current_bomb["ref"] = "\ref[bomb]" - logged_bombs += list(current_bomb) - data["records_bombardment"] = logged_bombs - - var/list/logged_deletes = list() - for(var/datum/ares_record/deletion/deleted as anything in datacore.records_deletion) - if(!istype(deleted)) - continue - var/list/current_delete = list() - current_delete["time"] = deleted.time - current_delete["title"] = deleted.title - current_delete["details"] = deleted.details - current_delete["user"] = deleted.user - current_delete["ref"] = "\ref[deleted]" - logged_deletes += list(current_delete) - data["records_deletion"] = logged_deletes - - var/list/logged_discussions = list() - for(var/datum/ares_record/deleted_talk/deleted_convo as anything in datacore.records_deletion) - if(!istype(deleted_convo)) - continue - var/list/deleted_disc = list() - deleted_disc["time"] = deleted_convo.time - deleted_disc["title"] = deleted_convo.title - deleted_disc["ref"] = "\ref[deleted_convo]" - logged_discussions += list(deleted_disc) - data["deleted_discussions"] = logged_discussions - - var/list/logged_orders = list() - for(var/datum/ares_record/requisition_log/req_order as anything in datacore.records_asrs) - if(!istype(req_order)) - continue - var/list/current_order = list() - current_order["time"] = req_order.time - current_order["details"] = req_order.details - current_order["title"] = req_order.title - current_order["user"] = req_order.user - current_order["ref"] = "\ref[req_order]" - logged_orders += list(current_order) - data["records_requisition"] = logged_orders - - var/list/logged_techs = list() - for(var/datum/ares_record/tech/tech_unlock as anything in datacore.records_tech) - var/list/current_tech = list() - current_tech["time"] = tech_unlock.time - current_tech["details"] = tech_unlock.details - current_tech["user"] = tech_unlock.user - current_tech["tier_changer"] = tech_unlock.is_tier - current_tech["ref"] = "\ref[tech_unlock]" - logged_techs += list(current_tech) - data["records_tech"] = logged_techs - - var/list/logged_convos = list() + var/list/data = datacore.get_interface_data() + + data["local_current_menu"] = current_menu + data["local_last_page"] = last_menu + + data["local_logged_in"] = last_login + data["local_sudo"] = sudo_holder ? TRUE : FALSE + + data["local_access_text"] = "[sudo_holder ? "(SUDO)," : ""] access level [authentication], [ares_auth_to_text(authentication)]." + data["local_access_level"] = authentication + + data["local_deleted_conversation"] = deleted_1to1 + data["local_printer_cooldown"] = !COOLDOWN_FINISHED(src, printer_cooldown) + var/list/active_convo = list() var/active_ref - for(var/datum/ares_record/talk_log/log as anything in datacore.records_talking) + for(var/datum/ares_record/talk_log/log as anything in data["logged_convos"]) if(!istype(log)) continue if(log.user == last_login) active_convo = log.conversation active_ref = "\ref[log]" - - var/list/current_convo = list() - current_convo["user"] = log.user - current_convo["ref"] = "\ref[log]" - current_convo["conversation"] = log.conversation - logged_convos += list(current_convo) - - data["active_convo"] = active_convo - data["active_ref"] = active_ref - data["conversations"] = logged_convos - - data["security_vents"] = link.get_ares_vents() + data["local_active_convo"] = active_convo + data["local_active_ref"] = active_ref return data diff --git a/code/game/machinery/ARES/ARES_interface_admin.dm b/code/game/machinery/ARES/ARES_interface_admin.dm index 758ba9fbb5e7..094dbcf88953 100644 --- a/code/game/machinery/ARES/ARES_interface_admin.dm +++ b/code/game/machinery/ARES/ARES_interface_admin.dm @@ -48,190 +48,31 @@ if(!interface) to_chat(user, SPAN_WARNING("ARES ADMIN DATA LINK FAILED")) return FALSE - var/list/data = list() - - data["admin_login"] = "[admin_interface.logged_in], [user.client.admin_holder?.rank]" - data["admin_access_log"] = list(admin_interface.access_list) - - data["current_menu"] = admin_interface.current_menu - data["last_page"] = admin_interface.last_menu - - data["logged_in"] = interface.last_login - data["sudo"] = interface.sudo_holder ? TRUE : FALSE - - data["access_text"] = "[interface.sudo_holder ? "(SUDO)," : ""] access level [interface.authentication], [interface.ares_auth_to_text(interface.authentication)]." - data["access_level"] = interface.authentication - - data["alert_level"] = GLOB.security_level - data["evac_status"] = SShijack.evac_status - data["worldtime"] = world.time - - data["access_log"] = datacore.interface_access_list - data["apollo_log"] = datacore.apollo_log - - data["deleted_conversation"] = admin_interface.deleted_1to1 - - data["distresstime"] = datacore.ares_distress_cooldown - data["distresstimelock"] = DISTRESS_TIME_LOCK - data["mission_failed"] = SSticker.mode.is_in_endgame - data["nuketimelock"] = NUCLEAR_TIME_LOCK - data["nuke_available"] = datacore.nuke_available - - var/list/logged_announcements = list() - for(var/datum/ares_record/announcement/broadcast in datacore.records_announcement) - var/list/current_broadcast = list() - current_broadcast["time"] = broadcast.time - current_broadcast["title"] = broadcast.title - current_broadcast["details"] = broadcast.details - current_broadcast["ref"] = "\ref[broadcast]" - logged_announcements += list(current_broadcast) - data["records_announcement"] = logged_announcements - - var/list/logged_alerts = list() - for(var/datum/ares_record/security/security_alert in datacore.records_security) - var/list/current_alert = list() - current_alert["time"] = security_alert.time - current_alert["title"] = security_alert.title - current_alert["details"] = security_alert.details - current_alert["ref"] = "\ref[security_alert]" - logged_alerts += list(current_alert) - data["records_security"] = logged_alerts - - var/list/logged_flights = list() - for(var/datum/ares_record/flight/flight_log in datacore.records_flight) - var/list/current_flight = list() - current_flight["time"] = flight_log.time - current_flight["title"] = flight_log.title - current_flight["details"] = flight_log.details - current_flight["user"] = flight_log.user - current_flight["ref"] = "\ref[flight_log]" - logged_flights += list(current_flight) - data["records_flight"] = logged_flights - - var/list/logged_bioscans = list() - for(var/datum/ares_record/bioscan/scan in datacore.records_bioscan) - var/list/current_scan = list() - current_scan["time"] = scan.time - current_scan["title"] = scan.title - current_scan["details"] = scan.details - current_scan["ref"] = "\ref[scan]" - logged_bioscans += list(current_scan) - data["records_bioscan"] = logged_bioscans - - var/list/logged_bombs = list() - for(var/datum/ares_record/bombardment/bomb in datacore.records_bombardment) - var/list/current_bomb = list() - current_bomb["time"] = bomb.time - current_bomb["title"] = bomb.title - current_bomb["details"] = bomb.details - current_bomb["user"] = bomb.user - current_bomb["ref"] = "\ref[bomb]" - logged_bombs += list(current_bomb) - data["records_bombardment"] = logged_bombs - - var/list/logged_deletes = list() - for(var/datum/ares_record/deletion/deleted in datacore.records_deletion) - var/list/current_delete = list() - current_delete["time"] = deleted.time - current_delete["title"] = deleted.title - current_delete["details"] = deleted.details - current_delete["user"] = deleted.user - current_delete["ref"] = "\ref[deleted]" - logged_deletes += list(current_delete) - data["records_deletion"] = logged_deletes - - var/list/logged_discussions = list() - for(var/datum/ares_record/deleted_talk/deleted_convo in datacore.records_deletion) - var/list/deleted_disc = list() - deleted_disc["time"] = deleted_convo.time - deleted_disc["title"] = deleted_convo.title - deleted_disc["ref"] = "\ref[deleted_convo]" - logged_discussions += list(deleted_disc) - data["deleted_discussions"] = logged_discussions - - var/list/logged_orders = list() - for(var/datum/ares_record/requisition_log/req_order in datacore.records_asrs) - var/list/current_order = list() - current_order["time"] = req_order.time - current_order["details"] = req_order.details - current_order["title"] = req_order.title - current_order["user"] = req_order.user - current_order["ref"] = "\ref[req_order]" - logged_orders += list(current_order) - data["records_requisition"] = logged_orders - - var/list/logged_techs = list() - for(var/datum/ares_record/tech/tech_unlock as anything in datacore.records_tech) - var/list/current_tech = list() - current_tech["time"] = tech_unlock.time - current_tech["details"] = tech_unlock.details - current_tech["user"] = tech_unlock.user - current_tech["tier_changer"] = tech_unlock.is_tier - current_tech["ref"] = "\ref[tech_unlock]" - logged_techs += list(current_tech) - data["records_tech"] = logged_techs - - var/list/logged_convos = list() + var/list/data = datacore.get_interface_data() + + data["local_admin_login"] = "[admin_interface.logged_in], [user.client.admin_holder?.rank]" + data["admin_access_log"] = admin_interface.access_list + + data["local_current_menu"] = admin_interface.current_menu + data["local_last_page"] = admin_interface.last_menu + + data["ares_logged_in"] = interface.last_login + data["ares_sudo"] = interface.sudo_holder ? TRUE : FALSE + + data["ares_access_text"] = "[interface.sudo_holder ? "(SUDO)," : ""] access level [interface.authentication], [interface.ares_auth_to_text(interface.authentication)]." + + data["local_deleted_conversation"] = admin_interface.deleted_1to1 + var/list/active_convo = list() var/active_ref - for(var/datum/ares_record/talk_log/log in datacore.records_talking) + for(var/datum/ares_record/talk_log/log as anything in data["logged_convos"]) + if(!istype(log)) + continue if(log.user == interface.last_login) active_convo = log.conversation active_ref = "\ref[log]" - - var/list/current_convo = list() - current_convo["user"] = log.user - current_convo["ref"] = "\ref[log]" - current_convo["conversation"] = log.conversation - logged_convos += list(current_convo) - - data["active_convo"] = active_convo - data["active_ref"] = active_ref - data["conversations"] = logged_convos - - var/list/logged_maintenance = list() - for(var/datum/ares_ticket/maintenance/maint_ticket in tickets_maintenance) - var/lock_status = TICKET_OPEN - switch(maint_ticket.ticket_status) - if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_COMPLETED) - lock_status = TICKET_CLOSED - - var/list/current_maint = list() - current_maint["id"] = maint_ticket.ticket_id - current_maint["time"] = maint_ticket.ticket_time - current_maint["priority_status"] = maint_ticket.ticket_priority - current_maint["category"] = maint_ticket.ticket_name - current_maint["details"] = maint_ticket.ticket_details - current_maint["status"] = maint_ticket.ticket_status - current_maint["submitter"] = maint_ticket.ticket_submitter - current_maint["assignee"] = maint_ticket.ticket_assignee - current_maint["lock_status"] = lock_status - current_maint["ref"] = "\ref[maint_ticket]" - logged_maintenance += list(current_maint) - data["maintenance_tickets"] = logged_maintenance - - var/list/logged_access = list() - for(var/datum/ares_ticket/access/access_ticket in tickets_access) - var/lock_status = TICKET_OPEN - switch(access_ticket.ticket_status) - if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_REVOKED) - lock_status = TICKET_CLOSED - - var/list/current_ticket = list() - current_ticket["id"] = access_ticket.ticket_id - current_ticket["time"] = access_ticket.ticket_time - current_ticket["priority_status"] = access_ticket.ticket_priority - current_ticket["title"] = access_ticket.ticket_name - current_ticket["details"] = access_ticket.ticket_details - current_ticket["status"] = access_ticket.ticket_status - current_ticket["submitter"] = access_ticket.ticket_submitter - current_ticket["assignee"] = access_ticket.ticket_assignee - current_ticket["lock_status"] = lock_status - current_ticket["ref"] = "\ref[access_ticket]" - logged_access += list(current_ticket) - data["access_tickets"] = logged_access - - data["security_vents"] = get_ares_vents() + data["local_active_convo"] = active_convo + data["local_active_ref"] = active_ref return data diff --git a/code/game/machinery/ARES/ARES_interface_apollo.dm b/code/game/machinery/ARES/ARES_interface_apollo.dm index 93637f39d1a7..a0c66de3d8b3 100644 --- a/code/game/machinery/ARES/ARES_interface_apollo.dm +++ b/code/game/machinery/ARES/ARES_interface_apollo.dm @@ -73,75 +73,14 @@ ui.open() /obj/structure/machinery/computer/working_joe/ui_data(mob/user) - var/list/data = list() - - data["current_menu"] = current_menu - data["last_page"] = last_menu - - data["logged_in"] = last_login - - data["access_text"] = "access level [authentication], [ares_auth_to_text(authentication)]." - data["access_level"] = authentication - - data["alert_level"] = GLOB.security_level - data["worldtime"] = world.time - - data["access_log"] = list() - data["access_log"] += datacore.apollo_login_list - - data["apollo_log"] = datacore.apollo_log - - data["notify_sounds"] = notify_sounds - - var/list/logged_maintenance = list() - for(var/datum/ares_ticket/maintenance/maint_ticket as anything in link.tickets_maintenance) - if(!istype(maint_ticket)) - continue - var/lock_status = TICKET_OPEN - switch(maint_ticket.ticket_status) - if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_COMPLETED) - lock_status = TICKET_CLOSED - - var/list/current_maint = list() - current_maint["id"] = maint_ticket.ticket_id - current_maint["time"] = maint_ticket.ticket_time - current_maint["priority_status"] = maint_ticket.ticket_priority - current_maint["category"] = maint_ticket.ticket_name - current_maint["details"] = maint_ticket.ticket_details - current_maint["status"] = maint_ticket.ticket_status - current_maint["submitter"] = maint_ticket.ticket_submitter - current_maint["assignee"] = maint_ticket.ticket_assignee - current_maint["lock_status"] = lock_status - current_maint["ref"] = "\ref[maint_ticket]" - logged_maintenance += list(current_maint) - data["maintenance_tickets"] = logged_maintenance - - var/list/logged_access = list() - var/list/requesting_access = list() - for(var/datum/ares_ticket/access/access_ticket as anything in link.tickets_access) - var/lock_status = TICKET_OPEN - switch(access_ticket.ticket_status) - if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_REVOKED) - lock_status = TICKET_CLOSED - - var/list/current_ticket = list() - current_ticket["id"] = access_ticket.ticket_id - current_ticket["time"] = access_ticket.ticket_time - current_ticket["priority_status"] = access_ticket.ticket_priority - current_ticket["title"] = access_ticket.ticket_name - current_ticket["details"] = access_ticket.ticket_details - current_ticket["status"] = access_ticket.ticket_status - current_ticket["submitter"] = access_ticket.ticket_submitter - current_ticket["assignee"] = access_ticket.ticket_assignee - current_ticket["lock_status"] = lock_status - current_ticket["ref"] = "\ref[access_ticket]" - logged_access += list(current_ticket) - - if(lock_status == TICKET_OPEN) - requesting_access += access_ticket.ticket_name - data["access_tickets"] = logged_access - - data["security_vents"] = link.get_ares_vents() + var/list/data = datacore.get_interface_data() + + data["local_current_menu"] = current_menu + data["local_last_page"] = last_menu + data["local_logged_in"] = last_login + data["local_access_text"] = "access level [authentication], [ares_auth_to_text(authentication)]." + data["local_access_level"] = authentication + data["local_notify_sounds"] = notify_sounds return data diff --git a/code/game/machinery/ARES/ARES_interface_data.dm b/code/game/machinery/ARES/ARES_interface_data.dm new file mode 100644 index 000000000000..a693238358a3 --- /dev/null +++ b/code/game/machinery/ARES/ARES_interface_data.dm @@ -0,0 +1,197 @@ +/datum/ares_datacore/proc/get_interface_data() + var/datum/ares_link/link = GLOB.ares_link + var/list/data = list() + + data["alert_level"] = GLOB.security_level + data["evac_status"] = SShijack.evac_status + data["worldtime"] = world.time + + data["ares_access_log"] = interface_access_list + data["apollo_access_log"] = apollo_login_list + data["apollo_log"] = apollo_log + + + data["distresstime"] = ares_distress_cooldown + data["distresstimelock"] = DISTRESS_TIME_LOCK + data["quarterstime"] = ares_quarters_cooldown + data["mission_failed"] = SSticker.mode.is_in_endgame + data["nuketimelock"] = NUCLEAR_TIME_LOCK + data["nuke_available"] = nuke_available + + + var/list/logged_announcements = list() + for(var/datum/ares_record/announcement/broadcast as anything in records_announcement) + var/list/current_broadcast = list() + current_broadcast["time"] = broadcast.time + current_broadcast["title"] = broadcast.title + current_broadcast["details"] = broadcast.details + current_broadcast["ref"] = "\ref[broadcast]" + logged_announcements += list(current_broadcast) + data["records_announcement"] = logged_announcements + + var/list/logged_alerts = list() + for(var/datum/ares_record/security/security_alert as anything in records_security) + var/list/current_alert = list() + current_alert["time"] = security_alert.time + current_alert["title"] = security_alert.title + current_alert["details"] = security_alert.details + current_alert["ref"] = "\ref[security_alert]" + logged_alerts += list(current_alert) + data["records_security"] = logged_alerts + + var/list/logged_flights = list() + for(var/datum/ares_record/flight/flight_log as anything in records_flight) + var/list/current_flight = list() + current_flight["time"] = flight_log.time + current_flight["title"] = flight_log.title + current_flight["details"] = flight_log.details + current_flight["user"] = flight_log.user + current_flight["ref"] = "\ref[flight_log]" + logged_flights += list(current_flight) + data["records_flight"] = logged_flights + + var/list/logged_bioscans = list() + for(var/datum/ares_record/bioscan/scan as anything in records_bioscan) + var/list/current_scan = list() + current_scan["time"] = scan.time + current_scan["title"] = scan.title + current_scan["details"] = scan.details + current_scan["ref"] = "\ref[scan]" + logged_bioscans += list(current_scan) + data["records_bioscan"] = logged_bioscans + + var/list/logged_bombs = list() + for(var/datum/ares_record/bombardment/bomb as anything in records_bombardment) + var/list/current_bomb = list() + current_bomb["time"] = bomb.time + current_bomb["title"] = bomb.title + current_bomb["details"] = bomb.details + current_bomb["user"] = bomb.user + current_bomb["ref"] = "\ref[bomb]" + logged_bombs += list(current_bomb) + data["records_bombardment"] = logged_bombs + + var/list/logged_deletes = list() + for(var/datum/ares_record/deletion/deleted as anything in records_deletion) + if(!istype(deleted)) + continue + var/list/current_delete = list() + current_delete["time"] = deleted.time + current_delete["title"] = deleted.title + current_delete["details"] = deleted.details + current_delete["user"] = deleted.user + current_delete["ref"] = "\ref[deleted]" + logged_deletes += list(current_delete) + data["records_deletion"] = logged_deletes + + var/list/logged_discussions = list() + for(var/datum/ares_record/deleted_talk/deleted_convo as anything in records_deletion) + if(!istype(deleted_convo)) + continue + var/list/deleted_disc = list() + deleted_disc["time"] = deleted_convo.time + deleted_disc["title"] = deleted_convo.title + deleted_disc["ref"] = "\ref[deleted_convo]" + logged_discussions += list(deleted_disc) + data["deleted_discussions"] = logged_discussions + + var/list/logged_orders = list() + for(var/datum/ares_record/requisition_log/req_order as anything in records_asrs) + if(!istype(req_order)) + continue + var/list/current_order = list() + current_order["time"] = req_order.time + current_order["details"] = req_order.details + current_order["title"] = req_order.title + current_order["user"] = req_order.user + current_order["ref"] = "\ref[req_order]" + logged_orders += list(current_order) + data["records_requisition"] = logged_orders + + var/list/logged_techs = list() + for(var/datum/ares_record/tech/tech_unlock as anything in records_tech) + var/list/current_tech = list() + current_tech["time"] = tech_unlock.time + current_tech["details"] = tech_unlock.details + current_tech["user"] = tech_unlock.user + current_tech["tier_changer"] = tech_unlock.is_tier + current_tech["ref"] = "\ref[tech_unlock]" + logged_techs += list(current_tech) + data["records_tech"] = logged_techs + + var/list/logged_convos = list() + for(var/datum/ares_record/talk_log/log as anything in records_talking) + if(!istype(log)) + continue + + var/list/current_convo = list() + current_convo["user"] = log.user + current_convo["ref"] = "\ref[log]" + current_convo["conversation"] = log.conversation + logged_convos += list(current_convo) + + data["conversations"] = logged_convos + + var/list/security_vents = list() + for(var/obj/structure/pipes/vents/pump/no_boom/gas/vent in link.linked_vents) + if(!vent.vent_tag) + vent.vent_tag = "Security Vent #[link.tag_num]" + link.tag_num++ + + var/list/current_vent = list() + var/is_available = COOLDOWN_FINISHED(vent, vent_trigger_cooldown) + current_vent["vent_tag"] = vent.vent_tag + current_vent["ref"] = "\ref[vent]" + current_vent["available"] = is_available + security_vents += list(current_vent) + data["security_vents"] = security_vents + + var/list/logged_maintenance = list() + for(var/datum/ares_ticket/maintenance/maint_ticket as anything in link.tickets_maintenance) + if(!istype(maint_ticket)) + continue + var/lock_status = TICKET_OPEN + switch(maint_ticket.ticket_status) + if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_COMPLETED) + lock_status = TICKET_CLOSED + + var/list/current_maint = list() + current_maint["id"] = maint_ticket.ticket_id + current_maint["time"] = maint_ticket.ticket_time + current_maint["priority_status"] = maint_ticket.ticket_priority + current_maint["category"] = maint_ticket.ticket_name + current_maint["details"] = maint_ticket.ticket_details + current_maint["status"] = maint_ticket.ticket_status + current_maint["submitter"] = maint_ticket.ticket_submitter + current_maint["assignee"] = maint_ticket.ticket_assignee + current_maint["lock_status"] = lock_status + current_maint["ref"] = "\ref[maint_ticket]" + logged_maintenance += list(current_maint) + data["maintenance_tickets"] = logged_maintenance + + var/list/logged_access = list() + var/list/requesting_access = list() + for(var/datum/ares_ticket/access/access_ticket as anything in link.tickets_access) + var/lock_status = TICKET_OPEN + switch(access_ticket.ticket_status) + if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_REVOKED) + lock_status = TICKET_CLOSED + + var/list/current_ticket = list() + current_ticket["id"] = access_ticket.ticket_id + current_ticket["time"] = access_ticket.ticket_time + current_ticket["priority_status"] = access_ticket.ticket_priority + current_ticket["title"] = access_ticket.ticket_name + current_ticket["details"] = access_ticket.ticket_details + current_ticket["status"] = access_ticket.ticket_status + current_ticket["submitter"] = access_ticket.ticket_submitter + current_ticket["assignee"] = access_ticket.ticket_assignee + current_ticket["lock_status"] = lock_status + current_ticket["ref"] = "\ref[access_ticket]" + logged_access += list(current_ticket) + + if(lock_status == TICKET_OPEN) + requesting_access += access_ticket.ticket_name + data["access_tickets"] = logged_access + + return data diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index ef1b836a3d4b..09a90f240aeb 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -54,22 +54,6 @@ GLOBAL_LIST_INIT(maintenance_categories, list( alert.delink() ..() -/datum/ares_link/proc/get_ares_vents() - var/list/security_vents = list() - var/datum/ares_link/link = GLOB.ares_link - for(var/obj/structure/pipes/vents/pump/no_boom/gas/vent in link.linked_vents) - if(!vent.vent_tag) - vent.vent_tag = "Security Vent #[link.tag_num]" - link.tag_num++ - - var/list/current_vent = list() - var/is_available = COOLDOWN_FINISHED(vent, vent_trigger_cooldown) - current_vent["vent_tag"] = vent.vent_tag - current_vent["ref"] = "\ref[vent]" - current_vent["available"] = is_available - security_vents += list(current_vent) - return security_vents - /* BELOW ARE IN AdminAres.dm /datum/ares_link/tgui_interact(mob/user, datum/tgui/ui) diff --git a/code/game/machinery/ARES/ARES_step_triggers.dm b/code/game/machinery/ARES/ARES_step_triggers.dm index 77a53200ddd3..011702aa0c6d 100644 --- a/code/game/machinery/ARES/ARES_step_triggers.dm +++ b/code/game/machinery/ARES/ARES_step_triggers.dm @@ -84,6 +84,7 @@ /obj/effect/step_trigger/ares_alert/public pass_accesses = list(ACCESS_MARINE_AI_TEMP, ACCESS_MARINE_AI, ACCESS_ARES_DEBUG) + /obj/effect/step_trigger/ares_alert/core alert_id = "AresCore" pass_accesses = list(ACCESS_MARINE_AI_TEMP, ACCESS_MARINE_AI, ACCESS_ARES_DEBUG) diff --git a/code/game/machinery/ARES/apollo_pda.dm b/code/game/machinery/ARES/apollo_pda.dm index 7b92b869daeb..2276164ccc0b 100644 --- a/code/game/machinery/ARES/apollo_pda.dm +++ b/code/game/machinery/ARES/apollo_pda.dm @@ -97,76 +97,14 @@ update_icon() /obj/item/device/working_joe_pda/ui_data(mob/user) - var/list/data = list() - - data["current_menu"] = current_menu - data["last_page"] = last_menu - - data["logged_in"] = last_login - - data["access_text"] = "access level [authentication], [ares_auth_to_text(authentication)]." - data["access_level"] = authentication - - data["alert_level"] = GLOB.security_level - data["worldtime"] = world.time - - data["access_log"] = list() - data["access_log"] += datacore.apollo_login_list - - data["apollo_log"] = list() - data["apollo_log"] += datacore.apollo_log - - data["notify_sounds"] = notify_sounds - - var/list/logged_maintenance = list() - for(var/datum/ares_ticket/maintenance/maint_ticket as anything in link.tickets_maintenance) - if(!istype(maint_ticket)) - continue - var/lock_status = TICKET_OPEN - switch(maint_ticket.ticket_status) - if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_COMPLETED) - lock_status = TICKET_CLOSED - - var/list/current_maint = list() - current_maint["id"] = maint_ticket.ticket_id - current_maint["time"] = maint_ticket.ticket_time - current_maint["priority_status"] = maint_ticket.ticket_priority - current_maint["category"] = maint_ticket.ticket_name - current_maint["details"] = maint_ticket.ticket_details - current_maint["status"] = maint_ticket.ticket_status - current_maint["submitter"] = maint_ticket.ticket_submitter - current_maint["assignee"] = maint_ticket.ticket_assignee - current_maint["lock_status"] = lock_status - current_maint["ref"] = "\ref[maint_ticket]" - logged_maintenance += list(current_maint) - data["maintenance_tickets"] = logged_maintenance - - var/list/logged_access = list() - var/list/requesting_access = list() - for(var/datum/ares_ticket/access/access_ticket as anything in link.tickets_access) - var/lock_status = TICKET_OPEN - switch(access_ticket.ticket_status) - if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_REVOKED) - lock_status = TICKET_CLOSED - - var/list/current_ticket = list() - current_ticket["id"] = access_ticket.ticket_id - current_ticket["time"] = access_ticket.ticket_time - current_ticket["priority_status"] = access_ticket.ticket_priority - current_ticket["title"] = access_ticket.ticket_name - current_ticket["details"] = access_ticket.ticket_details - current_ticket["status"] = access_ticket.ticket_status - current_ticket["submitter"] = access_ticket.ticket_submitter - current_ticket["assignee"] = access_ticket.ticket_assignee - current_ticket["lock_status"] = lock_status - current_ticket["ref"] = "\ref[access_ticket]" - logged_access += list(current_ticket) - - if(lock_status == TICKET_OPEN) - requesting_access += access_ticket.ticket_name - data["access_tickets"] = logged_access - - data["security_vents"] = link.get_ares_vents() + var/list/data = datacore.get_interface_data() + + data["local_current_menu"] = current_menu + data["local_last_page"] = last_menu + data["local_logged_in"] = last_login + data["local_access_text"] = "access level [authentication], [ares_auth_to_text(authentication)]." + data["local_access_level"] = authentication + data["local_notify_sounds"] = notify_sounds return data diff --git a/colonialmarines.dme b/colonialmarines.dme index 48996a93ec30..ee0c5a9c105b 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -894,6 +894,7 @@ #include "code\game\machinery\ARES\ARES_interface.dm" #include "code\game\machinery\ARES\ARES_interface_admin.dm" #include "code\game\machinery\ARES\ARES_interface_apollo.dm" +#include "code\game\machinery\ARES\ARES_interface_data.dm" #include "code\game\machinery\ARES\ARES_procs.dm" #include "code\game\machinery\ARES\ARES_records.dm" #include "code\game\machinery\ARES\ARES_step_triggers.dm" diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index b5181e0f77f6..1b74cfdcf760 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -4994,7 +4994,7 @@ name = "ARES Operations Shutter"; pixel_x = -24; pixel_y = -8; - req_one_access_txt = "90;91;92" + req_one_access_txt = "91;92" }, /turf/open/floor/almayer/aicore/no_build/ai_silver/west, /area/almayer/command/airoom) @@ -20314,7 +20314,7 @@ name = "ARES Mainframe Lockdown"; pixel_x = 24; pixel_y = 24; - req_one_access_txt = "200;91;92" + req_one_access_txt = "91;92" }, /turf/open/floor/almayer/aicore/glowing/no_build, /area/almayer/command/airoom) @@ -23957,7 +23957,7 @@ name = "ARES Operations Shutter"; pixel_x = -24; pixel_y = -8; - req_one_access_txt = "90;91;92" + req_one_access_txt = "91;92" }, /turf/open/floor/almayer/aicore/glowing/no_build/ai_floor3, /area/almayer/command/airoom) @@ -35578,7 +35578,7 @@ name = "ARES Mainframe Lockdown"; pixel_x = -24; pixel_y = 24; - req_one_access_txt = "200;91;92" + req_one_access_txt = "91;92" }, /turf/open/floor/almayer/aicore/glowing/no_build, /area/almayer/command/airoom) @@ -36574,7 +36574,7 @@ name = "ARES Operations Shutter"; pixel_x = 24; pixel_y = -8; - req_one_access_txt = "90;91;92" + req_one_access_txt = "91;92" }, /turf/open/floor/almayer/aicore/glowing/no_build/ai_floor3, /area/almayer/command/airoom) @@ -37346,7 +37346,7 @@ name = "ARES Operations Shutter"; pixel_x = 24; pixel_y = -8; - req_one_access_txt = "90;91;92" + req_one_access_txt = "91;92" }, /turf/open/floor/almayer/aicore/no_build/ai_silver/east, /area/almayer/command/airoom) @@ -50597,7 +50597,7 @@ name = "ARES Mainframe Lockdown"; pixel_x = 24; pixel_y = -24; - req_one_access_txt = "200;91;92" + req_one_access_txt = "91;92" }, /turf/open/floor/almayer/aicore/no_build, /area/almayer/command/airoom) @@ -62176,7 +62176,7 @@ name = "ARES Mainframe Lockdown"; pixel_x = -24; pixel_y = -24; - req_one_access_txt = "200;91;92" + req_one_access_txt = "91;92" }, /turf/open/floor/almayer/aicore/no_build, /area/almayer/command/airoom) diff --git a/tgui/packages/tgui/interfaces/AresAdmin.jsx b/tgui/packages/tgui/interfaces/AresAdmin.jsx index 79a8e83a1f00..408614a0af63 100644 --- a/tgui/packages/tgui/interfaces/AresAdmin.jsx +++ b/tgui/packages/tgui/interfaces/AresAdmin.jsx @@ -27,15 +27,15 @@ const PAGES = { export const AresAdmin = (props) => { const { data } = useBackend(); - const { current_menu, sudo } = data; - const PageComponent = PAGES[current_menu](); + const { local_current_menu, ares_sudo } = data; + const PageComponent = PAGES[local_current_menu](); let themecolor = 'crtyellow'; - if (sudo >= 1) { + if (ares_sudo >= 1) { themecolor = 'crtred'; - } else if (current_menu === 'emergency') { + } else if (local_current_menu === 'emergency') { themecolor = 'crtred'; - } else if (current_menu === 'core_security') { + } else if (local_current_menu === 'core_security') { themecolor = 'crtred'; } @@ -86,8 +86,14 @@ const Login = (props) => { const MainMenu = (props) => { const { data, act } = useBackend(); - const { logged_in, access_text, last_page, current_menu, sudo, admin_login } = - data; + const { + ares_logged_in, + ares_access_text, + local_last_page, + local_current_menu, + ares_sudo, + local_admin_login, + } = data; return ( <> @@ -100,7 +106,7 @@ const MainMenu = (props) => { textAlign="center" tooltip="Go back" onClick={() => act('go_back')} - disabled={last_page === current_menu} + disabled={local_last_page === local_current_menu} /> )} - {sudo >= 1 && ( + {ares_sudo >= 1 && ( @@ -451,12 +457,12 @@ const MainMenu = (props) => { const AnnouncementLogs = (props) => { const { data, act } = useBackend(); const { - logged_in, - access_text, - last_page, - current_menu, + ares_logged_in, + ares_access_text, + local_last_page, + local_current_menu, records_announcement, - admin_login, + local_admin_login, } = data; return ( @@ -470,7 +476,7 @@ const AnnouncementLogs = (props) => { textAlign="center" tooltip="Go back" onClick={() => act('go_back')} - disabled={last_page === current_menu} + disabled={local_last_page === local_current_menu} /> )} - {active_convo.map((message, i) => { + {local_active_convo.map((message, i) => { return ( {message} ); })} - {!!active_convo.length && ( + {!!local_active_convo.length && ( @@ -1073,7 +1081,9 @@ const ARESTalk = (props) => { bold tooltip="Send a message as if you were the person logged in at the interface." onClick={() => - act('fake_message_ares', { active_convo: active_ref }) + act('fake_message_ares', { + local_active_convo: local_active_ref, + }) } > Send Fake Message @@ -1091,9 +1101,9 @@ const ARESTalk = (props) => { fontSize="1.5rem" bold onClick={() => - act('clear_conversation', { active_convo: active_ref }) + act('clear_conversation', { local_active_convo: local_active_ref }) } - disabled={!active_convo.length} + disabled={!local_active_convo.length} > Clear Conversation @@ -1105,12 +1115,12 @@ const ARESTalk = (props) => { const DeletedTalks = (props) => { const { data, act } = useBackend(); const { - logged_in, - access_text, - last_page, - current_menu, + ares_logged_in, + ares_access_text, + local_last_page, + local_current_menu, deleted_discussions, - admin_login, + local_admin_login, } = data; return ( @@ -1124,7 +1134,7 @@ const DeletedTalks = (props) => { textAlign="center" tooltip="Go back" onClick={() => act('go_back')} - disabled={last_page === current_menu} + disabled={local_last_page === local_current_menu} /> - {access_level >= 2 && ( + {local_access_level >= 2 && (

Access Level 2

@@ -215,7 +215,7 @@ const MainMenu = (props) => {
)} - {access_level >= 3 && ( + {local_access_level >= 3 && (

Access Level 3

@@ -248,7 +248,7 @@ const MainMenu = (props) => {
)} - {access_level >= 5 && ( + {local_access_level >= 5 && (

Access Level 5

@@ -295,7 +295,7 @@ const MainMenu = (props) => {
)} - {access_level >= 6 && ( + {local_access_level >= 6 && (

Access Level 6

@@ -315,7 +315,7 @@ const MainMenu = (props) => {
)} - {access_level >= 9 && ( + {local_access_level >= 9 && (

Access Level 9

@@ -348,12 +348,12 @@ const MainMenu = (props) => {
)} - {access_level >= 11 && ( + {local_access_level >= 11 && (

Maintenance Access

- {sudo === 0 && ( + {local_sudo === 0 && ( )} - {sudo >= 1 && ( + {local_sudo >= 1 && ( )} - {active_convo.map((message, i) => { + {local_active_convo.map((message, i) => { return ( {message} ); })} - {!!active_convo.length && ( + {!!local_active_convo.length && ( @@ -1020,9 +1039,9 @@ const ARESTalk = (props) => { fontSize="1.5rem" bold onClick={() => - act('clear_conversation', { active_convo: active_ref }) + act('clear_conversation', { local_active_convo: local_active_ref }) } - disabled={!active_convo.length} + disabled={!local_active_convo.length} > Clear Conversation @@ -1034,10 +1053,10 @@ const ARESTalk = (props) => { const DeletedTalks = (props) => { const { data, act } = useBackend(); const { - logged_in, - access_text, - last_page, - current_menu, + local_logged_in, + local_access_text, + local_last_page, + local_current_menu, deleted_discussions, } = data; @@ -1052,7 +1071,7 @@ const DeletedTalks = (props) => { textAlign="center" tooltip="Go back" onClick={() => act('go_back')} - disabled={last_page === current_menu} + disabled={local_last_page === local_current_menu} /> @@ -1296,12 +1315,12 @@ const Requisitions = (props) => { const FlightLogs = (props) => { const { data, act } = useBackend(); const { - logged_in, - access_text, - last_page, - current_menu, + local_logged_in, + local_access_text, + local_last_page, + local_current_menu, records_flight, - access_level, + local_access_level, } = data; return ( @@ -1315,7 +1334,7 @@ const FlightLogs = (props) => { textAlign="center" tooltip="Go back" onClick={() => act('go_back')} - disabled={last_page === current_menu} + disabled={local_last_page === local_current_menu} /> )} - {access_level === 3 && ( + {local_access_level === 3 && ( {
- {access_level >= 4 && ( + {local_access_level >= 4 && (

Certified Personnel

@@ -217,7 +217,7 @@ const MainMenu = (props) => {
)} - {access_level >= 5 && ( + {local_access_level >= 5 && (

Task Management

@@ -251,7 +251,7 @@ const MainMenu = (props) => {
)} - {access_level >= 5 && ( + {local_access_level >= 5 && (

Core Security Protocols

@@ -294,7 +294,13 @@ const MainMenu = (props) => { const ApolloLog = (props) => { const { data, act } = useBackend(); - const { logged_in, access_text, last_page, current_menu, apollo_log } = data; + const { + local_logged_in, + local_access_text, + local_last_page, + local_current_menu, + apollo_log, + } = data; return ( <> @@ -307,7 +313,7 @@ const ApolloLog = (props) => { textAlign="center" tooltip="Go back" onClick={() => act('go_back')} - disabled={last_page === current_menu} + disabled={local_last_page === local_current_menu} /> @@ -831,7 +843,7 @@ const AccessRequests = (props) => { view_icon = 'circle-minus'; } let can_cancel = 'Yes'; - if (ticket.submitter !== logged_in) { + if (ticket.submitter !== local_logged_in) { can_cancel = 'No'; } else if (ticket.lock_status === 'CLOSED') { can_cancel = 'No'; @@ -877,8 +889,13 @@ const AccessRequests = (props) => { const AccessTickets = (props) => { const { data, act } = useBackend(); - const { logged_in, access_text, last_page, current_menu, access_tickets } = - data; + const { + local_logged_in, + local_access_text, + local_last_page, + local_current_menu, + access_tickets, + } = data; return ( <> @@ -891,7 +908,7 @@ const AccessTickets = (props) => { textAlign="center" tooltip="Go back" onClick={() => act('go_back')} - disabled={last_page === current_menu} + disabled={local_last_page === local_current_menu} />