From 9eafb5204254c14ae7d4d52a22afe41cc6d23f61 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Mon, 21 Aug 2023 17:28:48 +0100 Subject: [PATCH] Merge AA and Sec logs. Also fixes Sec logs. --- code/game/machinery/ARES/ARES_procs.dm | 25 +---- code/game/machinery/ARES/ARES_records.dm | 5 +- .../machinery/computer/almayer_control.dm | 8 +- code/modules/cm_marines/anti_air.dm | 4 +- .../security_levels/security_levels.dm | 14 +-- .../packages/tgui/interfaces/AresInterface.js | 96 +------------------ 6 files changed, 20 insertions(+), 132 deletions(-) diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index c78a0131b7f1..998dbc2edf18 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -63,14 +63,14 @@ GLOBAL_LIST_INIT(maintenance_categories, list( /datum/ares_link/proc/log_ares_announcement(title, message) interface.records_announcement.Add(new /datum/ares_record/announcement(title, message)) -/datum/ares_link/proc/log_ares_antiair(mob/living/user, details) - interface.records_security.Add(new /datum/ares_record/antiair(details, user)) - /datum/ares_link/proc/log_ares_requisition(source, details, mob/living/user) interface.records_asrs.Add(new /datum/ares_record/requisition_log(source, details, user)) /datum/ares_link/proc/log_ares_security(title, details) interface.records_security.Add(new /datum/ares_record/security(title, details)) + +/datum/ares_link/proc/log_ares_antiair(details) + interface.records_security.Add(new /datum/ares_record/security/antiair(details)) // ------ End ARES Logging Procs ------ // /proc/ares_apollo_talk(broadcast_message) @@ -224,8 +224,6 @@ GLOBAL_LIST_INIT(maintenance_categories, list( var/list/logged_alerts = list() for(var/datum/ares_record/security/security_alert as anything in records_security) - if(!istype(security_alert)) - continue var/list/current_alert = list() current_alert["time"] = security_alert.time current_alert["title"] = security_alert.title @@ -279,18 +277,6 @@ GLOBAL_LIST_INIT(maintenance_categories, list( logged_discussions += list(deleted_disc) data["deleted_discussions"] = logged_discussions - var/list/logged_adjustments = list() - for(var/datum/ares_record/antiair/aa_adjustment as anything in records_security) - if(!istype(aa_adjustment)) - continue - var/list/current_adjustment = list() - current_adjustment["time"] = aa_adjustment.time - current_adjustment["details"] = aa_adjustment.details - current_adjustment["user"] = aa_adjustment.user - current_adjustment["ref"] = "\ref[aa_adjustment]" - logged_adjustments += list(current_adjustment) - data["aa_adjustments"] = logged_adjustments - var/list/logged_orders = list() for(var/datum/ares_record/requisition_log/req_order as anything in records_asrs) if(!istype(req_order)) @@ -431,9 +417,6 @@ GLOBAL_LIST_INIT(maintenance_categories, list( if("page_requisitions") last_menu = current_menu current_menu = "requisitions" - if("page_antiair") - last_menu = current_menu - current_menu = "antiair" if("page_emergency") last_menu = current_menu current_menu = "emergency" @@ -457,7 +440,7 @@ GLOBAL_LIST_INIT(maintenance_categories, list( new_title = "[record.title] at [record.time]" new_details = record.details records_announcement -= record - if(ARES_RECORD_SECURITY) + if(ARES_RECORD_SECURITY, ARES_RECORD_ANTIAIR) new_title = "[record.title] at [record.time]" new_details = record.details records_security -= record diff --git a/code/game/machinery/ARES/ARES_records.dm b/code/game/machinery/ARES/ARES_records.dm index 4e2b479e71a2..59c9e8e99a5a 100644 --- a/code/game/machinery/ARES/ARES_records.dm +++ b/code/game/machinery/ARES/ARES_records.dm @@ -32,14 +32,13 @@ /datum/ares_record/security record_name = ARES_RECORD_SECURITY -/datum/ares_record/antiair +/datum/ares_record/security/antiair record_name = ARES_RECORD_ANTIAIR -/datum/ares_record/antiair/New(details, user) +/datum/ares_record/security/antiair/New(details, user) time = worldtime2text() src.title = "AntiAir Adjustment" src.details = details - src.user = user /datum/ares_record/bombardment record_name = ARES_RECORD_BOMB diff --git a/code/game/machinery/computer/almayer_control.dm b/code/game/machinery/computer/almayer_control.dm index 7d63a2e8c3af..22dd28487778 100644 --- a/code/game/machinery/computer/almayer_control.dm +++ b/code/game/machinery/computer/almayer_control.dm @@ -11,11 +11,11 @@ /// requesting a distress beacon COOLDOWN_DECLARE(cooldown_request) /// requesting evac - COOLDOWN_DECLARE(cooldown_destruct) + COOLDOWN_DECLARE(cooldown_destruct) /// messaging HC (admins) COOLDOWN_DECLARE(cooldown_central) /// making a ship announcement - COOLDOWN_DECLARE(cooldown_message) + COOLDOWN_DECLARE(cooldown_message) var/list/messagetitle = list() var/list/messagetext = list() @@ -164,11 +164,11 @@ if(!level_selected) return - set_security_level(seclevel2num(level_selected)) + set_security_level(seclevel2num(level_selected), log = ARES_LOG_NONE) log_game("[key_name(usr)] has changed the security level to [get_security_level()].") message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].") var/datum/ares_link/link = GLOB.ares_link - link.log_ares_security("Security Level Update", "[usr] has changed the security level to [get_security_level()].") + link.log_ares_security("Manual Security Update", "[usr] has changed the security level to [get_security_level()].") . = TRUE if("messageUSCM") diff --git a/code/modules/cm_marines/anti_air.dm b/code/modules/cm_marines/anti_air.dm index fc67f9a2018d..cdb162cddfa3 100644 --- a/code/modules/cm_marines/anti_air.dm +++ b/code/modules/cm_marines/anti_air.dm @@ -110,12 +110,12 @@ var/obj/structure/anti_air_cannon/almayer_aa_cannon almayer_aa_cannon.protecting_section = "" return message_admins("[key_name(usr)] has set the AA to [html_encode(almayer_aa_cannon.protecting_section)].") - link.log_ares_antiair(usr, "Set AA to cover [html_encode(almayer_aa_cannon.protecting_section)].") + link.log_ares_antiair("[usr] Set AA to cover [html_encode(almayer_aa_cannon.protecting_section)].") . = TRUE if("deactivate") almayer_aa_cannon.protecting_section = "" message_admins("[key_name(usr)] has deactivated the AA cannon.") - link.log_ares_antiair(usr, "Deactivated Anti Air systems.") + link.log_ares_antiair("[usr] Deactivated Anti Air systems.") . = TRUE add_fingerprint(usr) diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index be087444c99e..ba842fb0bfb9 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -7,7 +7,7 @@ //config.alert_desc_blue_downto -/proc/set_security_level(level, no_sound=0, announce=1) +/proc/set_security_level(level, no_sound = FALSE, announce = TRUE, log = ARES_LOG_SECURITY) if(level != security_level) SEND_GLOBAL_SIGNAL(COMSIG_GLOB_SECURITY_LEVEL_CHANGED, level) @@ -16,32 +16,32 @@ switch(level) if(SEC_LEVEL_GREEN) if(announce) - ai_announcement("Attention: Security level lowered to GREEN - all clear.", no_sound ? null : 'sound/AI/code_green.ogg', ARES_LOG_SECURITY) + ai_announcement("Attention: Security level lowered to GREEN - all clear.", no_sound ? null : 'sound/AI/code_green.ogg', log) security_level = SEC_LEVEL_GREEN if(SEC_LEVEL_BLUE) if(security_level < SEC_LEVEL_BLUE) if(announce) - ai_announcement("Attention: Security level elevated to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_elevated.ogg', ARES_LOG_SECURITY) + ai_announcement("Attention: Security level elevated to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_elevated.ogg', log) else if(announce) - ai_announcement("Attention: Security level lowered to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_lowered.ogg', ARES_LOG_SECURITY) + ai_announcement("Attention: Security level lowered to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_lowered.ogg', log) security_level = SEC_LEVEL_BLUE if(SEC_LEVEL_RED) if(security_level < SEC_LEVEL_RED) if(announce) - ai_announcement("Attention: Security level elevated to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_elevated.ogg', ARES_LOG_SECURITY) + ai_announcement("Attention: Security level elevated to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_elevated.ogg', log) else if(announce) - ai_announcement("Attention: Security level lowered to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_lowered.ogg', ARES_LOG_SECURITY) + ai_announcement("Attention: Security level lowered to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_lowered.ogg', log) security_level = SEC_LEVEL_RED if(SEC_LEVEL_DELTA) if(announce) var/name = "SELF-DESTRUCT SYSTEMS ACTIVE" var/input = "DANGER, THE EMERGENCY DESTRUCT SYSTEM IS NOW ACTIVATED. PROCEED TO THE SELF-DESTRUCT CHAMBER FOR CONTROL ROD INSERTION." - marine_announcement(input, name, 'sound/AI/selfdestruct_short.ogg', logging = ARES_LOG_SECURITY) + marine_announcement(input, name, 'sound/AI/selfdestruct_short.ogg', logging = log) security_level = SEC_LEVEL_DELTA EvacuationAuthority.enable_self_destruct() diff --git a/tgui/packages/tgui/interfaces/AresInterface.js b/tgui/packages/tgui/interfaces/AresInterface.js index 3023cf1a5297..805450ccea28 100644 --- a/tgui/packages/tgui/interfaces/AresInterface.js +++ b/tgui/packages/tgui/interfaces/AresInterface.js @@ -16,7 +16,6 @@ const PAGES = { 'read_deleted': () => ReadingTalks, 'security': () => Security, 'requisitions': () => Requisitions, - 'antiair': () => AntiAir, 'emergency': () => Emergency, }; @@ -161,18 +160,6 @@ const MainMenu = (props, context) => {

Access Level 1

- -