Admin prefs stuff (#41041)

fixes #41106 since it'll have it's own fucking location.

cl ShizCalev
add: Admins can now personalize their asay message color on servers with the feature enabled.
tweak: Moved some admin only preference verbs out of the Preferences tab and to a new admin preferences tab to help unclutter it / prevent accidental toggling of fun things.
/cl

Note that the start of the admin message will still use the default formatting just so it can be quickly recognized as an admin message and not an OOC one.
This commit is contained in:
ShizCalev
2018-10-24 18:43:30 -04:00
committed by yogstation13-bot
parent 635f4aa821
commit 82d13f079c
8 changed files with 82 additions and 25 deletions

View File

@@ -63,6 +63,8 @@
/datum/config_entry/flag/allow_admin_ooccolor // Allows admins with relevant permissions to have their own ooc colour /datum/config_entry/flag/allow_admin_ooccolor // Allows admins with relevant permissions to have their own ooc colour
/datum/config_entry/flag/allow_admin_asaycolor //Allows admins with relevant permissions to have a personalized asay color
/datum/config_entry/flag/allow_vote_restart // allow votes to restart /datum/config_entry/flag/allow_vote_restart // allow votes to restart
/datum/config_entry/flag/allow_vote_mode // allow votes to change mode /datum/config_entry/flag/allow_vote_mode // allow votes to change mode

View File

@@ -71,6 +71,9 @@ GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin())
/client/proc/open_shuttle_manipulator, /* Opens shuttle manipulator UI */ /client/proc/open_shuttle_manipulator, /* Opens shuttle manipulator UI */
/client/proc/deadchat, /client/proc/deadchat,
/client/proc/toggleprayers, /client/proc/toggleprayers,
/client/proc/toggle_prayer_sound,
/client/proc/colorasay,
/client/proc/resetasaycolor,
/client/proc/toggleadminhelpsound, /client/proc/toggleadminhelpsound,
/client/proc/respawn_character, /client/proc/respawn_character,
/datum/admins/proc/open_borgopanel, /datum/admins/proc/open_borgopanel,

View File

