-
Notifications
You must be signed in to change notification settings - Fork 85
Adds Backstage OOC chat #1033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Adds Backstage OOC chat #1033
Changes from all commits
a136489
c42cda0
1601c76
b8e2fad
97b53a9
17ecd60
9c648fb
bbf5e29
631fa81
2f6ee5e
03acc4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| #define MODULAR_EMOJI_SET 'modular_doppler/modular_emoji/emoji.dmi' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| /// Flags for the associated list that gets used for to determine an OOC channel listener status | ||
| #define LISTEN_PLAYER 1 | ||
| #define LISTEN_ADMIN 2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| #define LOOC_CHANNEL "LOOC" // LOOC | ||
| #define WHIS_CHANNEL "Whis" // Whisper | ||
| #define BACKSTAGE_CHANNEL "Backstage" // ASOOC | ||
| #define DO_CHANNEL "Do" // Do | ||
| #define IRC_CHANNEL "IRC" // IRC |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /// SOOC | ||
| #define SOOC_COLOR "#6551FF" | ||
| GLOBAL_VAR_INIT(sooc_allowed, TRUE) // used with admin verbs to disable sooc - not a config option | ||
| GLOBAL_LIST_INIT(sooc_job_lookup, list( | ||
| JOB_CAPTAIN = TRUE, | ||
| JOB_HEAD_OF_PERSONNEL = TRUE, | ||
| JOB_RESEARCH_DIRECTOR = TRUE, | ||
| JOB_CHIEF_ENGINEER = TRUE, | ||
| JOB_CHIEF_MEDICAL_OFFICER = TRUE, | ||
| JOB_QUARTERMASTER = TRUE, | ||
| JOB_AI = TRUE, | ||
| JOB_HEAD_OF_SECURITY = TRUE, | ||
| JOB_WARDEN = TRUE, | ||
| JOB_DETECTIVE = TRUE, | ||
| JOB_SECURITY_OFFICER = TRUE, | ||
| JOB_COMMAND_BODYGUARD = TRUE, | ||
| )) | ||
|
|
||
| /// AOOC | ||
| #define AOOC_COLOR "#ff5967" | ||
| GLOBAL_VAR_INIT(aooc_allowed, TRUE) | ||
|
|
||
| /// Backstage | ||
| GLOBAL_VAR_INIT(backstage_allowed, TRUE) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel we gotta commit to calling this backstage in code, rather than flip flopping on asooc or backstage |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,94 @@ | ||||||
| /client/verb/backstage(msg as text) | ||||||
| set name = "OOC: Backstage (Antag/Sec)" | ||||||
| set category = "OOC" | ||||||
|
|
||||||
| if(GLOB.say_disabled) //This is here to try to identify lag problems | ||||||
| to_chat(usr, span_danger("Speech is currently admin-disabled.")) | ||||||
| return | ||||||
|
|
||||||
| if(!mob) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| return | ||||||
| var/backstage_access = FALSE | ||||||
| if(GLOB.sooc_job_lookup[mob.mind?.assigned_role?.title]) | ||||||
| backstage_access = TRUE | ||||||
| if(length(mob.mind?.antag_datums)) | ||||||
| backstage_access = TRUE | ||||||
|
|
||||||
| if(!holder) | ||||||
| if(!backstage_access) | ||||||
| to_chat(src, span_danger("You don't have backstage access!")) | ||||||
| return | ||||||
| if(!GLOB.backstage_allowed) | ||||||
| to_chat(src, span_danger("The backstage is staff-only.")) | ||||||
| return | ||||||
| if(prefs.muted & MUTE_OOC) | ||||||
| to_chat(src, span_danger("You cannot use OOC channels (muted).")) | ||||||
| return | ||||||
|
Comment on lines
+17
to
+26
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rather than checking for any admin holder, these should probably also apply to people who have an admin holder but are deadmined right now if(!backstage_role) // review comment: implicitly checks for non-deadmined admins
to_chat(src, span_danger("You don't have backstage access!"))
return
if(backstage_role != BACKSTAGE_ADMIN)
if(!GLOB.backstage_allowed)
to_chat(src, span_danger("The backstage is disabled.")) // review comment: "The backstage is staff-only." feels like it'd be a bit confusing for players? especially cause like we have asay and there's no reason to use backstage between active staff only, so it's practically never gonna be disabled to make it 'staff-only', just to disable it
return
if(prefs.muted & MUTE_OOC)
to_chat(src, span_danger("You cannot use OOC channels (muted)."))
return |
||||||
| if(is_banned_from(ckey, "OOC")) | ||||||
| to_chat(src, span_danger("You have been banned from OOC channels.")) | ||||||
| return | ||||||
| if(QDELETED(src)) | ||||||
| return | ||||||
|
Comment on lines
+27
to
+31
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these can probably also be moved up to the early checks, rather than after our handling stuff |
||||||
|
|
||||||
| msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN) | ||||||
| var/raw_msg = msg | ||||||
|
|
||||||
| if(!msg) | ||||||
| return | ||||||
|
|
||||||
| msg = emoji_parse(msg) | ||||||
|
Comment on lines
+33
to
+39
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we do this in this order? msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)
if(!msg)
return
mob.log_talk(msg, LOG_OOC, tag = "Backstage")
msg = emoji_parse(msg) |
||||||
|
|
||||||
| if(!(prefs.chat_toggles & CHAT_OOC)) | ||||||
| to_chat(src, span_danger("You have OOC communication muted.")) | ||||||
| return | ||||||
|
Comment on lines
+41
to
+43
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should probably be moved to before we do any handling, if we're gonna early return anyway |
||||||
|
|
||||||
| mob.log_talk(raw_msg, LOG_OOC, tag = "Backstage") | ||||||
| var/list/listeners = list() | ||||||
|
|
||||||
| for(var/iterated_player as anything in GLOB.player_list) | ||||||
| var/mob/iterated_mob = iterated_player | ||||||
| //Admins with muted OOC do not get to listen to backstage chatter, but normal players do, as it could be admins talking important stuff to them | ||||||
| if(iterated_mob.client?.holder && !iterated_mob.client?.holder?.deadmined && iterated_mob.client?.prefs?.chat_toggles & CHAT_OOC) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick
Suggested change
|
||||||
| listeners[iterated_mob.client] = LISTEN_ADMIN | ||||||
| continue | ||||||
| if(isobserver(iterated_mob) && iterated_mob.client?.prefs?.chat_toggles & CHAT_OOC) | ||||||
| listeners[iterated_mob.client] = LISTEN_PLAYER | ||||||
| continue | ||||||
| if((length(iterated_mob.mind?.antag_datums) || GLOB.sooc_job_lookup[iterated_mob.mind?.assigned_role?.title])) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay so, we're kinda re-using this code to set the backstage role up above, to check reading here, and uhh to check whether to tell people down in the toggle |
||||||
| listeners[iterated_mob.client] = LISTEN_PLAYER | ||||||
| continue | ||||||
|
|
||||||
| for(var/iterated_listener as anything in listeners) | ||||||
| var/client/iterated_client = iterated_listener | ||||||
|
Comment on lines
+61
to
+62
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. am i tripping or like doesn't for(var/client/iterated_client as anything in listeners) |
||||||
| var/mode = listeners[iterated_listener] | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: |
||||||
| var/name = (mode == LISTEN_ADMIN) ? "([key]) [mob?.real_name]" : mob?.real_name | ||||||
| to_chat(iterated_client, span_oocplain("<font color='[ooc_channel_color(mob)]'> [ooc_channel_emoji(mob)] <EM>[name]</EM> says, <b><span class='message linkify'>[msg]</span></b></font>")) | ||||||
| SEND_SOUND(iterated_client, 'modular_doppler/modular_sounds/sound/machines/typewriter_click.ogg') | ||||||
|
|
||||||
| /proc/toggle_backstage(toggle = null) | ||||||
| if(toggle != null) //if we're specifically en/disabling aooc | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. comment still mentions aooc |
||||||
| if(toggle == GLOB.backstage_allowed) | ||||||
| return | ||||||
| GLOB.backstage_allowed = toggle | ||||||
| else //otherwise just toggle it | ||||||
| GLOB.backstage_allowed = !GLOB.backstage_allowed | ||||||
| var/list/listeners = list() | ||||||
| for(var/mind as anything in get_antag_minds(/datum/antagonist)) | ||||||
| var/datum/mind/antag_mind = mind | ||||||
| if(!antag_mind.current || !antag_mind.current.client || isnewplayer(antag_mind.current)) | ||||||
| continue | ||||||
| listeners[antag_mind.current.client] = TRUE | ||||||
|
|
||||||
| for(var/iterated_player in GLOB.player_list) | ||||||
| var/mob/iterated_mob = iterated_player | ||||||
| if(!iterated_mob.client?.holder?.deadmined) | ||||||
| listeners[iterated_mob.client] = TRUE | ||||||
| for(var/iterated_listener in listeners) | ||||||
| var/client/iterated_client = iterated_listener | ||||||
| to_chat(iterated_client, span_oocplain("<B>Backstage access has been [GLOB.backstage_allowed ? "granted" : "revoked"].</B>")) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. span_bold instead of
Comment on lines
+75
to
+88
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we're looping over all players anyway, why not just for(var/mob/iterated_mob as anything in GLOB.player_list)
if(get_backstage_role(...))
// just straight up do the to_chat here instead of looping again separately
to_chat(...)(as with above |
||||||
|
|
||||||
| ADMIN_VERB(toggle_backstage, R_ADMIN, "Toggle Backstage Access", "Toggles Backstage Access.", ADMIN_CATEGORY_SERVER) | ||||||
| toggle_backstage() | ||||||
| log_admin("[key_name(usr)] toggled Backstage Access.") | ||||||
| message_admins("[key_name_admin(usr)] toggled Backstage Access.") | ||||||
| SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Backstage Access", "[GLOB.backstage_allowed ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| returns the appropriate message color for the OOC channels. | ||
| SOOC_COLOR for secoffs, AOOC_COLOR for antags, and the ooc pref for admins | ||
| */ | ||
| /proc/ooc_channel_color(mob/chatter) | ||
| var/color = "#c43b23" | ||
|
|
||
| // if you're sec | ||
| if(GLOB.sooc_job_lookup[chatter.mind?.assigned_role?.title]) | ||
| color = SOOC_COLOR | ||
| // if you're tot | ||
| if(length(chatter.mind?.antag_datums)) | ||
| color = AOOC_COLOR | ||
| // if you're admin | ||
| if(is_admin(chatter) && !GLOB.deadmins[chatter.client?.ckey]) | ||
| color = chatter.client?.prefs?.read_preference(/datum/preference/color/ooc_color) | ||
|
|
||
| return color | ||
|
|
||
| /* | ||
| returns the appropriate emoji for the OOC channels. | ||
| picks from a pref regarding if youre secoff or antag. always doppie for admins | ||
| */ | ||
| /proc/ooc_channel_emoji(mob/chatter) | ||
| var/emoji_icon_state = "fpalm" | ||
| var/emoji_icon_file = EMOJI_SET | ||
|
|
||
| // if you're sec | ||
| if(GLOB.sooc_job_lookup[chatter.mind?.assigned_role?.title]) | ||
| emoji_icon_state = chatter.client?.prefs?.read_preference(/datum/preference/choiced/ooc_channel_emoji_sec) | ||
| // if you're tot | ||
| if(length(chatter.mind?.antag_datums)) | ||
| emoji_icon_state = chatter.client?.prefs?.read_preference(/datum/preference/choiced/ooc_channel_emoji_tot) | ||
| // if you're admin | ||
| if(is_admin(chatter) && !GLOB.deadmins[chatter.client?.ckey]) | ||
| emoji_icon_state = "dolphin" | ||
| emoji_icon_file = MODULAR_EMOJI_SET | ||
|
|
||
| return icon2html(emoji_icon_file, world, emoji_icon_state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's an argument to be made about adding the sophont resources officer, cause they're supposed to mediate/negotiate with security in a bunch of situations
also, I just realized, it's kinda awkward that the captain gets access to this but like acting captains don't really, do they? honestly unsure how best to fix that.
the Easy one would be "all command" for backstage, but that'd include a bunch of like non acting captain people-- but like there's an argument to be made for including all command in backstage anyway, cause it Will be all of their problems too if anything meaningful enough goes down