tgui Preferences Menu + total rewrite of the preferences backend (#61313)

About The Pull Request

Rewrites the entire preferences menu in tgui. Rewrites the entire backend to be built upon datumized preferences, rather than constant additions to the preferences base datum.

Splits game preferences into its own window.

Antagonists are now split into their individual rulesets. You can now be a roundstart heretic without signing up for latejoin heretic, as an example.

This iteration matches parity, and provides very little new functionality, but adding anything new will be much easier.

Fixes #60823
Fixes #28907
Fixes #44887
Fixes #59912
Fixes #58458
Fixes #59181
Major TODOs

Quirk icons, from @Fikou (with some slight adjustments from me)
Lore text, from @EOBGames (4/6, need moths and then ethereal lore from @AMonkeyThatCodes)
Heavy documentation on how one would add new preferences, species, jobs, etc

    A lot of specialized testing so that people's real data don't get corrupted

Changelog

cl Mothblocks, Floyd on lots of the design
refactor: The preferences menu has been completely rewritten in tgui.
refactor: The "Stop Sounds" verb has been moved to OOC.
/cl
This commit is contained in:
Mothblocks
2021-09-14 15:11:11 -07:00
committed by GitHub
parent a3dfa16a98
commit 5a4c87a9fc
423 changed files with 12860 additions and 3995 deletions
-8
View File
@@ -11,8 +11,6 @@ GLOBAL_PROTECT(admin_verbs_default)
/client/proc/dsay, /*talk in deadchat using our ckey/fakekey*/
/client/proc/investigate_show, /*various admintools for investigation. Such as a singulo grief-log*/
/client/proc/secrets,
/client/proc/toggle_hear_radio, /*allows admins to hide all radio output*/
/client/proc/toggle_split_admin_tabs,
/client/proc/reload_admins,
/client/proc/reestablish_db_connection, /*reattempt a connection to the database*/
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
@@ -73,12 +71,6 @@ GLOBAL_PROTECT(admin_verbs_admin)
/client/proc/toggle_combo_hud, // toggle display of the combination pizza antag and taco sci/med/eng hud
/client/proc/toggle_AI_interact, /*toggle admin ability to interact with machines as an AI*/
/datum/admins/proc/open_shuttlepanel, /* Opens shuttle manipulator UI */
/client/proc/deadchat,
/client/proc/toggleprayers,
/client/proc/toggle_prayer_sound,
/client/proc/colorasay,
/client/proc/resetasaycolor,
/client/proc/toggleadminhelpsound,
/client/proc/respawn_character,
/datum/admins/proc/open_borgopanel,
/datum/admins/proc/view_all_circuits,
+2 -2
View File
@@ -229,7 +229,7 @@
output += "<hr style='background:#000000; border:0; height:3px'>"
var/datum/browser/panel = new(usr, "pmpanel", "Poll Management Panel", 780, 640)
panel.add_stylesheet("admin_panelscss", 'html/admin/admin_panels.css')
if(usr.client.prefs.tgui_fancy) //some browsers (IE8) have trouble with unsupported css3 elements that break the panel's functionality, so we won't load those if a user is in no frills tgui mode since that's for similar compatability support
if(usr.client.prefs.read_preference(/datum/preference/toggle/tgui_fancy)) //some browsers (IE8) have trouble with unsupported css3 elements that break the panel's functionality, so we won't load those if a user is in no frills tgui mode since that's for similar compatability support
panel.add_stylesheet("admin_panelscss3", 'html/admin/admin_panels_css3.css')
panel.set_content(jointext(output, ""))
panel.open()
@@ -527,7 +527,7 @@
panel_height = 320
var/datum/browser/panel = new(usr, "popanel", "Poll Option Panel", 370, panel_height)
panel.add_stylesheet("admin_panelscss", 'html/admin/admin_panels.css')
if(usr.client.prefs.tgui_fancy) //some browsers (IE8) have trouble with unsupported css3 elements that break the panel's functionality, so we won't load those if a user is in no frills tgui mode since that's for similar compatability support
if(usr.client.prefs.read_preference(/datum/preference/toggle/tgui_fancy)) //some browsers (IE8) have trouble with unsupported css3 elements that break the panel's functionality, so we won't load those if a user is in no frills tgui mode since that's for similar compatability support
panel.add_stylesheet("admin_panelscss3", 'html/admin/admin_panels_css3.css')
panel.set_content(jointext(output, ""))
panel.open()
@@ -28,7 +28,7 @@
return FALSE
if(friend_candidate_client.prefs)
random_appearance = tgui_alert(user, "Do you want the imaginary friend to look like and be named after [friend_candidate_client]'s current preferences ([friend_candidate_client.prefs.real_name])?", "Imaginary Friend Appearance?", list("Look-a-like", "Random")) == "Random"
random_appearance = tgui_alert(user, "Do you want the imaginary friend to look like and be named after [friend_candidate_client]'s current preferences ([friend_candidate_client.prefs.read_preference(/datum/preference/name/real_name)])?", "Imaginary Friend Appearance?", list("Look-a-like", "Random")) == "Random"
else
random_appearance = TRUE
+4 -1
View File
@@ -119,7 +119,7 @@
var/datum/browser/panel = new(usr, "banpanel", "Banning Panel", 910, panel_height)
panel.add_stylesheet("admin_panelscss", 'html/admin/admin_panels.css')
panel.add_stylesheet("banpanelcss", 'html/admin/banpanel.css')
var/tgui_fancy = usr.client.prefs.tgui_fancy
var/tgui_fancy = usr.client.prefs.read_preference(/datum/preference/toggle/tgui_fancy)
if(tgui_fancy) //some browsers (IE8) have trouble with unsupported css3 elements and DOM methods that break the panel's functionality, so we won't load those if a user is in no frills tgui mode since that's for similar compatability support
panel.add_stylesheet("admin_panelscss3", 'html/admin/admin_panels_css3.css')
panel.add_script("banpaneljs", 'html/admin/banpanel.js')
@@ -316,6 +316,9 @@
ROLE_REV,
ROLE_REVENANT,
ROLE_REV_HEAD,
ROLE_SENTIENT_DISEASE,
ROLE_SPIDER,
ROLE_SWARMER,
ROLE_SYNDICATE,
ROLE_TRAITOR,
ROLE_WIZARD,
+1 -1
View File
@@ -386,7 +386,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(view_size.getView() == view_size.default)
view_size.setTo(input("Select view range:", "FUCK YE", 7) in list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,37) - 7)
else
view_size.resetToDefault(getScreenSize(prefs.widescreenpref))
view_size.resetToDefault(getScreenSize(prefs.read_preference(/datum/preference/toggle/widescreen)))
log_admin("[key_name(usr)] changed their view range to [view].")
//message_admins("\blue [key_name_admin(usr)] changed their view range to [view].") //why? removed by order of XSI
+2 -1
View File
@@ -11,7 +11,8 @@
mob.log_talk(msg, LOG_ASAY)
msg = keywords_lookup(msg)
var/custom_asay_color = (CONFIG_GET(flag/allow_admin_asaycolor) && prefs.asaycolor) ? "<font color=[prefs.asaycolor]>" : "<font color='#FF4500'>"
var/asay_color = prefs.read_preference(/datum/preference/color/asay_color)
var/custom_asay_color = (CONFIG_GET(flag/allow_admin_asaycolor) && asay_color) ? "<font color=[asay_color]>" : "<font color='[DEFAULT_ASAY_COLOR]'>"
msg = "[span_adminsay("[span_prefix("ADMIN:")] <EM>[key_name(usr, 1)]</EM> [ADMIN_FLW(mob)]: [custom_asay_color]<span class='message linkify'>[msg]")]</span>[custom_asay_color ? "</font>":null]"
to_chat(GLOB.admins,
type = MESSAGE_TYPE_ADMINCHAT,
+4 -3
View File
@@ -113,9 +113,8 @@ GLOBAL_DATUM(current_anonymous_theme, /datum/anonymous_theme)
continue
var/old_name = player.real_name //before restoration
if(issilicon(player))
player.apply_pref_name("[isAI(player) ? "ai" : "cyborg"]", player.client)
player.apply_pref_name("[isAI(player) ? /datum/preference/name/ai : /datum/preference/name/cyborg]", player.client)
else
player.client.prefs.sanitize_chosen_prefs() // Just in case they changed unlawfully.
player.client.prefs.apply_prefs_to(player) // This is not sound logic, as the prefs may have changed since then.
player.fully_replace_character_name(old_name, player.real_name) //this changes IDs and PDAs and whatnot
@@ -131,7 +130,9 @@ GLOBAL_DATUM(current_anonymous_theme, /datum/anonymous_theme)
* * target - mob for preferences and gender
*/
/datum/anonymous_theme/proc/anonymous_name(mob/target)
return target.client.prefs.pref_species.random_name(target.gender,1)
var/species_type = target.client.prefs.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type
return species.random_name(target.gender,1)
/**
* anonymous_ai_name: generates a random name, based off of whatever the round's anonymousnames is set to (but for sillycones).
+1 -1
View File
@@ -119,7 +119,7 @@
if(ertemplate.spawn_admin)
if(isobserver(usr))
var/mob/living/carbon/human/admin_officer = new (spawnpoints[1])
var/chosen_outfit = usr.client?.prefs?.brief_outfit
var/chosen_outfit = usr.client?.prefs?.read_preference(/datum/preference/choiced/brief_outfit)
usr.client.prefs.safe_transfer_prefs_to(admin_officer, is_antag = TRUE)
admin_officer.equipOutfit(chosen_outfit)
admin_officer.key = usr.key