[MIRROR] Minor ERT refactor, introduces a few ERT admin options (#3339)

* Minor ERT refactor, introduces a few ERT admin options (#56345)

* Minor ERT refactor, introduces a few ERT admin options

* Proper Modularisation Protocol

* Update preferences.dm

Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-02-13 11:12:01 +00:00
committed by GitHub
co-authored by Ryll Ryll Gandalf2k15
parent 7522def83c
commit 39121c53ce
12 changed files with 209 additions and 551 deletions
+13
View File
@@ -18,6 +18,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/lastchangelog = "" //Saved changlog filesize to detect if there was a change
var/ooccolor = "#c43b23"
var/asaycolor = "#ff4500" //This won't change the color for current admins, only incoming ones.
/// If we spawn an ERT as an admin and choose to spawn as the briefing officer, we'll be given this outfit
var/brief_outfit = /datum/outfit/centcom/commander
var/enable_tips = TRUE
var/tip_delay = 500 //tip delay in milliseconds
@@ -735,6 +737,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
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>"
dat += "<b>Ignore Being Summoned as Cult Ghost:</b> <a href = '?_src_=prefs;preference=toggle_ignore_cult_ghost'>[(toggles & ADMIN_IGNORE_CULT_GHOST)?"Don't Allow Being Summoned":"Allow Being Summoned"]</a><br>"
dat += "<b>Briefing Officer Outfit:</b> <a href = '?_src_=prefs;preference=briefoutfit;task=input'>[brief_outfit]</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>"
@@ -1515,6 +1518,16 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(new_asaycolor)
asaycolor = sanitize_ooccolor(new_asaycolor)
if("briefoutfit")
var/list/valid_paths = list()
for(var/datum/outfit/iter_outfit in subtypesof(/datum/outfit))
if(initial(iter_outfit.can_be_admin_equipped))
valid_paths[initial(iter_outfit.name)] = path
var/new_outfit = input(user, "Choose your briefing officer outfit:", "Game Preference") as null|anything in valid_paths
new_outfit = valid_paths[new_outfit]
if(new_outfit)
brief_outfit = new_outfit
if("bag")
var/new_backpack = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in GLOB.backpacklist
if(new_backpack)
@@ -161,6 +161,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
//general preferences
READ_FILE(S["asaycolor"], asaycolor)
READ_FILE(S["brief_outfit"], brief_outfit)
READ_FILE(S["ooccolor"], ooccolor)
READ_FILE(S["lastchangelog"], lastchangelog)
READ_FILE(S["UI_style"], UI_style)
@@ -251,6 +252,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
ghost_others = sanitize_inlist(ghost_others, GLOB.ghost_others_options, GHOST_OTHERS_DEFAULT_OPTION)
menuoptions = SANITIZE_LIST(menuoptions)
be_special = SANITIZE_LIST(be_special)
brief_outfit = sanitize_inlist(brief_outfit, subtypesof(/datum/outfit), null)
pda_style = sanitize_inlist(pda_style, GLOB.pda_styles, initial(pda_style))
pda_color = sanitize_hexcolor(pda_color, 6, 1, initial(pda_color))
key_bindings = sanitize_keybindings(key_bindings)
@@ -287,6 +289,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
//general preferences
WRITE_FILE(S["asaycolor"], asaycolor)
WRITE_FILE(S["brief_outfit"], brief_outfit)
WRITE_FILE(S["ooccolor"], ooccolor)
WRITE_FILE(S["lastchangelog"], lastchangelog)
WRITE_FILE(S["UI_style"], UI_style)