[MIRROR] tgui Preferences Menu + total rewrite of the preferences backend (#8153)

* tgui Preferences Menu + total rewrite of the preferences backend

* nah, we dont need to ping those people

* trying to remove the funny stuff

* unmodularizing this

* prefs reset

* this may need to be reverted, who knows

* okay, this part

* perhaps

* EEEEEEEEE

* unsanitary

* E

* Stage 1 + loadout system

* more fixes

* E

* I mean, it launches?

* More fixes and reorganisation

* E

* customisation code is spaget.

* disable ERP prefs

* Update erp_preferences.dm

* Update erp_preferences.dm

* E

* Slowly getting there

* It may be time for help :)

* tri...colors... help

* preferences now pass preferences

* Update dna.dm

* Fuck this man

* missing savefile return, set_species works, removed dumb stuff from updateappearance

* https://github.com/Skyrat-SS13/Skyrat-tg/pull/8199

* https://github.com/Skyrat-SS13/Skyrat-tg/pull/8224

* https://github.com/tgstation/tgstation/pull/61519

* https://github.com/Skyrat-SS13/Skyrat-tg/pull/8278

* e

* le butonAZARAK HELLO

* hhh

* Proper recognition where it's due, MrMelbert!

* EEEE

* examine block

* Better gen hit sounds from whitedream

* final loadout touches, more bug fixes im sure to come

* i said there would be bugfixes

* Update LoadoutManager.js

* Missing preferences in the html menu

* LIVE TESTING PHASE BABY

* Update LoadoutManager.js

* EEE

* LAUNCH TEST FIRE

* Update job.dm

* Update new_player.dm

* 50gb DAY ONE PATCH

* EEE

* Update preferences.dm

* buggle fixes

* Update examine.dm

* >LOOC starts on

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
SkyratBot
2021-09-23 01:40:37 +02:00
committed by GitHub
parent a5bfc42228
commit 124ddd7cca
582 changed files with 19548 additions and 8366 deletions
+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
@@ -121,7 +121,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
+6 -3
View File
@@ -56,7 +56,7 @@ GLOBAL_DATUM(highlander_controller, /datum/highlander_controller)
* * setup_list: list of all the datum setups (fancy list of roles) that would work for the game
* * ready_players: list of filtered, sane players (so not playing or disconnected) for the game to put into roles
*/
/datum/highlander_controller/proc/new_highlander(mob/living/carbon/human/new_crewmember, rank)
/datum/highlander_controller/proc/new_highlander(datum/source, mob/living/new_crewmember, rank)
SIGNAL_HANDLER
to_chat(new_crewmember, span_userdanger("<i>THERE CAN BE ONLY ONE!!!</i>"))
@@ -90,8 +90,11 @@ GLOBAL_DATUM(highlander_controller, /datum/highlander_controller)
log_admin("[key_name(usr)] used delayed THERE CAN BE ONLY ONE.")
addtimer(CALLBACK(src, .proc/only_one, TRUE), 42 SECONDS)
/mob/living/carbon/human/proc/make_scottish()
/mob/living/proc/make_scottish()
return
/mob/living/carbon/human/make_scottish()
mind.add_antag_datum(/datum/antagonist/highlander)
/mob/living/silicon/robot/proc/make_scottish()
/mob/living/silicon/robot/make_scottish()
mind.add_antag_datum(/datum/antagonist/highlander/robot)
+35 -13
View File
@@ -1,3 +1,5 @@
GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
/client/proc/secrets() //Creates a verb for admins to open up the ui
set name = "Secrets"
set desc = "Abuse harder than you ever have before with this handy dandy semi-misc stuff menu"
@@ -448,24 +450,16 @@
if(!SSticker.HasRoundStarted())
tgui_alert(usr,"The game hasn't started yet!")
return
if(GLOB.everyone_a_traitor)
tgui_alert(usr, "The everyone is a traitor secret has already been triggered")
return
var/objective = stripped_input(holder, "Enter an objective")
if(!objective)
return
GLOB.everyone_a_traitor = new /datum/everyone_is_a_traitor_controller(objective)
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Traitor All", "[objective]"))
for(var/mob/living/player in GLOB.player_list)
if(!(ishuman(player)||istype(player, /mob/living/silicon/)))
continue
if(player.stat == DEAD || !player.mind || ispAI(player))
continue
if(is_special_character(player))
continue
var/datum/antagonist/traitor/traitor_datum = new()
traitor_datum.give_objectives = FALSE
var/datum/objective/new_objective = new
new_objective.owner = player
new_objective.explanation_text = objective
traitor_datum.objectives += new_objective
player.mind.add_antag_datum(traitor_datum)
GLOB.everyone_a_traitor.make_traitor(null, player)
message_admins(span_adminnotice("[key_name_admin(holder)] used everyone is a traitor secret. Objective is [objective]"))
log_admin("[key_name(holder)] used everyone is a traitor secret. Objective is [objective]")
if("massbraindamage")
@@ -612,3 +606,31 @@
var/turf/T = get_step(loc, SOUTHWEST)
flick_overlay_static(portal_appearance, T, 15)
playsound(T, 'sound/magic/lightningbolt.ogg', rand(80, 100), TRUE)
///Makes sure latejoining crewmembers also become traitors.
/datum/everyone_is_a_traitor_controller
var/objective = ""
/datum/everyone_is_a_traitor_controller/New(objective)
src.objective = objective
RegisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED, .proc/make_traitor)
/datum/everyone_is_a_traitor_controller/Destroy()
UnregisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED)
return ..()
/datum/everyone_is_a_traitor_controller/proc/make_traitor(datum/source, mob/living/player)
SIGNAL_HANDLER
if(player.stat == DEAD || !player.mind)
return
if(!(ishuman(player) || issilicon(player)) || ispAI(player))
return
if(is_special_character(player))
return
var/datum/antagonist/traitor/traitor_datum = new()
traitor_datum.give_objectives = FALSE
var/datum/objective/new_objective = new
new_objective.owner = player
new_objective.explanation_text = objective
traitor_datum.objectives += new_objective
player.mind.add_antag_datum(traitor_datum)