@@ -11,9 +11,9 @@
return return
mob.log_talk(msg, LOG_ASAY) mob.log_talk(msg, LOG_ASAY)
msg = keywords_lookup(msg) msg = keywords_lookup(msg)
msg = "<span class='adminsay'><span class='prefix'>ADMIN:</span> <EM>[key_name(usr, 1)]</EM> [ADMIN_FLW(mob)]: <span class='message linkify'>[msg]</span></span>" var/custom_asay_color = (CONFIG_GET(flag/allow_admin_asaycolor) && prefs.asaycolor) ? "<font color=[prefs.asaycolor]>" : null
msg = "<span class='adminsay'><span class='prefix'>ADMIN:</span> <EM>[key_name(usr, 1)]</EM> [ADMIN_FLW(mob)]: [custom_asay_color]<span class='message linkify'>[msg]</span></span>[custom_asay_color ? "</font>":null]"
to_chat(GLOB.admins, msg) to_chat(GLOB.admins, msg)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Asay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! SSblackbox.record_feedback("tally", "admin_verb", 1, "Asay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -19,6 +19,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//game-preferences //game-preferences
var/lastchangelog = "" //Saved changlog filesize to detect if there was a change var/lastchangelog = "" //Saved changlog filesize to detect if there was a change
var/ooccolor = null var/ooccolor = null
var/asaycolor = null
var/enable_tips = TRUE var/enable_tips = TRUE
var/tip_delay = 500 //tip delay in milliseconds var/tip_delay = 500 //tip delay in milliseconds
@@ -598,11 +599,17 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<h2>Admin Settings</h2>" dat += "<h2>Admin Settings</h2>"
dat += "<b>Adminhelp Sounds:</b> <a href='?_src_=prefs;preference=hear_adminhelps'>[(toggles & SOUND_ADMINHELP)?"Enabled":"Disabled"]</a><br>" dat += "<b>Adminhelp Sounds:</b> <a href='?_src_=prefs;preference=hear_adminhelps'>[(toggles & SOUND_ADMINHELP)?"Enabled":"Disabled"]</a><br>"
dat += "<b>Prayer Sounds:</b> <a href = '?_src_=prefs;preference=hear_prayers'>[(toggles & SOUND_PRAYERS)?"Enabled":"Disabled"]</a><br>"
dat += "<b>Announce Login:</b> <a href='?_src_=prefs;preference=announce_login'>[(toggles & ANNOUNCE_LOGIN)?"Enabled":"Disabled"]</a><br>" dat += "<b>Announce Login:</b> <a href='?_src_=prefs;preference=announce_login'>[(toggles & ANNOUNCE_LOGIN)?"Enabled":"Disabled"]</a><br>"
dat += "<br>" dat += "<br>"
dat += "<b>Combo HUD Lighting:</b> <a href = '?_src_=prefs;preference=combohud_lighting'>[(toggles & COMBOHUD_LIGHTING)?"Full-bright":"No Change"]</a><br>" dat += "<b>Combo HUD Lighting:</b> <a href = '?_src_=prefs;preference=combohud_lighting'>[(toggles & COMBOHUD_LIGHTING)?"Full-bright":"No Change"]</a><br>"
dat += "<br>" dat += "<br>"
dat += "<b>Silence Radio Messages:</b> <a href = '?_src_=prefs;preference=toggle_radio_chatter'>[(chat_toggles & CHAT_RADIO)?"Disabled":"Enabled"]</a><br>" dat += "<b>Hide Dead Chat:</b> <a href = '?_src_=prefs;preference=toggle_dead_chat'>[(chat_toggles & CHAT_DEAD)?"Shown":"Hidden"]</a><br>"
dat += "<b>Hide Radio Messages:</b> <a href = '?_src_=prefs;preference=toggle_radio_chatter'>[(chat_toggles & CHAT_RADIO)?"Shown":"Hidden"]</a><br>"
dat += "<b>Hide Prayers:</b> <a href = '?_src_=prefs;preference=toggle_prayers'>[(chat_toggles & CHAT_PRAYER)?"Shown":"Hidden"]</a><br>"
if(CONFIG_GET(flag/allow_admin_asaycolor))
dat += "<br>"
dat += "<b>ASAY Color:</b> <span style='border: 1px solid #161616; background-color: [asaycolor ? asaycolor : "#FF4500"];'>&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=asaycolor;task=input'>Change</a><br>"
dat += "</td>" dat += "</td>"
dat += "</tr></table>" dat += "</tr></table>"
// yogs start - Donor features // yogs start - Donor features
@@ -1438,6 +1445,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(new_ooccolor) if(new_ooccolor)
ooccolor = new_ooccolor ooccolor = new_ooccolor
if("asaycolor")
var/new_asaycolor = input(user, "Choose your ASAY color:", "Game Preference",asaycolor) as color|null
if(new_asaycolor)
asaycolor = new_asaycolor
if("bag") if("bag")
var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in GLOB.backbaglist var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in GLOB.backbaglist
if(new_backbag) if(new_backbag)
@@ -1533,12 +1545,18 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//here lies the badmins //here lies the badmins
if("hear_adminhelps") if("hear_adminhelps")
user.client.toggleadminhelpsound() user.client.toggleadminhelpsound()
if("hear_prayers")
user.client.toggle_prayer_sound()
if("announce_login") if("announce_login")
user.client.toggleannouncelogin() user.client.toggleannouncelogin()
if("combohud_lighting") if("combohud_lighting")
toggles ^= COMBOHUD_LIGHTING toggles ^= COMBOHUD_LIGHTING
if("toggle_dead_chat")
user.client.deadchat()
if("toggle_radio_chatter") if("toggle_radio_chatter")
user.client.toggle_hear_radio() user.client.toggle_hear_radio()
if("toggle_prayers")
user.client.toggleprayers()
if("be_special") if("be_special")
var/be_special_type = href_list["be_special_type"] var/be_special_type = href_list["be_special_type"]

View File

@@ -71,6 +71,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
return 0 return 0
//general preferences //general preferences
S["asaycolor"] >> asaycolor
S["ooccolor"] >> ooccolor S["ooccolor"] >> ooccolor
S["lastchangelog"] >> lastchangelog S["lastchangelog"] >> lastchangelog
S["UI_style"] >> UI_style S["UI_style"] >> UI_style
@@ -116,6 +117,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
update_preferences(needs_update, S) //needs_update = savefile_version if we need an update (positive integer) update_preferences(needs_update, S) //needs_update = savefile_version if we need an update (positive integer)
//Sanitize //Sanitize
asaycolor = sanitize_ooccolor(sanitize_hexcolor(asaycolor, 6, 1, initial(asaycolor)))
ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor))) ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor)))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog)) lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
UI_style = sanitize_inlist(UI_style, GLOB.available_ui_styles, GLOB.available_ui_styles[1]) UI_style = sanitize_inlist(UI_style, GLOB.available_ui_styles, GLOB.available_ui_styles[1])
@@ -161,6 +163,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["version"] , SAVEFILE_VERSION_MAX) //updates (or failing that the sanity checks) will ensure data is not invalid at load. Assume up-to-date WRITE_FILE(S["version"] , SAVEFILE_VERSION_MAX) //updates (or failing that the sanity checks) will ensure data is not invalid at load. Assume up-to-date
//general preferences //general preferences
WRITE_FILE(S["asaycolor"], asaycolor)
WRITE_FILE(S["ooccolor"], ooccolor) WRITE_FILE(S["ooccolor"], ooccolor)
WRITE_FILE(S["lastchangelog"], lastchangelog) WRITE_FILE(S["lastchangelog"], lastchangelog)
WRITE_FILE(S["UI_style"], UI_style) WRITE_FILE(S["UI_style"], UI_style)

