mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Add preference for variable pitch emotes
This commit is contained in:
@@ -187,7 +187,13 @@ var/global/list/emotes_by_key
|
||||
if(islist(sound_to_play) && length(sound_to_play))
|
||||
sound_to_play = pick(sound_to_play)
|
||||
if(sound_to_play)
|
||||
playsound(user.loc, sound_to_play, use_sound["vol"], sound_vary, frequency = null, preference = sound_preferences) //VOREStation Add - Preference
|
||||
//CHOMPEdit Add - Preference for variable pitch
|
||||
if(istype(user, /mob))
|
||||
var/mob/u = user
|
||||
playsound(user.loc, sound_to_play, use_sound["vol"], u.is_preference_enabled(/datum/client_preference/random_emote_pitch) && sound_vary, frequency = null, preference = sound_preferences)
|
||||
else
|
||||
playsound(user.loc, sound_to_play, use_sound["vol"], sound_vary, frequency = null, preference = sound_preferences) //VOREStation Add - Preference
|
||||
//CHOMPEdit End - Previous line used to be outside an if/else before the edit.
|
||||
|
||||
/decl/emote/proc/mob_can_use(var/mob/user)
|
||||
return istype(user) && user.stat != DEAD && (type in user.get_available_emotes())
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/datum/client_preference/random_emote_pitch
|
||||
description ="Random emote pitch"
|
||||
key = "EMOTE_VARY"
|
||||
enabled_description = "Will be Random"
|
||||
disabled_description = "Will not be Random"
|
||||
14
modular_chomp/code/modules/client/preferences.dm
Normal file
14
modular_chomp/code/modules/client/preferences.dm
Normal file
@@ -0,0 +1,14 @@
|
||||
/client/verb/toggle_random_emote_pitch()
|
||||
set name = "Toggle Random Emote Pitch"
|
||||
set category = "Preferences"
|
||||
set desc = "Toggles whether or not emotes with sound you make will have random pitch."
|
||||
|
||||
var/pref_path = /datum/client_preference/random_emote_pitch
|
||||
|
||||
toggle_preference(pref_path)
|
||||
|
||||
to_chat(src, "Audible emotes you make will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] have a random pitch applied to them.")
|
||||
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TRandomEmotePitch") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -4478,6 +4478,8 @@
|
||||
#include "maps\submaps\surface_submaps\wilderness\wilderness_areas.dm"
|
||||
#include "maps\~map_system\maps.dm"
|
||||
#include "modular_chomp\code\modules\admin\functions\modify_traits.dm"
|
||||
#include "modular_chomp\code\modules\client\preferences.dm"
|
||||
#include "modular_chomp\code\modules\client\preference_setup\global\setting_datums.dm"
|
||||
#include "modular_chomp\code\modules\clothing\spacesuits\rig\rig.dm"
|
||||
#include "modular_chomp\code\modules\datums\supplypacks\medical.dm"
|
||||
#include "modular_chomp\code\modules\datums\supplypacks\munitions.dm"
|
||||
|
||||
Reference in New Issue
Block a user