Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/~doppler_defines/fonts.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define MODULAR_EMOJI_SET 'modular_doppler/modular_emoji/emoji.dmi'
1 change: 1 addition & 0 deletions code/__DEFINES/~doppler_defines/keybindings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define COMSIG_KB_MOB_PIXEL_SHIFT_DOWN "keybinding_mob_pixel_shift_down"
#define COMSIG_KB_MOB_PIXEL_SHIFT_UP "keybinding_mob_pixel_shift_up"
#define COMSIG_KB_CLIENT_LOOC_DOWN "keybinding_client_looc_down"
#define COMSIG_KB_CLIENT_BACKSTAGE_DOWN "keybinding_client_backstage_down"
#define COMSIG_KB_CLIENT_WHISPER_DOWN "keybinding_client_whisper_down"
#define COMSIG_KB_CLIENT_DO_DOWN "keybinding_client_do_down"
#define COMSIG_KB_CLIENT_DO_LONGER_DOWN "keybinding_client_do_longer_down"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/~doppler_defines/ooc_channels.dm
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
1 change: 1 addition & 0 deletions code/__DEFINES/~doppler_defines/speech_channels.dm
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
24 changes: 24 additions & 0 deletions code/_globalvars/~doppler_globalvars/ooc_channels.dm
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,
))
Comment on lines +4 to +17
Copy link
Copy Markdown
Collaborator

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


/// AOOC
#define AOOC_COLOR "#ff5967"
GLOBAL_VAR_INIT(aooc_allowed, TRUE)

/// Backstage
GLOBAL_VAR_INIT(backstage_allowed, TRUE)
3 changes: 3 additions & 0 deletions code/modules/tgui_input/say_modal/speech.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
if(WHIS_CHANNEL)
client.mob.whisper_verb(entry)
return TRUE
if(BACKSTAGE_CHANNEL)
client.backstage(entry)
return TRUE
if(DO_CHANNEL)
client.mob.do_verb(entry)
if(IRC_CHANNEL)
Expand Down
39 changes: 11 additions & 28 deletions modular_doppler/administration/code/aooc.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
GLOBAL_VAR_INIT(AOOC_COLOR, "#de3c8c")
GLOBAL_VAR_INIT(aooc_allowed, TRUE) // used with admin verbs to disable aooc - not a config option
GLOBAL_LIST_EMPTY(ckey_to_aooc_name)

#define AOOC_LISTEN_PLAYER 1
#define AOOC_LISTEN_ADMIN 2

/client/verb/aooc(msg as text)
set name = "AOOC"
set name = "OOC: Antag"
set category = "OOC"

if(GLOB.say_disabled) //This is here to try to identify lag problems
Expand Down Expand Up @@ -45,40 +38,30 @@ GLOBAL_LIST_EMPTY(ckey_to_aooc_name)
return

mob.log_talk(raw_msg, LOG_OOC, tag = "AOOC")

var/keyname = key
var/anon = FALSE

//Anonimity for players and deadminned admins
if(!holder || holder.deadmined)
if(!GLOB.ckey_to_aooc_name[key])
GLOB.ckey_to_aooc_name[key] = "Operator [pick(GLOB.phonetic_alphabet)] [rand(1, 99)]"
keyname = GLOB.ckey_to_aooc_name[key]
anon = TRUE

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] = AOOC_LISTEN_PLAYER
listeners[antag_mind.current.client] = LISTEN_PLAYER

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 AOOC, 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)
listeners[iterated_mob.client] = AOOC_LISTEN_ADMIN
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

for(var/iterated_listener as anything in listeners)
var/client/iterated_client = iterated_listener
var/mode = listeners[iterated_listener]
var/color = (!anon && CONFIG_GET(flag/allow_admin_ooccolor) && iterated_client?.prefs?.read_preference(/datum/preference/color/ooc_color)) ? iterated_client?.prefs?.read_preference(/datum/preference/color/ooc_color) : GLOB.AOOC_COLOR
var/name = (mode == AOOC_LISTEN_ADMIN && anon) ? "([key])[keyname]" : keyname
to_chat(iterated_client, span_oocplain("<font color='[color]'><b><span class='prefix'>AOOC:</span> <EM>[name]:</EM> <span class='message linkify'>[msg]</span></b></font>"))

