diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index fe37d2a6cfc..4e553fe7b23 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -203,6 +203,8 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) //SKYRAT EDIT START /// Have we requested this ticket to stop being part of the Ticket Ping subsystem? var/ticket_ping_stop = FALSE + /// Are we added to the ticket ping subsystem in the first place + var/ticket_ping = FALSE //SKYRAT EDIT END /// Whether this ahelp has sent a webhook or not, and what type var/webhook_sent = WEBHOOK_NONE @@ -244,7 +246,10 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) statclick = new(null, src) ticket_interactions = list() - _interactions_player = list() // SKYRAT EDIT ADDITION -- Player ticket viewing + //SKYRAT EDIT START + _interactions_player = list() + addtimer(CALLBACK(src, .proc/add_to_ping_ss, 3 MINUTES)) + //SKYRAT EDIT END if(is_bwoink) AddInteraction("[key_name_admin(usr)] PM'd [LinkedReplyName()]") diff --git a/modular_skyrat/modules/opposing_force/code/opposing_force_datum.dm b/modular_skyrat/modules/opposing_force/code/opposing_force_datum.dm index 7cb5f33a7a0..6015b331255 100644 --- a/modular_skyrat/modules/opposing_force/code/opposing_force_datum.dm +++ b/modular_skyrat/modules/opposing_force/code/opposing_force_datum.dm @@ -77,6 +77,8 @@ var/datum/contractor_hub/contractor_hub /// Corresponding stat() click button var/obj/effect/statclick/opfor_specific/stat_button + /// If it is part of the ticket ping subsystem + var/ticket_ping = FALSE COOLDOWN_DECLARE(static/request_update_cooldown) COOLDOWN_DECLARE(static/ping_cooldown) @@ -497,6 +499,7 @@ SEND_SOUND(staff, sound('sound/effects/adminhelp.ogg')) window_flash(staff, ignorepref = TRUE) + addtimer(CALLBACK(src, .proc/add_to_ping_ss), 3 MINUTES) status = OPFOR_STATUS_AWAITING_APPROVAL can_edit = FALSE add_log(user.ckey, "Submitted to the OPFOR subsystem") @@ -861,6 +864,11 @@ return report.Join("\n") +/datum/opposing_force/proc/add_to_ping_ss() + if(status != OPFOR_STATUS_APPROVED) + return + ticket_ping = TRUE + /datum/action/opfor name = "Open Opposing Force Panel" button_icon_state = "round_end" diff --git a/modular_skyrat/modules/subsystems/code/ticket_ping/adminhelp.dm b/modular_skyrat/modules/subsystems/code/ticket_ping/adminhelp.dm new file mode 100644 index 00000000000..7abfc52a918 --- /dev/null +++ b/modular_skyrat/modules/subsystems/code/ticket_ping/adminhelp.dm @@ -0,0 +1,4 @@ +/datum/admin_help/proc/add_to_ping_ss() + if(state != AHELP_ACTIVE) + return + ticket_ping = TRUE diff --git a/modular_skyrat/modules/subsystems/code/ticket_ping/preference.dm b/modular_skyrat/modules/subsystems/code/ticket_ping/preference.dm new file mode 100644 index 00000000000..4b8906aee58 --- /dev/null +++ b/modular_skyrat/modules/subsystems/code/ticket_ping/preference.dm @@ -0,0 +1,5 @@ +/datum/preference/toggle/admin/ticket_ping + category = PREFERENCE_CATEGORY_GAME_PREFERENCES + default_value = TRUE + savefile_key = "ticket_ping_pref" + savefile_identifier = PREFERENCE_PLAYER diff --git a/modular_skyrat/modules/subsystems/code/ticket_ss.dm b/modular_skyrat/modules/subsystems/code/ticket_ping/ticket_ss.dm similarity index 51% rename from modular_skyrat/modules/subsystems/code/ticket_ss.dm rename to modular_skyrat/modules/subsystems/code/ticket_ping/ticket_ss.dm index e7c2c250810..96e590e91fe 100644 --- a/modular_skyrat/modules/subsystems/code/ticket_ss.dm +++ b/modular_skyrat/modules/subsystems/code/ticket_ping/ticket_ss.dm @@ -9,20 +9,24 @@ SUBSYSTEM_DEF(ticket_ping) var/valid_ahelps var/valid_opfors for(var/datum/admin_help/ahelp in GLOB.ahelp_tickets.active_tickets) - if(ahelp.handler || ahelp.ticket_ping_stop) + if(ahelp.handler || ahelp.ticket_ping_stop || !ahelp.ticket_ping) continue valid_ahelps++ for(var/datum/opposing_force/opfor in SSopposing_force.submitted_applications) - if(opfor.handling_admin) + if(opfor.handling_admin || !opfor.ticket_ping) continue valid_opfors++ if(!valid_ahelps && !valid_opfors) return - - message_admins(span_adminnotice("There are currently [valid_ahelps ? "[valid_ahelps] unhandled staff ticket[valid_ahelps == 1 ? "" : "s"] open" : ""][(valid_ahelps && valid_opfors) ? " and " : ""][valid_opfors ? "[valid_opfors] unhandled Opposing Force application[valid_opfors == 1 ? "" : "s"] open" : ""].")) + var/is_or_are + if(!valid_ahelps) + is_or_are = (valid_opfors > 1 ? "are" : "is") + else + is_or_are = (valid_ahelps > 1 ? "are" : "is") + message_admins(span_adminnotice("There [is_or_are] currently [valid_ahelps ? "[valid_ahelps] unhandled staff ticket[valid_ahelps == 1 ? "" : "s"] open" : ""][(valid_ahelps && valid_opfors) ? " and " : ""][valid_opfors ? "[valid_opfors] unhandled Opposing Force application[valid_opfors == 1 ? "" : "s"] open" : ""].")) for(var/client/staff as anything in GLOB.admins) - if(staff?.prefs?.toggles & SOUND_ADMINHELP) //may as well. + if(staff?.prefs.read_preference(/datum/preference/toggle/admin/ticket_ping)) SEND_SOUND(staff, sound('modular_skyrat/modules/subsystems/sounds/soft_ping.ogg')) - window_flash(staff, ignorepref = TRUE) + window_flash(staff, ignorepref = TRUE) diff --git a/tgstation.dme b/tgstation.dme index ad1b164e895..5729d85d1b3 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5590,7 +5590,9 @@ #include "modular_skyrat\modules\stone\code\ore_veins.dm" #include "modular_skyrat\modules\stone\code\stone.dm" #include "modular_skyrat\modules\stormtrooper\code\stormtrooper_clothes.dm" -#include "modular_skyrat\modules\subsystems\code\ticket_ss.dm" +#include "modular_skyrat\modules\subsystems\code\ticket_ping\adminhelp.dm" +#include "modular_skyrat\modules\subsystems\code\ticket_ping\preference.dm" +#include "modular_skyrat\modules\subsystems\code\ticket_ping\ticket_ss.dm" #include "modular_skyrat\modules\Syndie_edits\code\syndie_edits.dm" #include "modular_skyrat\modules\tableflip\code\flipped_table.dm" #include "modular_skyrat\modules\tagline\code\world.dm"