View File

@@ -213,21 +213,6 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_announcement_sound)()
return C.prefs.toggles & SOUND_ANNOUNCEMENTS return C.prefs.toggles & SOUND_ANNOUNCEMENTS
TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggleprayersounds)()
set name = "Hear/Silence Prayer Sounds"
set category = "Preferences"
set desc = "Hear Prayer Sounds"
usr.client.prefs.toggles ^= SOUND_PRAYERS
usr.client.prefs.save_preferences()
if(usr.client.prefs.toggles & SOUND_PRAYERS)
to_chat(usr, "You will now hear prayer sounds.")
else
to_chat(usr, "You will no longer prayer sounds.")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Sounds", "[usr.client.prefs.toggles & SOUND_PRAYERS ? "Enabled" : "Disabled"]"))
/datum/verbs/menu/Settings/Sound/toggleprayersounds/Get_checked(client/C)
return C.prefs.toggles & SOUND_PRAYERS
/datum/verbs/menu/Settings/Sound/verb/stop_client_sounds() /datum/verbs/menu/Settings/Sound/verb/stop_client_sounds()
set name = "Stop Sounds" set name = "Stop Sounds"
set category = "Preferences" set category = "Preferences"
@@ -367,7 +352,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS
//Admin Preferences //Admin Preferences
/client/proc/toggleadminhelpsound() /client/proc/toggleadminhelpsound()
set name = "Hear/Silence Adminhelps" set name = "Hear/Silence Adminhelps"
set category = "Preferences" set category = "Prefs - Admin"
set desc = "Toggle hearing a notification when admin PMs are received" set desc = "Toggle hearing a notification when admin PMs are received"
if(!holder) if(!holder)
return return
@@ -378,7 +363,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS
/client/proc/toggleannouncelogin() /client/proc/toggleannouncelogin()
set name = "Do/Don't Announce Login" set name = "Do/Don't Announce Login"
set category = "Preferences" set category = "Prefs - Admin"
set desc = "Toggle if you want an announcement to admins when you login during a round" set desc = "Toggle if you want an announcement to admins when you login during a round"
if(!holder) if(!holder)
return return
@@ -389,7 +374,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS
/client/proc/toggle_hear_radio() /client/proc/toggle_hear_radio()
set name = "Show/Hide Radio Chatter" set name = "Show/Hide Radio Chatter"
set category = "Preferences" set category = "Prefs - Admin"
set desc = "Toggle seeing radiochatter from nearby radios and speakers" set desc = "Toggle seeing radiochatter from nearby radios and speakers"
if(!holder) if(!holder)
return return
@@ -400,8 +385,10 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS
/client/proc/deadchat() /client/proc/deadchat()
set name = "Show/Hide Deadchat" set name = "Show/Hide Deadchat"
set category = "Preferences" set category = "Prefs - Admin"
set desc ="Toggles seeing deadchat" set desc ="Toggles seeing deadchat"
if(!holder)
return
prefs.chat_toggles ^= CHAT_DEAD prefs.chat_toggles ^= CHAT_DEAD
prefs.save_preferences() prefs.save_preferences()
to_chat(src, "You will [(prefs.chat_toggles & CHAT_DEAD) ? "now" : "no longer"] see deadchat.") to_chat(src, "You will [(prefs.chat_toggles & CHAT_DEAD) ? "now" : "no longer"] see deadchat.")
@@ -409,9 +396,50 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS
/client/proc/toggleprayers() /client/proc/toggleprayers()
set name = "Show/Hide Prayers" set name = "Show/Hide Prayers"
set category = "Preferences" set category = "Prefs - Admin"
set desc = "Toggles seeing prayers" set desc = "Toggles seeing prayers"
if(!holder)
return
prefs.chat_toggles ^= CHAT_PRAYER prefs.chat_toggles ^= CHAT_PRAYER
prefs.save_preferences() prefs.save_preferences()
to_chat(src, "You will [(prefs.chat_toggles & CHAT_PRAYER) ? "now" : "no longer"] see prayerchat.") to_chat(src, "You will [(prefs.chat_toggles & CHAT_PRAYER) ? "now" : "no longer"] see prayerchat.")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Visibility", "[prefs.chat_toggles & CHAT_PRAYER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Visibility", "[prefs.chat_toggles & CHAT_PRAYER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggle_prayer_sound()
set name = "Hear/Silence Prayer Sounds"
set category = "Prefs - Admin"
set desc = "Hear Prayer Sounds"
if(!holder)
return
prefs.toggles ^= SOUND_PRAYERS
prefs.save_preferences()
to_chat(usr, "You will [(prefs.toggles & SOUND_PRAYERS) ? "now" : "no longer"] hear a sound when prayers arrive.")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Sounds", "[usr.client.prefs.toggles & SOUND_PRAYERS ? "Enabled" : "Disabled"]"))
/client/proc/colorasay()
set name = "Set Admin Say Color"
set category = "Prefs - Admin"
set desc = "Set the color of your ASAY messages"
if(!holder)
return
if(!CONFIG_GET(flag/allow_admin_asaycolor))
to_chat(src, "Custom Asay color is currently disabled by the server.")
return
var/new_asaycolor = input(src, "Please select your ASAY color.", "ASAY color", prefs.asaycolor) as color|null
if(new_asaycolor)
prefs.asaycolor = sanitize_ooccolor(new_asaycolor)
prefs.save_preferences()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Set ASAY Color")
return
/client/proc/resetasaycolor()
set name = "Reset your Admin Say Color"
set desc = "Returns your ASAY Color to default"
set category = "Prefs - Admin"
if(!holder)
return
if(!CONFIG_GET(flag/allow_admin_asaycolor))
to_chat(src, "Custom Asay color is currently disabled by the server.")
return
prefs.asaycolor = initial(prefs.asaycolor)
prefs.save_preferences()

View File

@@ -1,5 +1,5 @@
/client/verb/toggle_tips() /client/verb/toggle_tips()
set name = "Toggle examine tooltips" set name = "Toggle Examine Tooltips"
set desc = "Toggles examine hover-over tooltips" set desc = "Toggles examine hover-over tooltips"
set category = "Preferences" set category = "Preferences"
@@ -8,7 +8,7 @@
to_chat(usr, "<span class='danger'>Examine tooltips [prefs.enable_tips ? "en" : "dis"]abled.</span>") to_chat(usr, "<span class='danger'>Examine tooltips [prefs.enable_tips ? "en" : "dis"]abled.</span>")
/client/verb/change_tip_delay() /client/verb/change_tip_delay()
set name = "Set examine tooltip delay" set name = "Set Examine Tooltip Delay"
set desc = "Sets the delay in milliseconds before examine tooltips appear" set desc = "Sets the delay in milliseconds before examine tooltips appear"
set category = "Preferences" set category = "Preferences"

View File

@@ -155,6 +155,9 @@ PICTURE_LOGGING_CAMERA
## Comment this out to stop admins being able to choose their personal ooccolor ## Comment this out to stop admins being able to choose their personal ooccolor
ALLOW_ADMIN_OOCCOLOR ALLOW_ADMIN_OOCCOLOR
## Comment this out to stop admins being able to choose their personal asay color
ALLOW_ADMIN_ASAYCOLOR
## Job slot open/close by identification consoles delay in seconds ## Job slot open/close by identification consoles delay in seconds
ID_CONSOLE_JOBSLOT_DELAY 30 ID_CONSOLE_JOBSLOT_DELAY 30