#undef AOOC_LISTEN_PLAYER
#undef AOOC_LISTEN_ADMIN
var/name = (mode == LISTEN_ADMIN) ? "([key]) [mob.real_name]" : mob?.real_name
to_chat(iterated_client, span_oocplain("<font color='[ooc_channel_color(mob)]'>Private (A): [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_aooc(toggle = null)
if(toggle != null) //if we're specifically en/disabling aooc
Expand All @@ -102,7 +85,7 @@ GLOBAL_LIST_EMPTY(ckey_to_aooc_name)
var/client/iterated_client = iterated_listener
to_chat(iterated_client, span_oocplain("<B>The AOOC channel has been globally [GLOB.aooc_allowed ? "enabled" : "disabled"].</B>"))

ADMIN_VERB(toggleaooc, R_ADMIN, "Toggle Antag OOC", "Toggles Antag OOC.", ADMIN_CATEGORY_SERVER)
ADMIN_VERB(toggle_aooc, R_ADMIN, "Toggle Antag OOC", "Toggles Antag OOC.", ADMIN_CATEGORY_SERVER)
toggle_aooc()
log_admin("[key_name(usr)] toggled Antagonist OOC.")
message_admins("[key_name_admin(usr)] toggled Antagonist OOC.")
Expand Down
94 changes: 94 additions & 0 deletions modular_doppler/administration/code/asooc.dm
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(!mob)
if(isnull(mob))

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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
i.e.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we do this in this order?
if we're only gonna use raw_msg for logging like 5 lines down why not just like

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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
like next to the early GLOB.say_disabled and !mob checks


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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick

Suggested change
if(iterated_mob.client?.holder && !iterated_mob.client?.holder?.deadmined && iterated_mob.client?.prefs?.chat_toggles & CHAT_OOC)
if(iterated_mob.client?.holder && !iterated_mob.client?.holder?.deadmined && (iterated_mob.client?.prefs?.chat_toggles & CHAT_OOC))

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]))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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
so really we should should split this off into separate get_backstage_role(...) proc so we can re-use it here, and it's less easy to accidentally make these checks different-- like further down in the toggle we only do antags and admins while we should also do backstage crew

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am i tripping or like doesn't as anything let you do

	for(var/client/iterated_client as anything in listeners)

var/mode = listeners[iterated_listener]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: var/listening_mode

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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>"))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

span_bold instead of <B>/<B> ?

Comment on lines +75 to +88
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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 get_backstage_role(...) proc suggestion


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!
39 changes: 39 additions & 0 deletions modular_doppler/administration/code/flavor.dm
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)
63 changes: 63 additions & 0 deletions modular_doppler/administration/code/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,66 @@
return FALSE

return is_admin(preferences.parent)


/datum/preference/choiced/ooc_channel_emoji_sec
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "ooc_channel_emoji_sec"
savefile_identifier = PREFERENCE_PLAYER

/datum/preference/choiced/ooc_channel_emoji_sec/create_default_value()
return "shades"

/datum/preference/choiced/ooc_channel_emoji_sec/init_possible_values()
return list(
"shades",
"flash",
"flashbang",
"whiskey",
"riot",
"up",
"help",
"cam",
"disarm",
"thinking",
"drone",
"taser",
"charged",
"on",
"thelaw",
"salt",
"popcorn",
"donut",
"donut2",
)

/datum/preference/choiced/ooc_channel_emoji_tot
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "ooc_channel_emoji_tot"
savefile_identifier = PREFERENCE_PLAYER

/datum/preference/choiced/ooc_channel_emoji_tot/create_default_value()
return "toysword"

/datum/preference/choiced/ooc_channel_emoji_tot/init_possible_values()
return list(
"toysword",
"c4",
"revolver",
"disk",
"pepper",
"fedora",
"rollie",
"down",
"flush",
"swarmer",
"call",
"cultie",
"haxxor",
"sbomb",
"conbaton",
"trap",
"sink",
"grab",
"harm",
)
Loading
Loading