mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 19:51:59 +00:00
* Adds Preferences To Suppress Ghost Role Rolls (#68102) Hey there, Ever since November of 2021, I've wanted something where I could simply not get any ghost roles while adminned. Some people also do not want to get any ghost rolls whatsoever when they play, for it is their personal preference. This PR seeks to resolve both of these issues with two new preferences. The first preference will show up to everyone, Suppress All Ghost Rolls. It will return on the main proc that pops up the window, does the sound, all that. You will not hear a peep of a word out of your game. This is dangerous if you like playing as ghost roles, but if you abhor the thought of it... it's just for you. The second preference is for admins. You can selectively suppress ghost roles while adminned. This is useful because when you're running an event or doing stuff where you need to offer multiple ghost roles (or you need to focus on a ticket and someone is spamming Xenobiology mob spawns), this is absolutely perfect for suppressing. Same return as the player option, but it checks to see if you are currently adminned via the client.holder variable. This is just because some admins (i'm some admins) don't want to turn in on just in case they forget to turn it off down the line because they actually play the game (lying). There's probably a much cleaner way to do this code-wise, but I couldn't figure it out. Any help is appreciated. I tested it extensively on my local (even using a guest account), and everything seems to work rather nicely after about an hour of trial-and-error. Why It's Good For The Game Players who want to just alt-tab or maybe chill in deadchat (or have an extreme loathing of ghost roles) can just simply not get any of that. Admins who want to focus on tickets and not have windows pop up to interfere in good administrative work (and be the most annoying thing in the world) can also do that. Everyone is happy. Changelog cl qol: There is now a new preference in Game Preferences, Suppress All Ghost Rolls. If you tick this preference, you will not get a singular window pop-up whenever a Ghost Role is available. Intended for the few who really do need it. admin: Admins get another additional preference where Suppress All Ghost Roles only works while they are currently in an adminned state. They will still get ghost rolls normally when they are in a deadminned state. /cl * Adds Preferences To Suppress Ghost Role Rolls Co-authored-by: san7890 <the@san7890.com>
65 lines
2.0 KiB
Plaintext
65 lines
2.0 KiB
Plaintext
/datum/preference/color/asay_color
|
|
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
|
savefile_key = "asaycolor"
|
|
savefile_identifier = PREFERENCE_PLAYER
|
|
|
|
/datum/preference/color/asay_color/create_default_value()
|
|
return DEFAULT_ASAY_COLOR
|
|
|
|
/datum/preference/color/asay_color/is_accessible(datum/preferences/preferences)
|
|
if (!..(preferences))
|
|
return FALSE
|
|
|
|
return is_admin(preferences.parent) && CONFIG_GET(flag/allow_admin_asaycolor)
|
|
|
|
/// What outfit to equip when spawning as a briefing officer for an ERT
|
|
/datum/preference/choiced/brief_outfit
|
|
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
|
savefile_key = "brief_outfit"
|
|
savefile_identifier = PREFERENCE_PLAYER
|
|
|
|
/datum/preference/choiced/brief_outfit/deserialize(input, datum/preferences/preferences)
|
|
var/path = text2path(input)
|
|
if (!ispath(path, /datum/outfit))
|
|
return create_default_value()
|
|
|
|
return path
|
|
|
|
/datum/preference/choiced/brief_outfit/serialize(input)
|
|
return "[input]"
|
|
|
|
/datum/preference/choiced/brief_outfit/create_default_value()
|
|
return /datum/outfit/centcom/commander
|
|
|
|
/datum/preference/choiced/brief_outfit/init_possible_values()
|
|
return subtypesof(/datum/outfit)
|
|
|
|
/datum/preference/choiced/brief_outfit/is_accessible(datum/preferences/preferences)
|
|
if (!..(preferences))
|
|
return FALSE
|
|
|
|
return is_admin(preferences.parent)
|
|
|
|
/datum/preference/toggle/bypass_deadmin_in_centcom
|
|
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
|
savefile_key = "bypass_deadmin_in_centcom"
|
|
savefile_identifier = PREFERENCE_PLAYER
|
|
|
|
/datum/preference/toggle/bypass_deadmin_in_centcom/is_accessible(datum/preferences/preferences)
|
|
if (!..(preferences))
|
|
return FALSE
|
|
|
|
return is_admin(preferences.parent)
|
|
|
|
/// When enabled, prevents any and all ghost role pop-ups WHILE ADMINNED.
|
|
/datum/preference/toggle/ghost_roles_as_admin
|
|
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
|
savefile_key = "ghost_roles_as_admin"
|
|
savefile_identifier = PREFERENCE_PLAYER
|
|
|
|
/datum/preference/toggle/ghost_roles_as_admin/is_accessible(datum/preferences/preferences)
|
|
if (!..(preferences))
|
|
return FALSE
|
|
|
|
return is_admin(preferences.parent)
|