mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
[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:
@@ -69,21 +69,6 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
var/datum/quirk/wayfinder = /datum/quirk/item_quirk/needswayfinder
|
||||
if(user.add_quirk(wayfinder))
|
||||
SSblackbox.record_feedback("nested tally", "quirks_taken", 1, list(initial(wayfinder.name)))
|
||||
|
||||
|
||||
// SKYRAT EDIT ADDITION START - Customization (food prefs)
|
||||
// This was done in this proc on old skyrat and i cba to find a better way
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(istype(H))
|
||||
if(cli.prefs.foodlikes.len)
|
||||
H.dna.species.liked_food = 0
|
||||
for(var/V in cli.prefs.foodlikes)
|
||||
H.dna.species.liked_food |= cli.prefs.foodlikes[V]
|
||||
if(cli.prefs.fooddislikes.len)
|
||||
H.dna.species.disliked_food = 0
|
||||
for(var/V in cli.prefs.fooddislikes)
|
||||
H.dna.species.disliked_food |= cli.prefs.fooddislikes[V]
|
||||
// SKYRAT EDIT ADDITION END
|
||||
/*
|
||||
*Randomises the quirks for a specified mob
|
||||
*/
|
||||
@@ -147,5 +132,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