mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-21 03:56:47 +01:00
Adds audible belching preference toggle, makes belch emote respect it
Preferences can now handle a list being passed to them, and will require all items in the list to be true. Singular datums work to preserve legacy behavior. Audible belching will REQUIRE "Emote Noises" and "Audible Belching" preferences to be enabled. Figured there'd be a potential shitstorm, and honestly adding the preference was easier than I thought. This will work if for w/e reason you decide to add farting noises - a simple pref toggle, and bingo. Etc etc. <3
This commit is contained in:
@@ -83,9 +83,17 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/**
|
||||
* This can take either a single preference datum or a list of preferences, and will return true if *all* preferences in the arguments are enabled.
|
||||
*/
|
||||
/client/proc/is_preference_enabled(var/preference)
|
||||
var/datum/client_preference/cp = get_client_preference(preference)
|
||||
return cp && (cp.key in prefs.preferences_enabled)
|
||||
if(!islist(preference))
|
||||
preference = list(preference)
|
||||
for(var/p in preference)
|
||||
var/datum/client_preference/cp = get_client_preference(p)
|
||||
if(!cp || !(cp.key in prefs.preferences_enabled))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/client/proc/set_preference(var/preference, var/set_preference)
|
||||
var/datum/client_preference/cp = get_client_preference(preference)
|
||||
|
||||
@@ -95,6 +95,13 @@ var/list/_client_preferences_by_type
|
||||
key = "DIGEST_NOISES"
|
||||
enabled_description = "Noisy"
|
||||
disabled_description = "Silent"
|
||||
|
||||
/datum/client_preference/belch_noises // Belching noises - pref toggle for 'em
|
||||
description = "Burping"
|
||||
key = "BELCH_NOISES"
|
||||
enabled_description = "Noisy"
|
||||
disabled_description = "Silent"
|
||||
enabled_by_default = FALSE
|
||||
|
||||
/datum/client_preference/emote_noises
|
||||
description = "Emote Noises" //MERP
|
||||
|
||||
Reference in New Issue
Block a user