mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-17 11:05:16 +01:00
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:
@@ -133,5 +133,66 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
for(var/datum/quirk/quirk as anything in quirks_to_add)
|
||||
user.add_quirk(quirks[quirk]) //these are typepaths converted from string
|
||||
|
||||
/// Takes a list of quirk names and returns a new list of quirks that would
|
||||
/// be valid.
|
||||
/// If no changes need to be made, will return the same list.
|
||||
/// Expects all quirk names to be unique, but makes no other expectations.
|
||||
/datum/controller/subsystem/processing/quirks/proc/filter_invalid_quirks(list/quirks)
|
||||
var/list/new_quirks = list()
|
||||
var/list/positive_quirks = list()
|
||||
var/balance = 0
|
||||
|
||||
for (var/quirk_name in quirks)
|
||||
var/datum/quirk/quirk = SSquirks.quirks[quirk_name]
|
||||
if (isnull(quirk))
|
||||
continue
|
||||
|
||||
if (initial(quirk.mood_quirk) && CONFIG_GET(flag/disable_human_mood))
|
||||
continue
|
||||
|
||||
var/blacklisted = FALSE
|
||||
|
||||
for (var/list/blacklist as anything in quirk_blacklist)
|
||||
if (!(quirk in blacklist))
|
||||
continue
|
||||
|
||||
for (var/other_quirk in blacklist)
|
||||
if (other_quirk in new_quirks)
|
||||
blacklisted = TRUE
|
||||
break
|
||||
|
||||
if (blacklisted)
|
||||
break
|
||||
|
||||
if (blacklisted)
|
||||
continue
|
||||
|
||||
var/value = initial(quirk.value)
|
||||
if (value > 0)
|
||||
if (positive_quirks.len == MAX_QUIRKS)
|
||||
continue
|
||||
|
||||
positive_quirks[quirk_name] = value
|
||||
|
||||
balance += value
|
||||
new_quirks += quirk_name
|
||||
|
||||
if (balance > 0)
|
||||
var/balance_left_to_remove = balance
|
||||
|
||||
for (var/positive_quirk in positive_quirks)
|
||||
var/value = positive_quirks[positive_quirk]
|
||||
balance_left_to_remove -= value
|
||||
new_quirks -= positive_quirk
|
||||
|
||||
if (balance_left_to_remove <= 0)
|
||||
break
|
||||
|
||||
// It is guaranteed that if no quirks are invalid, you can simply check through `==`
|
||||
if (new_quirks.len == quirks.len)
|
||||
return quirks
|
||||
|
||||
return new_quirks
|
||||
|
||||
#undef RANDOM_QUIRK_BONUS
|
||||
#undef MINIMUM_RANDOM_QUIRKS
|
||||
|
||||
@@ -17,7 +17,6 @@ PROCESSING_SUBSYSTEM_DEF(reagents)
|
||||
///Blacklists these reagents from being added to the master list. the exact type only. Children are not blacklisted.
|
||||
GLOB.fake_reagent_blacklist = list(/datum/reagent/medicine/c2, /datum/reagent/medicine, /datum/reagent/reaction_agent)
|
||||
//Build GLOB lists - see holder.dm
|
||||
build_chemical_reagent_list()
|
||||
build_chemical_reactions_lists()
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user