/tg/ pref datums (part 1) (#16219)

* TG Prefs (Step 1: JSON savefiles)

* TG Prefs (Step 2: Preference Datum Code)

* TG Prefs (Step 3: Convert /datum/client_preferences)

* TG Prefs (Step 4: Clean up and finishing touches)

* Fix some weird compile errors from the rebase
This commit is contained in:
ShadowLarkens
2024-08-31 07:09:05 +10:00
committed by GitHub
parent 0cfc6e9e94
commit faac97e352
184 changed files with 4968 additions and 2198 deletions
+1 -2
View File
@@ -238,8 +238,7 @@ note dizziness decrements automatically in the mob's Life() proc.
//Check for clients with pref enabled
var/list/viewing = list()
for(var/mob/M as anything in viewers(A))
var/client/C = M.client
if(C && C.is_preference_enabled(/datum/client_preference/attack_icons))
if(M.client?.prefs?.read_preference(/datum/preference/toggle/attack_icons))
viewing += M.client
//Animals attacking each other in the distance, probably. Forgeddaboutit.
+1 -1
View File
@@ -11,7 +11,7 @@
to_chat(src, "<span class='danger'>You cannot send deadchat emotes (muted).</span>")
return
if(!is_preference_enabled(/datum/client_preference/show_dsay))
if(!client?.prefs?.read_preference(/datum/preference/toggle/show_dsay))
to_chat(src, "<span class='danger'>You have deadchat muted.</span>")
return
+7 -7
View File
@@ -66,7 +66,7 @@
if(!client && !teleop)
return FALSE
if(isobserver(src) && is_preference_enabled(/datum/client_preference/ghost_ears))
if(isobserver(src) && client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears))
if(speaker && !speaker.client && !(speaker in view(src)))
//Does the speaker have a client? It's either random stuff that observers won't care about (Experiment 97B says, 'EHEHEHEHEHEHEHE')
//Or someone snoring. So we make it where they won't hear it.
@@ -108,7 +108,7 @@
if(speaker_name != speaker.real_name && speaker.real_name)
speaker_name = "[speaker.real_name] ([speaker_name])"
track = "([ghost_follow_link(speaker, src)]) "
if(is_preference_enabled(/datum/client_preference/ghost_ears) && (speaker in view(src)))
if(client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears) && (speaker in view(src)))
message = "<b>[message]</b>"
if(is_deaf())
@@ -119,7 +119,7 @@
else
var/message_to_send = null
message_to_send = "<span class='name'>[speaker_name]</span>[speaker.GetAltName()] [track][message]"
if(check_mentioned(multilingual_to_message(message_pieces)) && is_preference_enabled(/datum/client_preference/check_mention))
if(check_mentioned(multilingual_to_message(message_pieces)) && client?.prefs?.read_preference(/datum/preference/toggle/check_mention))
message_to_send = "<font size='3'><b>[message_to_send]</b></font>"
on_hear_say(message_to_send, speaker)
@@ -227,7 +227,7 @@
if(client.prefs.chat_timestamp)
time = say_timestamp()
var/final_message = "[part_b][speaker_name][part_c][formatted][part_d]"
if(check_mentioned(formatted) && is_preference_enabled(/datum/client_preference/check_mention))
if(check_mentioned(formatted) && client?.prefs?.read_preference(/datum/preference/toggle/check_mention))
final_message = "[time][part_a]<font size='3'><b>[final_message]</b></font>[part_e]"
else
final_message = "[time][part_a][final_message][part_e]"
@@ -238,7 +238,7 @@
if(client.prefs.chat_timestamp)
time = say_timestamp()
var/final_message = "[part_b][track][part_c][formatted][part_d]"
if(check_mentioned(formatted) && is_preference_enabled(/datum/client_preference/check_mention))
if(check_mentioned(formatted) && client?.prefs?.read_preference(/datum/preference/toggle/check_mention))
final_message = "[time][part_a]<font size='3'><b>[final_message]</b></font>[part_e]"
else
final_message = "[time][part_a][final_message][part_e]"
@@ -249,7 +249,7 @@
if(client.prefs.chat_timestamp)
time = say_timestamp()
var/final_message = "[part_b][speaker_name][part_c][formatted][part_d]"
if(check_mentioned(formatted) && is_preference_enabled(/datum/client_preference/check_mention))
if(check_mentioned(formatted) && client?.prefs?.read_preference(/datum/preference/toggle/check_mention))
final_message = "[time][part_a]<font size='3'><b>[final_message]</b></font>[part_e]"
else
final_message = "[time][part_a][final_message][part_e]"
@@ -260,7 +260,7 @@
if(client.prefs.chat_timestamp)
time = say_timestamp()
var/final_message = "[part_b][track][part_c][formatted][part_d]"
if(check_mentioned(formatted) && is_preference_enabled(/datum/client_preference/check_mention))
if(check_mentioned(formatted) && client?.prefs?.read_preference(/datum/preference/toggle/check_mention))
final_message = "[time][part_a]<font size='3'><b>[final_message]</b></font>[part_e]"
else
final_message = "[time][part_a][final_message][part_e]"
+2 -2
View File
@@ -26,7 +26,7 @@
for (var/mob/M in dead_mob_list)
if(!istype(M,/mob/new_player) && !istype(M,/mob/living/carbon/brain)) //No meta-evesdropping
var/message_to_send = span_binary("[message_start] ([ghost_follow_link(speaker, M)]) [message_body]")
if(M.check_mentioned(message) && M.is_preference_enabled(/datum/client_preference/check_mention))
if(M.check_mentioned(message) && M.client?.prefs?.read_preference(/datum/preference/toggle/check_mention))
message_to_send = "<font size='3'><b>[message_to_send]</b></font>"
M.show_message(message_to_send, 2)
@@ -39,7 +39,7 @@
continue
var/message_to_send = span_binary("[message_start] [message_body]")
if(S.check_mentioned(message) && S.is_preference_enabled(/datum/client_preference/check_mention))
if(S.check_mentioned(message) && S.client?.prefs?.read_preference(/datum/preference/toggle/check_mention))
message_to_send = "<font size='3'><b>[message_to_send]</b></font>"
S.show_message(message_to_send, 2)
@@ -84,7 +84,7 @@
if(mind)
// SSgame_master.adjust_danger(gibbed ? 40 : 20) // VOREStation Edit - We don't use SSgame_master yet.
for(var/mob/observer/dead/O in mob_list)
if(O.client && O.client.is_preference_enabled(/datum/client_preference/show_dsay))
if(O.client?.prefs?.read_preference(/datum/preference/toggle/show_dsay))
to_chat(O, "<span class='deadsay'><b>[src]</b> has died in <b>[get_area(src)]</b>. [ghost_follow_link(src, O)] </span>")
if(!gibbed && species.death_sound)
+3 -3
View File
@@ -1167,7 +1167,7 @@
if(noisy == TRUE && nutrition < 250 && prob(10)) //VOREStation edit for hunger noises.
var/sound/growlsound = sound(get_sfx("hunger_sounds"))
var/growlmultiplier = 100 - (nutrition / 250 * 100)
playsound(src, growlsound, vol = growlmultiplier, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises)
playsound(src, growlsound, vol = growlmultiplier, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/preference/toggle/digestion_noises)
// VOREStation Edit End
if((CE_DARKSIGHT in chem_effects) && chemical_darksight == 0)
@@ -1248,7 +1248,7 @@
if(fear)
fear = (fear - 1)
if(fear >= 80 && is_preference_enabled(/datum/client_preference/play_ambiance))
if(fear >= 80 && client?.prefs?.read_preference(/datum/preference/toggle/play_ambience))
if(last_fear_sound + 51 SECONDS <= world.time)
src << sound('sound/effects/Heart Beat.ogg',0,0,0,25)
last_fear_sound = world.time
@@ -1989,7 +1989,7 @@
if(!H || (H.robotic >= ORGAN_ROBOT))
return
if(pulse >= PULSE_2FAST || shock_stage >= 10 || (istype(get_turf(src), /turf/space) && is_preference_enabled(/datum/client_preference/play_ambiance)))
if(pulse >= PULSE_2FAST || shock_stage >= 10 || (istype(get_turf(src), /turf/space) && read_preference(/datum/preference/toggle/play_ambience)))
//PULSE_THREADY - maximum value for pulse, currently it 5.
//High pulse value corresponds to a fast rate of heartbeat.
//Divided by 2, otherwise it is too slow.
+2 -2
View File
@@ -48,7 +48,7 @@
item_dropped = r_hand
. = drop_r_hand(Target)
if (istype(item_dropped) && !QDELETED(item_dropped) && is_preference_enabled(/datum/client_preference/drop_sounds))
if (istype(item_dropped) && !QDELETED(item_dropped) && check_sound_preference(/datum/preference/toggle/drop_sounds))
addtimer(CALLBACK(src, PROC_REF(make_item_drop_sound), item_dropped), 1)
/mob/proc/make_item_drop_sound(obj/item/I)
@@ -56,7 +56,7 @@
return
if(I.drop_sound)
playsound(I, I.drop_sound, 25, 0, preference = /datum/client_preference/drop_sounds)
playsound(I, I.drop_sound, 25, 0, preference = /datum/preference/toggle/drop_sounds)
//Drops the item in our left hand
+1 -1
View File
@@ -39,7 +39,7 @@
if(client)
var/idle_limit = 10 MINUTES
if(client.inactivity >= idle_limit && !away_from_keyboard && src.is_preference_enabled(/datum/client_preference/auto_afk)) //if we're not already afk and we've been idle too long, and we have automarking enabled... then automark it
if(client.inactivity >= idle_limit && !away_from_keyboard && client.prefs?.read_preference(/datum/preference/toggle/auto_afk)) //if we're not already afk and we've been idle too long, and we have automarking enabled... then automark it
add_status_indicator("afk")
to_chat(src, "<span class='notice'>You have been idle for too long, and automatically marked as AFK.</span>")
away_from_keyboard = TRUE
+5 -5
View File
@@ -363,14 +363,14 @@ var/list/channel_to_radio_key = new
if(M && src) //If we still exist, when the spawn processes
//VOREStation Add - Ghosts don't hear whispers
if(whispering && isobserver(M) && (!M.is_preference_enabled(/datum/client_preference/ghost_see_whisubtle) || \
(!is_preference_enabled(/datum/client_preference/whisubtle_vis) && !M.client?.holder)))
if(whispering && isobserver(M) && (!M.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle) || \
(!client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) && !M.client?.holder)))
M.show_message("<span class='game say'><span class='name'>[src.name]</span> [w_not_heard].</span>", 2)
return
//VOREStation Add End
var/dst = get_dist(get_turf(M),get_turf(src))
var/runechat_enabled = M.client?.is_preference_enabled(/datum/client_preference/runechat_mob)
var/runechat_enabled = M.client?.prefs?.read_preference(/datum/preference/toggle/runechat_mob)
if(dst <= message_range || (M.stat == DEAD && !forbid_seeing_deadchat)) //Inside normal message range, or dead with ears (handled in the view proc)
if(M.hear_say(message_pieces, verb, italics, src, speech_sound, sound_vol))
@@ -413,12 +413,12 @@ var/list/channel_to_radio_key = new
message = "([message_mode == "headset" ? "Common" : capitalize(message_mode)]) [message]" //Adds radio keys used if available
if(whispering)
if(do_sound && message)
playsound(T, pick(voice_sounds_list), 25, TRUE, extrarange = -6, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/client_preference/whisper_sounds)
playsound(T, pick(voice_sounds_list), 25, TRUE, extrarange = -6, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/preference/toggle/whisper_sounds)
log_whisper(message, src)
else
if(do_sound && message)
playsound(T, pick(voice_sounds_list), 75, TRUE, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/client_preference/say_sounds)
playsound(T, pick(voice_sounds_list), 75, TRUE, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/preference/toggle/say_sounds)
log_say(message, src)
return 1
@@ -512,9 +512,9 @@
for (var/mob/G in player_list)
if (istype(G, /mob/new_player))
continue
else if(isobserver(G) && G.is_preference_enabled(/datum/client_preference/ghost_ears))
if((is_preference_enabled(/datum/client_preference/whisubtle_vis) || G.client.holder) && \
G.is_preference_enabled(/datum/client_preference/ghost_see_whisubtle))
else if(isobserver(G) && G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears))
if((client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) || G.client.holder) && \
G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle))
to_chat(G, "<span class='filter_say cult'>[src.name]'s screen prints, \"[message]\"</span>")
/mob/living/silicon/pai/proc/touch_window(soft_name) //This lets us touch TGUI procs and windows that may be nested behind other TGUI procs and windows
@@ -91,7 +91,7 @@
if(do_after(user, 30, target) && length(contents) < max_item_count)
target.forceMove(src)
user.visible_message("<span class='warning'>[hound.name]'s [src.name] groans lightly as [target.name] slips inside.</span>", "<span class='notice'>Your [src.name] groans lightly as [target] slips inside.</span>")
playsound(src, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/client_preference/eating_noises)
playsound(src, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/preference/toggle/eating_noises)
if(analyzer && istype(target,/obj/item))
var/obj/item/tech_item = target
var/list/tech_levels = list()
@@ -111,7 +111,7 @@
trashmouse.forceMove(src)
trashmouse.reset_view(src)
user.visible_message("<span class='warning'>[hound.name]'s [src.name] groans lightly as [trashmouse] slips inside.</span>", "<span class='notice'>Your [src.name] groans lightly as [trashmouse] slips inside.</span>")
playsound(src, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/client_preference/eating_noises)
playsound(src, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/preference/toggle/eating_noises)
if(delivery)
if(islist(deliverylists[delivery_tag]))
deliverylists[delivery_tag] |= trashmouse
@@ -133,7 +133,7 @@
START_PROCESSING(SSobj, src)
user.visible_message("<span class='warning'>[hound.name]'s [src.name] groans lightly as [trashman] slips inside.</span>", "<span class='notice'>Your [src.name] groans lightly as [trashman] slips inside.</span>")
log_admin("[key_name(hound)] has eaten [key_name(patient)] with a cyborg belly. ([hound ? "<a href='?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[hound.x];Y=[hound.y];Z=[hound.z]'>JMP</a>" : "null"])")
playsound(src, gulpsound, vol = 100, vary = 1, falloff = 0.1, preference = /datum/client_preference/eating_noises)
playsound(src, gulpsound, vol = 100, vary = 1, falloff = 0.1, preference = /datum/preference/toggle/eating_noises)
if(delivery)
if(islist(deliverylists[delivery_tag]))
deliverylists[delivery_tag] |= trashman
@@ -164,7 +164,7 @@
START_PROCESSING(SSobj, src)
user.visible_message("<span class='warning'>[hound.name]'s [src.name] lights up as [H.name] slips inside.</span>", "<span class='notice'>Your [src] lights up as [H] slips inside. Life support functions engaged.</span>")
log_admin("[key_name(hound)] has eaten [key_name(patient)] with a cyborg belly. ([hound ? "<a href='?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[hound.x];Y=[hound.y];Z=[hound.z]'>JMP</a>" : "null"])")
playsound(src, gulpsound, vol = 100, vary = 1, falloff = 0.1, preference = /datum/client_preference/eating_noises)
playsound(src, gulpsound, vol = 100, vary = 1, falloff = 0.1, preference = /datum/preference/toggle/eating_noises)
/obj/item/device/dogborg/sleeper/proc/ingest_atom(var/atom/ingesting)
if (!ingesting || ingesting == hound)
@@ -551,11 +551,11 @@
'sound/vore/death8.ogg',
'sound/vore/death9.ogg',
'sound/vore/death10.ogg')
playsound(src, finisher, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises)
playsound(src, finisher, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/preference/toggle/digestion_noises)
to_chat(hound, "<span class='notice'>Your [src.name] is now clean. Ending self-cleaning cycle.</span>")
cleaning = 0
update_patient()
playsound(src, 'sound/machines/ding.ogg', vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises)
playsound(src, 'sound/machines/ding.ogg', vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/preference/toggle/digestion_noises)
return
if(prob(20))
@@ -572,7 +572,7 @@
'sound/vore/digest10.ogg',
'sound/vore/digest11.ogg',
'sound/vore/digest12.ogg')
playsound(src, churnsound, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises)
playsound(src, churnsound, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/preference/toggle/digestion_noises)
//If the timing is right, and there are items to be touched
if(air_master.current_cycle%3==1 && length(touchable_items))
@@ -606,7 +606,7 @@
'sound/vore/death8.ogg',
'sound/vore/death9.ogg',
'sound/vore/death10.ogg')
playsound(src, deathsound, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises)
playsound(src, deathsound, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/preference/toggle/digestion_noises)
if(is_vore_predator(T))
for(var/obj/belly/B as anything in T.vore_organs)
for(var/atom/movable/thing in B)
@@ -32,8 +32,8 @@
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
continue
else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears))
else if(M.stat == DEAD && M.client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears))
if(M.client)
to_chat(M, "<b>[src]</b> transmits, \"[message]\"")
return 1
return ..()
return ..()
@@ -500,14 +500,14 @@
for(var/mob/M as anything in vis_mobs)
if(isnewplayer(M))
continue
if(isobserver(M) && (!M.is_preference_enabled(/datum/client_preference/ghost_see_whisubtle) || \
!L.is_preference_enabled(/datum/client_preference/whisubtle_vis) && !M.client?.holder))
if(isobserver(M) && (!M.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle) || \
!L.client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) && !M.client?.holder))
spawn(0)
M.show_message(undisplayed_message, 2)
else
spawn(0)
M.show_message(message, 2)
if(M.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(M.read_preference(/datum/preference/toggle/subtle_sounds))
M << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
/decl/flooring/fur
@@ -930,7 +930,7 @@
spawnstuff = FALSE
/area/redgate/stardog/flesh_abyss/play_ambience(var/mob/living/L, initial = TRUE)
if(!L.is_preference_enabled(/datum/client_preference/digestion_noises))
if(!L.check_sound_preference(/datum/preference/toggle/digestion_noises))
return
..()
@@ -1172,14 +1172,14 @@
for(var/mob/M as anything in vis_mobs)
if(isnewplayer(M))
continue
if(isobserver(M) && (!M.is_preference_enabled(/datum/client_preference/ghost_see_whisubtle) || \
!L.is_preference_enabled(/datum/client_preference/whisubtle_vis) && !M.client?.holder))
if(isobserver(M) && (!M.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle) || \
!L.client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) && !M.client?.holder))
spawn(0)
M.show_message(undisplayed_message, 2)
else
spawn(0)
M.show_message(message, 2)
if(M.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(M.read_preference(/datum/preference/toggle/subtle_sounds))
M << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
/area/redgate/stardog/eyes
@@ -1335,8 +1335,8 @@
var/go = FALSE
if(isobserver(AM))
return
playsound(src, teleport_sound, vol = 100, vary = 1, preference = /datum/client_preference/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
playsound(target, teleport_sound, vol = 100, vary = 1, preference = /datum/client_preference/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
playsound(src, teleport_sound, vol = 100, vary = 1, preference = /datum/preference/toggle/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
playsound(target, teleport_sound, vol = 100, vary = 1, preference = /datum/preference/toggle/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
if(isliving(AM))
var/mob/living/L = AM
if(teleport_message && L.client)
@@ -1374,7 +1374,7 @@
var/mob/living/simple_mob/vore/overmap/stardog/dog = s.parent
dog.adjust_nutrition(I.reagents.total_volume)
dog.adjust_affinity(25)
playsound(src, teleport_sound, vol = 100, vary = 1, preference = /datum/client_preference/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
playsound(src, teleport_sound, vol = 100, vary = 1, preference = /datum/preference/toggle/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
visible_message("<span class='warning'>The dog gobbles up \the [I]!</span>")
if(dog.client)
to_chat(dog, "<span class='notice'>[I.thrower ? "\The [I.thrower]" : "Someone"] feeds \the [I] to you!</span>")
@@ -1699,7 +1699,7 @@
/obj/structure/auto_flesh_door/proc/Open()
isSwitchingStates = 1
var/oursound = pick(open_sounds)
playsound(src, oursound, 100, 1, preference = /datum/client_preference/digestion_noises , volume_channel = VOLUME_CHANNEL_VORE)
playsound(src, oursound, 100, 1, preference = /datum/preference/toggle/digestion_noises , volume_channel = VOLUME_CHANNEL_VORE)
flick("flesh-opening",src)
sleep(8)
density = FALSE
@@ -1715,7 +1715,7 @@
/obj/structure/auto_flesh_door/proc/Close()
isSwitchingStates = 1
var/oursound = pick(open_sounds)
playsound(src, oursound, 100, 1, preference = /datum/client_preference/digestion_noises , volume_channel = VOLUME_CHANNEL_VORE)
playsound(src, oursound, 100, 1, preference = /datum/preference/toggle/digestion_noises , volume_channel = VOLUME_CHANNEL_VORE)
flick("flesh-closing",src)
sleep(8)
density = TRUE
@@ -266,7 +266,7 @@
for(var/mob/M in player_list)
if(istype(M, /mob/new_player))
continue
else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears))
else if(M.stat == DEAD && M.client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears))
to_chat(M, "[src.true_name] whispers to [host], \"[message]\"")
@@ -28,7 +28,7 @@
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
continue
else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears))
else if(M.stat == DEAD && M.client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears))
to_chat(M, "The captive mind of [src] whispers, \"[message]\"")
/mob/living/captive_brain/me_verb(message as text)
+2 -2
View File
@@ -63,12 +63,12 @@
recalculate_vis()
// AO support
var/ao_enabled = client.is_preference_enabled(/datum/client_preference/ambient_occlusion)
var/ao_enabled = client.prefs?.read_preference(/datum/preference/toggle/ambient_occlusion)
plane_holder.set_ao(VIS_OBJS, ao_enabled)
plane_holder.set_ao(VIS_MOBS, ao_enabled)
// Status indicators
var/status_enabled = client.is_preference_enabled(/datum/client_preference/status_indicators)
var/status_enabled = client.prefs?.read_preference(/datum/preference/toggle/status_indicators)
plane_holder.set_vis(VIS_STATUS, status_enabled)
//set macro to normal incase it was overriden (like cyborg currently does)
+6 -8
View File
@@ -1305,20 +1305,18 @@
return TRUE
/mob/MouseEntered(location, control, params)
if(usr != src && usr.is_preference_enabled(/datum/client_preference/mob_tooltips) && src.will_show_tooltip())
openToolTip(user = usr, tip_src = src, params = params, title = get_nametag_name(usr), content = get_nametag_desc(usr))
..()
if(usr != src && will_show_tooltip())
if(usr?.read_preference(/datum/preference/toggle/mob_tooltips))
openToolTip(usr, src, params, title = get_nametag_name(usr), content = get_nametag_desc(usr))
. = ..()
/mob/MouseDown()
closeToolTip(usr) //No reason not to, really
..()
. = ..()
/mob/MouseExited()
closeToolTip(usr) //No reason not to, really
..()
. = ..()
// Manages a global list of mobs with clients attached, indexed by z-level.
/mob/proc/update_client_z(new_z) // +1 to register, null to unregister.
+2 -2
View File
@@ -409,7 +409,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT)
return // Can't talk in deadchat if you can't see it.
for(var/mob/M in player_list)
if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights && M.is_preference_enabled(/datum/client_preference/holder/show_staff_dsay))) && M.is_preference_enabled(/datum/client_preference/show_dsay))
if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights && M.client?.prefs?.read_preference(/datum/preference/toggle/holder/show_staff_dsay))) && M.client?.prefs?.read_preference(/datum/preference/toggle/show_dsay))
var/follow
var/lname
if(M.forbid_seeing_deadchat && !M.client.holder)
@@ -439,7 +439,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT)
/proc/say_dead_object(var/message, var/obj/subject = null)
for(var/mob/M in player_list)
if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights && M.is_preference_enabled(/datum/client_preference/holder/show_staff_dsay))) && M.is_preference_enabled(/datum/client_preference/show_dsay))
if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights && M.client?.prefs?.read_preference(/datum/preference/toggle/holder/show_staff_dsay))) && M.client?.prefs?.read_preference(/datum/preference/toggle/show_dsay))
var/follow
var/lname = "Game Master"
if(M.forbid_seeing_deadchat && !M.client.holder)
+1 -1
View File
@@ -100,7 +100,7 @@
if (client.prefs.lastlorenews == GLOB.news_data.newsindex)
client.seen_news = 1
if(GLOB.news_data.station_newspaper && !client.seen_news && client.is_preference_enabled(/datum/client_preference/show_lore_news))
if(GLOB.news_data.station_newspaper && !client.seen_news && client.prefs?.read_preference(/datum/preference/toggle/show_lore_news))
show_latest_news(GLOB.news_data.station_newspaper)
client.prefs.lastlorenews = GLOB.news_data.newsindex
SScharacter_setup.queue_preferences_save(client.prefs)
+1 -1
View File
@@ -68,7 +68,7 @@
to_chat(src, "<span class='danger'>Deadchat is globally muted.</span>")
return
if(!is_preference_enabled(/datum/client_preference/show_dsay))
if(!client?.prefs?.read_preference(/datum/preference/toggle/show_dsay))
to_chat(usr, "<span class='danger'>You have deadchat muted.</span>")
return
+26 -26
View File
@@ -203,14 +203,14 @@
continue
if(src.client && M && !(get_z(src) == get_z(M)))
message = "<span class='multizsay'>[message]</span>"
if(isobserver(M) && (!M.is_preference_enabled(/datum/client_preference/ghost_see_whisubtle) || \
!is_preference_enabled(/datum/client_preference/whisubtle_vis) && !M.client?.holder))
if(isobserver(M) && (!M.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle) || \
!client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) && !M.client?.holder))
spawn(0)
M.show_message(undisplayed_message, 2)
else
spawn(0)
M.show_message(message, 2)
if(M.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(M.read_preference(/datum/preference/toggle/subtle_sounds))
M << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
for(var/obj/O as anything in vis_objs)
@@ -291,13 +291,13 @@
else
pb = db.pred_body
to_chat(pb, "<span class='psay'>The captive mind of \the [M] thinks, \"[message]\"</span>") //To our pred if dominated brain
if(pb.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(pb.read_preference(/datum/preference/toggle/subtle_sounds))
pb << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
else if(M.absorbed && isbelly(M.loc))
pb = M.loc.loc
to_chat(pb, "<span class='psay'>\The [M] thinks, \"[message]\"</span>") //To our pred if absorbed
if(pb.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(pb.read_preference(/datum/preference/toggle/subtle_sounds))
pb << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
@@ -307,14 +307,14 @@
if(istype(I, /mob/living/dominated_brain) && I != M)
var/mob/living/dominated_brain/db = I
to_chat(db, "<span class='psay'>The captive mind of \the [M] thinks, \"[message]\"</span>") //To any dominated brains in the pred
if(db.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(db.read_preference(/datum/preference/toggle/subtle_sounds))
db << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
for(var/B in pb.vore_organs)
for(var/mob/living/L in B)
if(L.absorbed && L != M && L.ckey)
to_chat(L, "<span class='psay'>\The [M] thinks, \"[message]\"</span>") //To any absorbed people in the pred
if(L.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(L.read_preference(/datum/preference/toggle/subtle_sounds))
L << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
@@ -323,32 +323,32 @@
if(istype(I, /mob/living/dominated_brain))
var/mob/living/dominated_brain/db = I
to_chat(db, "<span class='psay'><b>\The [M] thinks, \"[message]\"</b></span>") //To any dominated brains inside us
if(db.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(db.read_preference(/datum/preference/toggle/subtle_sounds))
db << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
for(var/B in M.vore_organs)
for(var/mob/living/L in B)
if(L.absorbed)
to_chat(L, "<span class='psay'><b>\The [M] thinks, \"[message]\"</b></span>") //To any absorbed people inside us
if(L.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(L.read_preference(/datum/preference/toggle/subtle_sounds))
L << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
if(f) //We found someone to send the message to
if(pb)
to_chat(M, "<span class='psay'>You think \"[message]\"</span>") //To us if we are the prey
if(M.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(M.read_preference(/datum/preference/toggle/subtle_sounds))
M << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
else
to_chat(M, "<span class='psay'><b>You think \"[message]\"</b></span>") //To us if we are the pred
if(M.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(M.read_preference(/datum/preference/toggle/subtle_sounds))
M << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
for (var/mob/G in player_list)
if (istype(G, /mob/new_player))
continue
else if(isobserver(G) && G.is_preference_enabled(/datum/client_preference/ghost_ears && \
G.is_preference_enabled(/datum/client_preference/ghost_see_whisubtle)))
if(is_preference_enabled(/datum/client_preference/whisubtle_vis) || G.client.holder)
else if(isobserver(G) && G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears && \
G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle)))
if(client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) || G.client.holder)
to_chat(G, "<span class='psay'>\The [M] thinks, \"[message]\"</span>")
log_say(message,M)
else //There wasn't anyone to send the message to, pred or prey, so let's just say it instead and correct our psay just in case.
@@ -388,14 +388,14 @@
else
pb = db.pred_body
to_chat(pb, "<span class='pemote'>\The [M] [message]</span>") //To our pred if dominated brain
if(pb.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(pb.read_preference(/datum/preference/toggle/subtle_sounds))
pb << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
else if(M.absorbed && isbelly(M.loc))
pb = M.loc.loc
to_chat(pb, "<span class='pemote'>\The [M] [message]</span>") //To our pred if absorbed
if(pb.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(pb.read_preference(/datum/preference/toggle/subtle_sounds))
pb << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
@@ -405,14 +405,14 @@
if(istype(I, /mob/living/dominated_brain) && I != M)
var/mob/living/dominated_brain/db = I
to_chat(db, "<span class='pemote'>\The [M] [message]</span>") //To any dominated brains in the pred
if(db.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(db.read_preference(/datum/preference/toggle/subtle_sounds))
db << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
for(var/B in pb.vore_organs)
for(var/mob/living/L in B)
if(L.absorbed && L != M && L.ckey)
to_chat(L, "<span class='pemote'>\The [M] [message]</span>") //To any absorbed people in the pred
if(L.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(L.read_preference(/datum/preference/toggle/subtle_sounds))
L << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
@@ -421,32 +421,32 @@
if(istype(I, /mob/living/dominated_brain))
var/mob/living/dominated_brain/db = I
to_chat(db, "<span class='pemote'><b>\The [M] [message]</b></span>") //To any dominated brains inside us
if(db.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(db.read_preference(/datum/preference/toggle/subtle_sounds))
db << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
for(var/B in M.vore_organs)
for(var/mob/living/L in B)
if(L.absorbed)
to_chat(L, "<span class='pemote'><b>\The [M] [message]</b></span>") //To any absorbed people inside us
if(L.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(L.read_preference(/datum/preference/toggle/subtle_sounds))
L << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
f = TRUE
if(f) //We found someone to send the message to
if(pb)
to_chat(M, "<span class='pemote'>\The [M] [message]</span>") //To us if we are the prey
if(M.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(M.read_preference(/datum/preference/toggle/subtle_sounds))
M << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
else
to_chat(M, "<span class='pemote'><b>\The [M] [message]</b></span>") //To us if we are the pred
if(M.is_preference_enabled(/datum/client_preference/subtle_sounds))
if(M.read_preference(/datum/preference/toggle/subtle_sounds))
M << sound('sound/talksounds/subtle_sound.ogg', volume = 50)
for (var/mob/G in player_list)
if (istype(G, /mob/new_player))
continue
else if(isobserver(G) && G.is_preference_enabled(/datum/client_preference/ghost_ears && \
G.is_preference_enabled(/datum/client_preference/ghost_see_whisubtle)))
if(is_preference_enabled(/datum/client_preference/whisubtle_vis) || G.client.holder)
else if(isobserver(G) && G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_ears && \
G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle)))
if(client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) || G.client.holder)
to_chat(G, "<span class='pemote'>\The [M] [message]</span>")
log_say(message,M)
else //There wasn't anyone to send the message to, pred or prey, so let's just emote it instead and correct our psay just in case.
@@ -484,7 +484,7 @@
ourfreq = voice_freq
if(client)
playsound(T, pick(emote_sound), 25, TRUE, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/client_preference/emote_sounds)
playsound(T, pick(emote_sound), 25, TRUE, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/preference/toggle/emote_sounds)
var/list/in_range = get_mobs_and_objs_in_view_fast(T,world.view,2,remote_ghosts = client ? TRUE : FALSE)
var/list/m_viewers = in_range["mobs"]
+6 -6
View File
@@ -15,7 +15,7 @@
set name = "Say verb"
set category = "IC"
if(is_preference_enabled(/datum/client_preference/tgui_say))
if(client?.prefs?.read_preference(/datum/preference/toggle/tgui_say))
winset(src, null, "command=[client.tgui_say_create_open_command(SAY_CHANNEL)]")
return
@@ -31,7 +31,7 @@
set name = "Me verb"
set category = "IC"
if(is_preference_enabled(/datum/client_preference/tgui_say))
if(client?.prefs?.read_preference(/datum/preference/toggle/tgui_say))
winset(src, null, "command=[client.tgui_say_create_open_command(ME_CHANNEL)]")
return
@@ -47,11 +47,11 @@
set name = "Whisper verb"
set category = "IC"
if(is_preference_enabled(/datum/client_preference/tgui_say))
if(client?.prefs?.read_preference(/datum/preference/toggle/tgui_say))
winset(src, null, "command=[client.tgui_say_create_open_command(WHIS_CHANNEL)]")
return
if(is_preference_enabled(/datum/client_preference/show_typing_indicator_subtle))
if(client?.prefs?.read_preference(/datum/preference/toggle/show_typing_indicator_subtle))
client?.start_thinking()
client?.start_typing()
var/message = tgui_input_text(usr, "Type your message:", "Whisper")
@@ -65,11 +65,11 @@
set category = "IC"
set desc = "Emote to nearby people (and your pred/prey)"
if(is_preference_enabled(/datum/client_preference/tgui_say))
if(client?.prefs?.read_preference(/datum/preference/toggle/tgui_say))
winset(src, null, "command=[client.tgui_say_create_open_command(SUBTLE_CHANNEL)]")
return
if(is_preference_enabled(/datum/client_preference/show_typing_indicator_subtle))
if(client?.prefs?.read_preference(/datum/preference/toggle/show_typing_indicator_subtle))
client?.start_thinking()
client?.start_typing()
var/message = tgui_input_text(usr, "Type your message:", "Subtle", multiline = TRUE)