mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-16 02:17:19 +01:00
Add null checks to client prefs checks
client.prefs. -> client?.prefs?.
This commit is contained in:
@@ -104,7 +104,7 @@
|
||||
if(M.client)
|
||||
body += "| <A href='?_src_=holder;[HrefToken()];sendtoprison=[REF(M)]'>Prison</A> | "
|
||||
body += "\ <A href='?_src_=holder;[HrefToken()];sendbacktolobby=[REF(M)]'>Send back to Lobby</A> | "
|
||||
var/muted = M.client.prefs.muted
|
||||
var/muted = M.client?.prefs?.muted
|
||||
body += "<br><b>Mute: </b> "
|
||||
body += "\[<A href='?_src_=holder;[HrefToken()];mute=[M.ckey];mute_type=[MUTE_IC]'><font color='[(muted & MUTE_IC)?"red":"blue"]'>IC</font></a> | "
|
||||
body += "<A href='?_src_=holder;[HrefToken()];mute=[M.ckey];mute_type=[MUTE_OOC]'><font color='[(muted & MUTE_OOC)?"red":"blue"]'>OOC</font></a> | "
|
||||
|
||||
@@ -743,7 +743,7 @@
|
||||
if (length(players))
|
||||
var/mob/chosen = players[1]
|
||||
if (chosen.client)
|
||||
chosen.client.prefs.copy_to(spawnedMob)
|
||||
chosen.client?.prefs?.copy_to(spawnedMob)
|
||||
spawnedMob.key = chosen.key
|
||||
players -= chosen
|
||||
if (ishuman(spawnedMob) && ispath(humanoutfit, /datum/outfit))
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
if(SOUND_EMITTER_GLOBAL)
|
||||
hearing_mobs = GLOB.player_list.Copy()
|
||||
for(var/mob/M in hearing_mobs)
|
||||
if(M.client.prefs.toggles & SOUND_MIDI)
|
||||
if(M.client?.prefs?.toggles & SOUND_MIDI)
|
||||
M.playsound_local(M, sound_file, sound_volume, FALSE, channel = CHANNEL_ADMIN, pressure_affected = FALSE)
|
||||
if(user)
|
||||
log_admin("[ADMIN_LOOKUPFLW(user)] activated a sound emitter with file \"[sound_file]\" at [AREACOORD(src)]")
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
for (var/mob/M in GLOB.player_list)
|
||||
if(isnewplayer(M))
|
||||
continue
|
||||
if (M.stat == DEAD || (M.client && M.client.holder && (M.client.prefs.chat_toggles & CHAT_DEAD))) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
|
||||
if (M.stat == DEAD || (M.client && M.client.holder && (M.client?.prefs?.chat_toggles & CHAT_DEAD))) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above
|
||||
to_chat(M, rendered)
|
||||
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Dsay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
/datum/admins/proc/isReadytoRumble(mob/living/carbon/human/applicant, targetrole, onstation = TRUE, conscious = TRUE)
|
||||
if(applicant.mind.special_role)
|
||||
return FALSE
|
||||
if(!(targetrole in applicant.client.prefs.be_special))
|
||||
if(!(targetrole in applicant.client?.prefs?.be_special))
|
||||
return FALSE
|
||||
if(onstation)
|
||||
var/turf/T = get_turf(applicant)
|
||||
@@ -412,7 +412,7 @@
|
||||
|
||||
//Spawn the body
|
||||
var/mob/living/carbon/human/ERTOperative = new ertemplate.mobtype(spawnloc)
|
||||
chosen_candidate.client.prefs.copy_to(ERTOperative)
|
||||
chosen_candidate.client?.prefs?.copy_to(ERTOperative)
|
||||
ERTOperative.key = chosen_candidate.key
|
||||
|
||||
if(ertemplate.enforce_human || ERTOperative.dna.species.dangerous_existence) // Don't want any exploding plasmemes
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
message_admins("[key_name_admin(src)] played sound [S]")
|
||||
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M.client.prefs.toggles & SOUND_MIDI)
|
||||
if(M.client?.prefs?.toggles & SOUND_MIDI)
|
||||
var/user_vol = M.client.chatOutput.adminMusicVolume
|
||||
if(user_vol)
|
||||
admin_sound.volume = vol * (user_vol / 100)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
return
|
||||
log_prayer("[src.key]/([src.name]): [msg]")
|
||||
if(usr.client)
|
||||
if(usr.client.prefs.muted & MUTE_PRAY)
|
||||
if(usr.client?.prefs?.muted & MUTE_PRAY)
|
||||
to_chat(usr, "<span class='danger'>You cannot pray (muted).</span>")
|
||||
return
|
||||
if(src.client.handle_spam_prevention(msg,MUTE_PRAY))
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M.stat != DEAD)
|
||||
continue //we are not dead!
|
||||
if(!(ROLE_ALIEN in M.client.prefs.be_special))
|
||||
if(!(ROLE_ALIEN in M.client?.prefs?.be_special))
|
||||
continue //we don't want to be an alium
|
||||
if(M.client.is_afk())
|
||||
continue //we are afk
|
||||
|
||||
@@ -181,7 +181,7 @@ GLOBAL_LIST_EMPTY(antagonists)
|
||||
|
||||
/datum/antagonist/proc/enabled_in_preferences(datum/mind/M)
|
||||
if(job_rank)
|
||||
if(M.current && M.current.client && (job_rank in M.current.client.prefs.be_special))
|
||||
if(M.current && M.current.client && (job_rank in M.current.client?.prefs?.be_special))
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
@@ -192,7 +192,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
|
||||
return
|
||||
|
||||
if (src.client)
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
if(client?.prefs?.muted & MUTE_IC)
|
||||
to_chat(src, "You cannot send IC messages (muted).")
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
/mob/camera/eminence/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
|
||||
if(client)
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
if(client?.prefs?.muted & MUTE_IC)
|
||||
to_chat(src, "You cannot send IC messages (muted).")
|
||||
return
|
||||
if(client.handle_spam_prevention(message,MUTE_IC))
|
||||
|
||||
@@ -286,7 +286,7 @@
|
||||
var/list/datum/mind/promotable = list()
|
||||
for(var/datum/mind/khrushchev in non_heads)
|
||||
if(khrushchev.current && !khrushchev.current.incapacitated() && !khrushchev.current.restrained() && khrushchev.current.client && khrushchev.current.stat != DEAD)
|
||||
if(ROLE_REV in khrushchev.current.client.prefs.be_special)
|
||||
if(ROLE_REV in khrushchev.current.client?.prefs?.be_special)
|
||||
promotable += khrushchev
|
||||
if(promotable.len)
|
||||
var/datum/mind/new_leader = pick(promotable)
|
||||
|
||||
@@ -383,7 +383,7 @@
|
||||
if(IsAdminGhost(user))
|
||||
attack_ai(user)
|
||||
return FALSE
|
||||
else if(user.client.prefs.inquisitive_ghost)
|
||||
else if(user.client?.prefs?.inquisitive_ghost)
|
||||
user.examinate(src)
|
||||
return FALSE
|
||||
return FALSE
|
||||
|
||||
@@ -1025,7 +1025,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "<b>Widescreen:</b> <a href='?_src_=prefs;preference=widescreenpref'>[widescreenpref ? "Enabled ([CONFIG_GET(string/default_view)])" : "Disabled (15x15)"]</a><br>"
|
||||
dat += "<b>Auto stand:</b> <a href='?_src_=prefs;preference=autostand'>[autostand ? "Enabled" : "Disabled"]</a><br>"
|
||||
dat += "<b>Screen Shake:</b> <a href='?_src_=prefs;preference=screenshake'>[(screenshake==100) ? "Full" : ((screenshake==0) ? "None" : "[screenshake]")]</a><br>"
|
||||
if (user && user.client && !user.client.prefs.screenshake==0)
|
||||
if (user && user.client && !user.client?.prefs?.screenshake==0)
|
||||
dat += "<b>Damage Screen Shake:</b> <a href='?_src_=prefs;preference=damagescreenshake'>[(damagescreenshake==1) ? "On" : ((damagescreenshake==0) ? "Off" : "Only when down")]</a><br>"
|
||||
|
||||
//GS13
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
set name = "Game Preferences"
|
||||
set category = "Preferences"
|
||||
set desc = "Open Game Preferences Window"
|
||||
usr.client.prefs.current_tab = 1
|
||||
usr.client.prefs.ShowChoices(usr)
|
||||
usr.client?.prefs?.current_tab = 1
|
||||
usr.client?.prefs?.ShowChoices(usr)
|
||||
|
||||
//toggles
|
||||
/datum/verbs/menu/Settings/Ghost/chatterbox
|
||||
@@ -27,10 +27,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_ears)(
|
||||
set name = "Show/Hide GhostEars"
|
||||
set category = "Preferences"
|
||||
set desc = "See All Speech"
|
||||
usr.client.prefs.chat_toggles ^= CHAT_GHOSTEARS
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTEARS) ? "see all speech in the world" : "only see speech from nearby mobs"].")
|
||||
usr.client.prefs.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Ears", "[usr.client.prefs.chat_toggles & CHAT_GHOSTEARS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTEARS
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTEARS) ? "see all speech in the world" : "only see speech from nearby mobs"].")
|
||||
usr.client?.prefs?.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Ears", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTEARS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_ears/Get_checked(client/C)
|
||||
return C.prefs.chat_toggles & CHAT_GHOSTEARS
|
||||
|
||||
@@ -38,10 +38,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_sight)
|
||||
set name = "Show/Hide GhostSight"
|
||||
set category = "Preferences"
|
||||
set desc = "See All Emotes"
|
||||
usr.client.prefs.chat_toggles ^= CHAT_GHOSTSIGHT
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) ? "see all emotes in the world" : "only see emotes from nearby mobs"].")
|
||||
usr.client.prefs.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Sight", "[usr.client.prefs.chat_toggles & CHAT_GHOSTSIGHT ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTSIGHT
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT) ? "see all emotes in the world" : "only see emotes from nearby mobs"].")
|
||||
usr.client?.prefs?.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Sight", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_sight/Get_checked(client/C)
|
||||
return C.prefs.chat_toggles & CHAT_GHOSTSIGHT
|
||||
|
||||
@@ -49,10 +49,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_whispe
|
||||
set name = "Show/Hide GhostWhispers"
|
||||
set category = "Preferences"
|
||||
set desc = "See All Whispers"
|
||||
usr.client.prefs.chat_toggles ^= CHAT_GHOSTWHISPER
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTWHISPER) ? "see all whispers in the world" : "only see whispers from nearby mobs"].")
|
||||
usr.client.prefs.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Whispers", "[usr.client.prefs.chat_toggles & CHAT_GHOSTWHISPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTWHISPER
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER) ? "see all whispers in the world" : "only see whispers from nearby mobs"].")
|
||||
usr.client?.prefs?.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Whispers", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_whispers/Get_checked(client/C)
|
||||
return C.prefs.chat_toggles & CHAT_GHOSTWHISPER
|
||||
|
||||
@@ -62,10 +62,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_radio)
|
||||
set name = "Show/Hide GhostRadio"
|
||||
set category = "Preferences"
|
||||
set desc = "See All Radio Chatter"
|
||||
usr.client.prefs.chat_toggles ^= CHAT_GHOSTRADIO
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTRADIO) ? "see radio chatter" : "not see radio chatter"].")
|
||||
usr.client.prefs.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Radio", "[usr.client.prefs.chat_toggles & CHAT_GHOSTRADIO ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //social experiment, increase the generation whenever you copypaste this shamelessly GENERATION 1
|
||||
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTRADIO
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTRADIO) ? "see radio chatter" : "not see radio chatter"].")
|
||||
usr.client?.prefs?.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Radio", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTRADIO ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //social experiment, increase the generation whenever you copypaste this shamelessly GENERATION 1
|
||||
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_radio/Get_checked(client/C)
|
||||
return C.prefs.chat_toggles & CHAT_GHOSTRADIO
|
||||
|
||||
@@ -73,10 +73,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_pda)()
|
||||
set name = "Show/Hide GhostPDA"
|
||||
set category = "Preferences"
|
||||
set desc = "See All PDA Messages"
|
||||
usr.client.prefs.chat_toggles ^= CHAT_GHOSTPDA
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTPDA) ? "see all pda messages in the world" : "only see pda messages from nearby mobs"].")
|
||||
usr.client.prefs.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost PDA", "[usr.client.prefs.chat_toggles & CHAT_GHOSTPDA ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTPDA
|
||||
to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTPDA) ? "see all pda messages in the world" : "only see pda messages from nearby mobs"].")
|
||||
usr.client?.prefs?.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost PDA", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTPDA ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_pda/Get_checked(client/C)
|
||||
return C.prefs.chat_toggles & CHAT_GHOSTPDA
|
||||
|
||||
@@ -88,10 +88,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox/Events, toggle_death
|
||||
set name = "Toggle Deathrattle"
|
||||
set category = "Preferences"
|
||||
set desc = "Death"
|
||||
usr.client.prefs.toggles ^= DISABLE_DEATHRATTLE
|
||||
usr.client.prefs.save_preferences()
|
||||
to_chat(usr, "You will [(usr.client.prefs.toggles & DISABLE_DEATHRATTLE) ? "no longer" : "now"] get messages when a sentient mob dies.")
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Deathrattle", "[!(usr.client.prefs.toggles & DISABLE_DEATHRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should spend some time reading the comments.
|
||||
usr.client?.prefs?.toggles ^= DISABLE_DEATHRATTLE
|
||||
usr.client?.prefs?.save_preferences()
|
||||
to_chat(usr, "You will [(usr.client?.prefs?.toggles & DISABLE_DEATHRATTLE) ? "no longer" : "now"] get messages when a sentient mob dies.")
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Deathrattle", "[!(usr.client?.prefs?.toggles & DISABLE_DEATHRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should spend some time reading the comments.
|
||||
/datum/verbs/menu/Settings/Ghost/chatterbox/Events/toggle_deathrattle/Get_checked(client/C)
|
||||
return !(C.prefs.toggles & DISABLE_DEATHRATTLE)
|
||||
|
||||
@@ -99,10 +99,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox/Events, toggle_arriv
|
||||
set name = "Toggle Arrivalrattle"
|
||||
set category = "Preferences"
|
||||
set desc = "New Player Arrival"
|
||||
usr.client.prefs.toggles ^= DISABLE_ARRIVALRATTLE
|
||||
to_chat(usr, "You will [(usr.client.prefs.toggles & DISABLE_ARRIVALRATTLE) ? "no longer" : "now"] get messages when someone joins the station.")
|
||||
usr.client.prefs.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Arrivalrattle", "[!(usr.client.prefs.toggles & DISABLE_ARRIVALRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should rethink where your life went so wrong.
|
||||
usr.client?.prefs?.toggles ^= DISABLE_ARRIVALRATTLE
|
||||
to_chat(usr, "You will [(usr.client?.prefs?.toggles & DISABLE_ARRIVALRATTLE) ? "no longer" : "now"] get messages when someone joins the station.")
|
||||
usr.client?.prefs?.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Arrivalrattle", "[!(usr.client?.prefs?.toggles & DISABLE_ARRIVALRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should rethink where your life went so wrong.
|
||||
/datum/verbs/menu/Settings/Ghost/chatterbox/Events/toggle_arrivalrattle/Get_checked(client/C)
|
||||
return !(C.prefs.toggles & DISABLE_ARRIVALRATTLE)
|
||||
|
||||
@@ -110,10 +110,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost, togglemidroundantag)()
|
||||
set name = "Toggle Midround Antagonist"
|
||||
set category = "Preferences"
|
||||
set desc = "Midround Antagonist"
|
||||
usr.client.prefs.toggles ^= MIDROUND_ANTAG
|
||||
usr.client.prefs.save_preferences()
|
||||
to_chat(usr, "You will [(usr.client.prefs.toggles & MIDROUND_ANTAG) ? "now" : "no longer"] be considered for midround antagonist positions.")
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Midround Antag", "[usr.client.prefs.toggles & MIDROUND_ANTAG ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
usr.client?.prefs?.toggles ^= MIDROUND_ANTAG
|
||||
usr.client?.prefs?.save_preferences()
|
||||
to_chat(usr, "You will [(usr.client?.prefs?.toggles & MIDROUND_ANTAG) ? "now" : "no longer"] be considered for midround antagonist positions.")
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Midround Antag", "[usr.client?.prefs?.toggles & MIDROUND_ANTAG ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Ghost/togglemidroundantag/Get_checked(client/C)
|
||||
return C.prefs.toggles & MIDROUND_ANTAG
|
||||
|
||||
@@ -121,16 +121,16 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggletitlemusic)()
|
||||
set name = "Hear/Silence Lobby Music"
|
||||
set category = "Preferences"
|
||||
set desc = "Hear Music In Lobby"
|
||||
usr.client.prefs.toggles ^= SOUND_LOBBY
|
||||
usr.client.prefs.save_preferences()
|
||||
if(usr.client.prefs.toggles & SOUND_LOBBY)
|
||||
usr.client?.prefs?.toggles ^= SOUND_LOBBY
|
||||
usr.client?.prefs?.save_preferences()
|
||||
if(usr.client?.prefs?.toggles & SOUND_LOBBY)
|
||||
to_chat(usr, "You will now hear music in the game lobby.")
|
||||
if(isnewplayer(usr))
|
||||
usr.client.playtitlemusic()
|
||||
else
|
||||
to_chat(usr, "You will no longer hear music in the game lobby.")
|
||||
usr.stop_sound_channel(CHANNEL_LOBBYMUSIC)
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Lobby Music", "[usr.client.prefs.toggles & SOUND_LOBBY ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Lobby Music", "[usr.client?.prefs?.toggles & SOUND_LOBBY ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Sound/toggletitlemusic/Get_checked(client/C)
|
||||
return C.prefs.toggles & SOUND_LOBBY
|
||||
|
||||
@@ -139,9 +139,9 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglemidis)()
|
||||
set name = "Hear/Silence Midis"
|
||||
set category = "Preferences"
|
||||
set desc = "Hear Admin Triggered Sounds (Midis)"
|
||||
usr.client.prefs.toggles ^= SOUND_MIDI
|
||||
usr.client.prefs.save_preferences()
|
||||
if(usr.client.prefs.toggles & SOUND_MIDI)
|
||||
usr.client?.prefs?.toggles ^= SOUND_MIDI
|
||||
usr.client?.prefs?.save_preferences()
|
||||
if(usr.client?.prefs?.toggles & SOUND_MIDI)
|
||||
to_chat(usr, "You will now hear any sounds uploaded by admins.")
|
||||
else
|
||||
to_chat(usr, "You will no longer hear sounds uploaded by admins")
|
||||
@@ -149,7 +149,7 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglemidis)()
|
||||
var/client/C = usr.client
|
||||
if(C && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
|
||||
C.chatOutput.stopMusic()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Hearing Midis", "[usr.client.prefs.toggles & SOUND_MIDI ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Hearing Midis", "[usr.client?.prefs?.toggles & SOUND_MIDI ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Sound/togglemidis/Get_checked(client/C)
|
||||
return C.prefs.toggles & SOUND_MIDI
|
||||
|
||||
@@ -158,13 +158,13 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_instruments)()
|
||||
set name = "Hear/Silence Instruments"
|
||||
set category = "Preferences"
|
||||
set desc = "Hear In-game Instruments"
|
||||
usr.client.prefs.toggles ^= SOUND_INSTRUMENTS
|
||||
usr.client.prefs.save_preferences()
|
||||
if(usr.client.prefs.toggles & SOUND_INSTRUMENTS)
|
||||
usr.client?.prefs?.toggles ^= SOUND_INSTRUMENTS
|
||||
usr.client?.prefs?.save_preferences()
|
||||
if(usr.client?.prefs?.toggles & SOUND_INSTRUMENTS)
|
||||
to_chat(usr, "You will now hear people playing musical instruments.")
|
||||
else
|
||||
to_chat(usr, "You will no longer hear musical instruments.")
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Instruments", "[usr.client.prefs.toggles & SOUND_INSTRUMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Instruments", "[usr.client?.prefs?.toggles & SOUND_INSTRUMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Sound/toggle_instruments/Get_checked(client/C)
|
||||
return C.prefs.toggles & SOUND_INSTRUMENTS
|
||||
|
||||
@@ -173,15 +173,15 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, Toggle_Soundscape)()
|
||||
set name = "Hear/Silence Ambience"
|
||||
set category = "Preferences"
|
||||
set desc = "Hear Ambient Sound Effects"
|
||||
usr.client.prefs.toggles ^= SOUND_AMBIENCE
|
||||
usr.client.prefs.save_preferences()
|
||||
if(usr.client.prefs.toggles & SOUND_AMBIENCE)
|
||||
usr.client?.prefs?.toggles ^= SOUND_AMBIENCE
|
||||
usr.client?.prefs?.save_preferences()
|
||||
if(usr.client?.prefs?.toggles & SOUND_AMBIENCE)
|
||||
to_chat(usr, "You will now hear ambient sounds.")
|
||||
else
|
||||
to_chat(usr, "You will no longer hear ambient sounds.")
|
||||
usr.stop_sound_channel(CHANNEL_AMBIENCE)
|
||||
usr.stop_sound_channel(CHANNEL_BUZZ)
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ambience", "[usr.client.prefs.toggles & SOUND_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ambience", "[usr.client?.prefs?.toggles & SOUND_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Sound/Toggle_Soundscape/Get_checked(client/C)
|
||||
return C.prefs.toggles & SOUND_AMBIENCE
|
||||
|
||||
@@ -190,15 +190,15 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_ship_ambience)()
|
||||
set name = "Hear/Silence Ship Ambience"
|
||||
set category = "Preferences"
|
||||
set desc = "Hear Ship Ambience Roar"
|
||||
usr.client.prefs.toggles ^= SOUND_SHIP_AMBIENCE
|
||||
usr.client.prefs.save_preferences()
|
||||
if(usr.client.prefs.toggles & SOUND_SHIP_AMBIENCE)
|
||||
usr.client?.prefs?.toggles ^= SOUND_SHIP_AMBIENCE
|
||||
usr.client?.prefs?.save_preferences()
|
||||
if(usr.client?.prefs?.toggles & SOUND_SHIP_AMBIENCE)
|
||||
to_chat(usr, "You will now hear ship ambience.")
|
||||
else
|
||||
to_chat(usr, "You will no longer hear ship ambience.")
|
||||
usr.stop_sound_channel(CHANNEL_BUZZ)
|
||||
usr.client.ambience_playing = 0
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ship Ambience", "[usr.client.prefs.toggles & SOUND_SHIP_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, I bet you read this comment expecting to see the same thing :^)
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ship Ambience", "[usr.client?.prefs?.toggles & SOUND_SHIP_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, I bet you read this comment expecting to see the same thing :^)
|
||||
/datum/verbs/menu/Settings/Sound/toggle_ship_ambience/Get_checked(client/C)
|
||||
return C.prefs.toggles & SOUND_SHIP_AMBIENCE
|
||||
|
||||
@@ -207,10 +207,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_announcement_sound)()
|
||||
set name = "Hear/Silence Announcements"
|
||||
set category = "Preferences"
|
||||
set desc = "Hear Announcement Sound"
|
||||
usr.client.prefs.toggles ^= SOUND_ANNOUNCEMENTS
|
||||
to_chat(usr, "You will now [(usr.client.prefs.toggles & SOUND_ANNOUNCEMENTS) ? "hear announcement sounds" : "no longer hear announcements"].")
|
||||
usr.client.prefs.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Announcement Sound", "[usr.client.prefs.toggles & SOUND_ANNOUNCEMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
usr.client?.prefs?.toggles ^= SOUND_ANNOUNCEMENTS
|
||||
to_chat(usr, "You will now [(usr.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS) ? "hear announcement sounds" : "no longer hear announcements"].")
|
||||
usr.client?.prefs?.save_preferences()
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Announcement Sound", "[usr.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/Sound/toggle_announcement_sound/Get_checked(client/C)
|
||||
return C.prefs.toggles & SOUND_ANNOUNCEMENTS
|
||||
|
||||
@@ -219,13 +219,13 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggleprayersounds)()
|
||||
set name = "Hear/Silence Prayer Sounds"
|
||||
set category = "Preferences"
|
||||
set desc = "Hear Prayer Sounds"
|
||||
usr.client.prefs.toggles ^= SOUND_PRAYERS
|
||||
usr.client.prefs.save_preferences()
|
||||
if(usr.client.prefs.toggles & SOUND_PRAYERS)
|
||||
usr.client?.prefs?.toggles ^= SOUND_PRAYERS
|
||||
usr.client?.prefs?.save_preferences()
|
||||
if(usr.client?.prefs?.toggles & SOUND_PRAYERS)
|
||||
to_chat(usr, "You will now hear prayer sounds.")
|
||||
else
|
||||
to_chat(usr, "You will no longer prayer sounds.")
|
||||
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Sounds", "[usr.client.prefs.toggles & SOUND_PRAYERS ? "Enabled" : "Disabled"]"))
|
||||
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Sounds", "[usr.client?.prefs?.toggles & SOUND_PRAYERS ? "Enabled" : "Disabled"]"))
|
||||
/datum/verbs/menu/Settings/Sound/toggleprayersounds/Get_checked(client/C)
|
||||
return C.prefs.toggles & SOUND_PRAYERS
|
||||
|
||||
@@ -244,10 +244,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings, listen_ooc)()
|
||||
set name = "Show/Hide OOC"
|
||||
set category = "Preferences"
|
||||
set desc = "Show OOC Chat"
|
||||
usr.client.prefs.chat_toggles ^= CHAT_OOC
|
||||
usr.client.prefs.save_preferences()
|
||||
to_chat(usr, "You will [(usr.client.prefs.chat_toggles & CHAT_OOC) ? "now" : "no longer"] see messages on the OOC channel.")
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Seeing OOC", "[usr.client.prefs.chat_toggles & CHAT_OOC ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
usr.client?.prefs?.chat_toggles ^= CHAT_OOC
|
||||
usr.client?.prefs?.save_preferences()
|
||||
to_chat(usr, "You will [(usr.client?.prefs?.chat_toggles & CHAT_OOC) ? "now" : "no longer"] see messages on the OOC channel.")
|
||||
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Seeing OOC", "[usr.client?.prefs?.chat_toggles & CHAT_OOC ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
/datum/verbs/menu/Settings/listen_ooc/Get_checked(client/C)
|
||||
return C.prefs.chat_toggles & CHAT_OOC
|
||||
|
||||
|
||||
@@ -433,8 +433,8 @@
|
||||
if(glass_colour_type && ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.client?.prefs && src == H.glasses)
|
||||
H.client.prefs.uses_glasses_colour = !H.client.prefs.uses_glasses_colour
|
||||
if(H.client.prefs.uses_glasses_colour)
|
||||
H.client?.prefs?.uses_glasses_colour = !H.client?.prefs?.uses_glasses_colour
|
||||
if(H.client?.prefs?.uses_glasses_colour)
|
||||
to_chat(H, "You will now see glasses colors.")
|
||||
else
|
||||
to_chat(H, "You will no longer see glasses colors.")
|
||||
@@ -453,7 +453,7 @@
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/update_glasses_color(obj/item/clothing/glasses/G, glasses_equipped)
|
||||
if(client && client.prefs.uses_glasses_colour && glasses_equipped)
|
||||
if(client && client?.prefs?.uses_glasses_colour && glasses_equipped)
|
||||
add_client_colour(G.glass_colour_type)
|
||||
else
|
||||
remove_client_colour(G.glass_colour_type)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
sender_override = "GATO Meteorology Division")
|
||||
for(var/V in GLOB.player_list)
|
||||
var/mob/M = V
|
||||
if((M.client.prefs.toggles & SOUND_MIDI) && is_station_level(M.z))
|
||||
if((M.client?.prefs?.toggles & SOUND_MIDI) && is_station_level(M.z))
|
||||
M.playsound_local(M, pick('sound/ambience/aurora_caelus_new.ogg','sound/ambience/aurora_caelus.ogg'), 40, FALSE, pressure_affected = FALSE) //ogg is "The Fire is Gone" by Heaven Pierce Her, used in the videogame ULTRAKILL. All respects and credits to the equivalent artists who worked on it.
|
||||
start_checking()
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ Captain
|
||||
throw EXCEPTION("[H.nameless ? "Captain" : "Captain [H.real_name]"] ([H.x],[H.y],[H.z]) has no client.")
|
||||
return
|
||||
|
||||
var/displayed_rank = H.client.prefs.alt_titles_preferences[title]
|
||||
var/displayed_rank = H.client?.prefs?.alt_titles_preferences[title]
|
||||
if(!displayed_rank) //Default to Captain
|
||||
displayed_rank = "Captain"
|
||||
|
||||
|
||||
@@ -39,12 +39,12 @@ Chaplain
|
||||
return
|
||||
|
||||
var/new_religion = "Christianity"
|
||||
if(M.client && M.client.prefs.custom_names["religion"])
|
||||
new_religion = M.client.prefs.custom_names["religion"]
|
||||
if(M.client && M.client?.prefs?.custom_names["religion"])
|
||||
new_religion = M.client?.prefs?.custom_names["religion"]
|
||||
|
||||
var/new_deity = "Space Jesus"
|
||||
if(M.client && M.client.prefs.custom_names["deity"])
|
||||
new_deity = M.client.prefs.custom_names["deity"]
|
||||
if(M.client && M.client?.prefs?.custom_names["deity"])
|
||||
new_deity = M.client?.prefs?.custom_names["deity"]
|
||||
|
||||
B.deity_name = new_deity
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ GLOBAL_LIST_INIT(available_depts, list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, S
|
||||
// Assign department security
|
||||
var/department
|
||||
if(M && M.client && M.client.prefs)
|
||||
department = M.client.prefs.prefered_security_department
|
||||
department = M.client?.prefs?.prefered_security_department
|
||||
if(!LAZYLEN(GLOB.available_depts) || department == "None")
|
||||
return
|
||||
else if(department in GLOB.available_depts)
|
||||
@@ -387,7 +387,7 @@ Junior Security Officer
|
||||
// Assign department security
|
||||
var/department
|
||||
if(M && M.client && M.client.prefs)
|
||||
department = M.client.prefs.prefered_security_department
|
||||
department = M.client?.prefs?.prefered_security_department
|
||||
if(!LAZYLEN(GLOB.available_depts) || department == "None")
|
||||
return
|
||||
else if(department in GLOB.available_depts)
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
postfix = "soon"
|
||||
to_chat(src, "Please set up your character and select \"Ready\". The game will start [postfix].")
|
||||
|
||||
if(client.prefs.path) //Hyper edit: notify of a newer preference version
|
||||
var/savefile/S = new /savefile(client.prefs.path)
|
||||
if(client?.prefs?.path) //Hyper edit: notify of a newer preference version
|
||||
var/savefile/S = new /savefile(client?.prefs?.path)
|
||||
if(S)
|
||||
S.cd = "/"
|
||||
var/slot
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
return
|
||||
|
||||
/mob/dead/new_player/proc/new_player_panel()
|
||||
var/output = "<center><p>Welcome, <b>[client ? client.prefs.real_name : "Unknown User"]</b></p>"
|
||||
var/output = "<center><p>Welcome, <b>[client ? client?.prefs?.real_name : "Unknown User"]</b></p>"
|
||||
output += "<p><a href='byond://?src=[REF(src)];show_preferences=1'>Setup Character</a></p>"
|
||||
|
||||
if(SSticker.current_state <= GAME_STATE_PREGAME)
|
||||
@@ -93,7 +93,7 @@
|
||||
relevant_cap = max(hpc, epc)
|
||||
|
||||
if(href_list["show_preferences"])
|
||||
client.prefs.ShowChoices(src)
|
||||
client?.prefs?.ShowChoices(src)
|
||||
return 1
|
||||
|
||||
if(href_list["ready"])
|
||||
@@ -122,7 +122,7 @@
|
||||
LateChoices()
|
||||
return
|
||||
|
||||
// if(client.prefs.real_name in client.pastcharacters) //if character has been spawned before
|
||||
// if(client?.prefs?.real_name in client.pastcharacters) //if character has been spawned before
|
||||
// to_chat(usr, "<span class='notice'>You have played that character before this round, please select a new one!</span>")
|
||||
// return
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
|
||||
if(!ready && href_list["preference"])
|
||||
if(client)
|
||||
client.prefs.process_link(src, href_list)
|
||||
client?.prefs?.process_link(src, href_list)
|
||||
else if(!href_list["late_join"])
|
||||
new_player_panel()
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
observer.client = client
|
||||
observer.set_ghost_appearance()
|
||||
if(observer.client && observer.client.prefs)
|
||||
observer.real_name = observer.client.prefs.real_name
|
||||
observer.real_name = observer.client?.prefs?.real_name
|
||||
observer.name = observer.real_name
|
||||
observer.client.init_verbs()
|
||||
observer.update_icon()
|
||||
@@ -346,11 +346,11 @@
|
||||
if(jobban_isbanned(src,rank))
|
||||
return JOB_UNAVAILABLE_BANNED
|
||||
if(job.whitelist_type) //whitelisting
|
||||
if(job.whitelist_type == "roleplay" && !client.prefs.roleplayroles)
|
||||
if(job.whitelist_type == "roleplay" && !client?.prefs?.roleplayroles)
|
||||
return JOB_UNAVAILABLE_WHITELIST
|
||||
if(job.whitelist_type == "important" && !client.prefs.importantroles)
|
||||
if(job.whitelist_type == "important" && !client?.prefs?.importantroles)
|
||||
return JOB_UNAVAILABLE_WHITELIST
|
||||
if(job.whitelist_type == "silly" && !client.prefs.sillyroles)
|
||||
if(job.whitelist_type == "silly" && !client?.prefs?.sillyroles)
|
||||
return JOB_UNAVAILABLE_WHITELIST
|
||||
if(QDELETED(src))
|
||||
return JOB_UNAVAILABLE_GENERIC
|
||||
@@ -554,8 +554,8 @@
|
||||
jobline += "<a class='[position_class]' style='display:block;width:170px' href='byond://?src=[REF(src)];SelectedJob=[job.title]'><font color='lime'><b>[job.title] ([job.current_positions])</b></font></a>"
|
||||
else
|
||||
jobline += "<a class='[position_class]' style='display:block;width:170px' href='byond://?src=[REF(src)];SelectedJob=[job.title]'>[job.title] ([job.current_positions])</a>"
|
||||
if(client && client.prefs && client.prefs.alt_titles_preferences[job.title])
|
||||
jobline += "<br><span style='color:#BBBBBB; font-style: italic;'>(as [client.prefs.alt_titles_preferences[job.title]])</span>"
|
||||
if(client && client.prefs && client?.prefs?.alt_titles_preferences[job.title])
|
||||
jobline += "<br><span style='color:#BBBBBB; font-style: italic;'>(as [client?.prefs?.alt_titles_preferences[job.title]])</span>"
|
||||
dat += jobline
|
||||
categorizedJobs[jobcat]["jobs"] -= job
|
||||
|
||||
@@ -588,9 +588,9 @@
|
||||
if(QDELETED(src))
|
||||
return
|
||||
if(frn)
|
||||
client.prefs.random_character()
|
||||
client.prefs.real_name = client.prefs.pref_species.random_name(gender,1)
|
||||
client.prefs.copy_to(H)
|
||||
client?.prefs?.random_character()
|
||||
client?.prefs?.real_name = client?.prefs?.pref_species.random_name(gender,1)
|
||||
client?.prefs?.copy_to(H)
|
||||
|
||||
H.dna.update_dna_identity()
|
||||
if(mind)
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
if(!. || !client)
|
||||
return FALSE
|
||||
|
||||
ghost_accs = client.prefs.ghost_accs
|
||||
ghost_others = client.prefs.ghost_others
|
||||
ghost_accs = client?.prefs?.ghost_accs
|
||||
ghost_others = client?.prefs?.ghost_others
|
||||
var/preferred_form = null
|
||||
|
||||
if(IsAdminGhost(src))
|
||||
has_unlimited_silicon_privilege = 1
|
||||
|
||||
if(client.prefs.unlock_content)
|
||||
preferred_form = client.prefs.ghost_form
|
||||
ghost_orbit = client.prefs.ghost_orbit
|
||||
if(client?.prefs?.unlock_content)
|
||||
preferred_form = client?.prefs?.ghost_form
|
||||
ghost_orbit = client?.prefs?.ghost_orbit
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if (isturf(T))
|
||||
|
||||
@@ -175,8 +175,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
/mob/dead/observer/update_icon(new_form)
|
||||
. = ..()
|
||||
if(client) //We update our preferences in case they changed right before update_icon was called.
|
||||
ghost_accs = client.prefs.ghost_accs
|
||||
ghost_others = client.prefs.ghost_others
|
||||
ghost_accs = client?.prefs?.ghost_accs
|
||||
ghost_others = client?.prefs?.ghost_others
|
||||
|
||||
if(hair_overlay)
|
||||
cut_overlay(hair_overlay)
|
||||
@@ -268,9 +268,9 @@ Works together with spawning an observer, noted above.
|
||||
var/mob/dead/observer/ghost = new(get_turf(src), src) // Transfer safety to observer spawning proc.
|
||||
SStgui.on_transfer(src, ghost) // Transfer NanoUIs.
|
||||
ghost.can_reenter_corpse = can_reenter_corpse
|
||||
if (client && client.prefs && client.prefs.auto_ooc)
|
||||
if (!(client.prefs.chat_toggles & CHAT_OOC))
|
||||
client.prefs.chat_toggles ^= CHAT_OOC
|
||||
if (client && client.prefs && client?.prefs?.auto_ooc)
|
||||
if (!(client?.prefs?.chat_toggles & CHAT_OOC))
|
||||
client?.prefs?.chat_toggles ^= CHAT_OOC
|
||||
transfer_ckey(ghost, FALSE)
|
||||
ghost.AddElement(/datum/element/ghost_role_eligibility,penalize) // technically already run earlier, but this adds the penalty
|
||||
// needs to be done AFTER the ckey transfer, too
|
||||
@@ -378,8 +378,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(source)
|
||||
var/obj/screen/alert/A = throw_alert("[REF(source)]_notify_cloning", /obj/screen/alert/notify_cloning)
|
||||
if(A)
|
||||
if(client && client.prefs && client.prefs.UI_style)
|
||||
A.icon = ui_style2icon(client.prefs.UI_style)
|
||||
if(client && client.prefs && client?.prefs?.UI_style)
|
||||
A.icon = ui_style2icon(client?.prefs?.UI_style)
|
||||
A.desc = message
|
||||
var/old_layer = source.layer
|
||||
var/old_plane = source.plane
|
||||
@@ -506,7 +506,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set name = "View Range"
|
||||
set desc = "Change your view range."
|
||||
|
||||
var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
|
||||
var/max_view = client?.prefs?.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
|
||||
if(client.view == CONFIG_GET(string/default_view))
|
||||
var/list/views = list()
|
||||
for(var/i in 7 to max_view)
|
||||
@@ -520,7 +520,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
/mob/dead/observer/verb/add_view_range(input as num)
|
||||
set name = "Add View Range"
|
||||
set hidden = TRUE
|
||||
var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
|
||||
var/max_view = client?.prefs?.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT
|
||||
if(input)
|
||||
client.rescale_view(input, 15, (max_view*2)+1)
|
||||
|
||||
@@ -573,7 +573,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/update_sight()
|
||||
if(client)
|
||||
ghost_others = client.prefs.ghost_others //A quick update just in case this setting was changed right before calling the proc
|
||||
ghost_others = client?.prefs?.ghost_others //A quick update just in case this setting was changed right before calling the proc
|
||||
|
||||
if (!ghostvision)
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
@@ -601,11 +601,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
client.images -= GLOB.ghost_images_default
|
||||
if(GHOST_OTHERS_SIMPLE)
|
||||
client.images -= GLOB.ghost_images_simple
|
||||
lastsetting = client.prefs.ghost_others
|
||||
lastsetting = client?.prefs?.ghost_others
|
||||
if(!ghostvision)
|
||||
return
|
||||
if(client.prefs.ghost_others != GHOST_OTHERS_THEIR_SETTING)
|
||||
switch(client.prefs.ghost_others)
|
||||
if(client?.prefs?.ghost_others != GHOST_OTHERS_THEIR_SETTING)
|
||||
switch(client?.prefs?.ghost_others)
|
||||
if(GHOST_OTHERS_DEFAULT_SPRITE)
|
||||
client.images |= (GLOB.ghost_images_default-ghostimage_default)
|
||||
if(GHOST_OTHERS_SIMPLE)
|
||||
@@ -741,23 +741,23 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
set_ghost_appearance()
|
||||
if(client && client.prefs)
|
||||
deadchat_name = client.prefs.real_name
|
||||
deadchat_name = client?.prefs?.real_name
|
||||
|
||||
/mob/dead/observer/proc/set_ghost_appearance()
|
||||
if((!client) || (!client.prefs))
|
||||
return
|
||||
|
||||
if(client.prefs.be_random_name)
|
||||
client.prefs.real_name = random_unique_name(gender)
|
||||
if(client.prefs.be_random_body)
|
||||
client.prefs.random_character(gender)
|
||||
if(client?.prefs?.be_random_name)
|
||||
client?.prefs?.real_name = random_unique_name(gender)
|
||||
if(client?.prefs?.be_random_body)
|
||||
client?.prefs?.random_character(gender)
|
||||
|
||||
if(HAIR in client.prefs.pref_species.species_traits)
|
||||
hair_style = client.prefs.hair_style
|
||||
hair_color = brighten_color(client.prefs.hair_color)
|
||||
if(FACEHAIR in client.prefs.pref_species.species_traits)
|
||||
facial_hair_style = client.prefs.facial_hair_style
|
||||
facial_hair_color = brighten_color(client.prefs.facial_hair_color)
|
||||
if(HAIR in client?.prefs?.pref_species.species_traits)
|
||||
hair_style = client?.prefs?.hair_style
|
||||
hair_color = brighten_color(client?.prefs?.hair_color)
|
||||
if(FACEHAIR in client?.prefs?.pref_species.species_traits)
|
||||
facial_hair_style = client?.prefs?.facial_hair_style
|
||||
facial_hair_color = brighten_color(client?.prefs?.facial_hair_color)
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
to_follow = V.source
|
||||
var/link = FOLLOW_LINK(src, to_follow)
|
||||
// Create map text prior to modifying message for goonchat
|
||||
if (client?.prefs.chat_on_map && (client.prefs.see_chat_non_mob || ismob(speaker)))
|
||||
if (client?.prefs.chat_on_map && (client?.prefs?.see_chat_non_mob || ismob(speaker)))
|
||||
create_chat_message(speaker, message_language, raw_message, spans, message_mode)
|
||||
// Recompose the message, because it's scrambled by default
|
||||
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source)
|
||||
|
||||
@@ -313,7 +313,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
C.canbearoused = FALSE
|
||||
else
|
||||
if(C.client)
|
||||
C.canbearoused = C.client.prefs.arousable
|
||||
C.canbearoused = C.client?.prefs?.arousable
|
||||
if(ishuman(C))
|
||||
var/mob/living/carbon/human/H = C
|
||||
if(NOGENITALS in H.dna.species.species_traits)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
if(ishuman(C))
|
||||
var/mob/living/carbon/human/H = C
|
||||
if(!H.dna.features["moth_wings"])
|
||||
H.dna.features["moth_wings"] = "[(H.client && H.client.prefs && LAZYLEN(H.client.prefs.features) && H.client.prefs.features["moth_wings"]) ? H.client.prefs.features["moth_wings"] : "Plain"]"
|
||||
H.dna.features["moth_wings"] = "[(H.client && H.client.prefs && LAZYLEN(H.client?.prefs?.features) && H.client?.prefs?.features["moth_wings"]) ? H.client?.prefs?.features["moth_wings"] : "Plain"]"
|
||||
handle_mutant_bodyparts(H)
|
||||
|
||||
/datum/species/moth/random_name(gender,unique,lastname)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
log_whisper("[src.name]/[src.key] : [message]")
|
||||
|
||||
if (src.client)
|
||||
if (src.client.prefs.muted & MUTE_IC)
|
||||
if (src.client?.prefs?.muted & MUTE_IC)
|
||||
to_chat(src, "<span class='danger'>You cannot whisper (muted).</span>")
|
||||
return
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
var/list/listening_dead = list()
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M.stat == DEAD && M.client && ((M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER) || (get_dist(M, src) <= 7)))
|
||||
if(M.stat == DEAD && M.client && ((M.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER) || (get_dist(M, src) <= 7)))
|
||||
listening_dead |= M
|
||||
|
||||
var/list/listening = get_hearers_in_view(1, src)
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
return FALSE
|
||||
else if(QDELETED(user))
|
||||
return FALSE
|
||||
else if(user.client && user.client.prefs.muted & MUTE_IC)
|
||||
else if(user.client && user.client?.prefs?.muted & MUTE_IC)
|
||||
to_chat(user, "You cannot send IC messages (muted).")
|
||||
return FALSE
|
||||
else if(!params)
|
||||
|
||||
@@ -1105,7 +1105,7 @@
|
||||
if(client)
|
||||
client.move_delay = world.time + movement_delay()
|
||||
lying_prev = lying
|
||||
if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client.prefs.autostand)//CIT CHANGE - adds autostanding as a preference
|
||||
if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client?.prefs?.autostand)//CIT CHANGE - adds autostanding as a preference
|
||||
addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
|
||||
return canmove
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
deaf_message = "<span class='notice'>You can't hear yourself!</span>"
|
||||
deaf_type = 2 // Since you should be able to hear yourself without looking
|
||||
// Create map text prior to modifying message for goonchat
|
||||
if (client?.prefs.chat_on_map && stat != UNCONSCIOUS && (client.prefs.see_chat_non_mob || ismob(speaker)) && can_hear())
|
||||
if (client?.prefs.chat_on_map && stat != UNCONSCIOUS && (client?.prefs?.see_chat_non_mob || ismob(speaker)) && can_hear())
|
||||
create_chat_message(speaker, message_language, raw_message, spans, message_mode)
|
||||
if (client?.prefs.radiosounds && stat != UNCONSCIOUS && can_hear() && radio_freq)
|
||||
playsound_local(src,'sound/voice/radio.ogg', 30, 0)
|
||||
@@ -281,9 +281,9 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
if(!M.client || !client) //client is so that ghosts don't have to listen to mice
|
||||
continue
|
||||
if(get_dist(M, source) > 7 || M.z != z) //they're out of range of normal hearing
|
||||
if(eavesdropping_modes[message_mode] && !(M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER)) //they're whispering and we have hearing whispers at any range off
|
||||
if(eavesdropping_modes[message_mode] && !(M.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER)) //they're whispering and we have hearing whispers at any range off
|
||||
continue
|
||||
if(!(M.client.prefs.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off
|
||||
if(!(M.client?.prefs?.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off
|
||||
continue
|
||||
listening |= M
|
||||
the_dead[M] = TRUE
|
||||
@@ -306,7 +306,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
//speech bubble
|
||||
var/list/speech_bubble_recipients = list()
|
||||
for(var/mob/M in listening)
|
||||
if(M.client && !M.client.prefs.chat_on_map)
|
||||
if(M.client && !M.client?.prefs?.chat_on_map)
|
||||
speech_bubble_recipients.Add(M.client)
|
||||
var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", FLY_LAYER)
|
||||
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
|
||||
@@ -321,7 +321,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
|
||||
|
||||
/mob/living/proc/can_speak_basic(message, ignore_spam = FALSE) //Check BEFORE handling of xeno and ling channels
|
||||
if(client)
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
if(client?.prefs?.muted & MUTE_IC)
|
||||
to_chat(src, "<span class='danger'>You cannot speak in IC (muted).</span>")
|
||||
return 0
|
||||
if(!ignore_spam && client.handle_spam_prevention(message,MUTE_IC))
|
||||
|
||||
@@ -830,7 +830,7 @@
|
||||
jobpart = "Unknown"
|
||||
|
||||
var/rendered = "<i><span class='game say'>[start]<span class='name'>[hrefpart][namepart] ([jobpart])</a> </span><span class='message'>[treated_message]</span></span></i>"
|
||||
if (client?.prefs.chat_on_map && (client.prefs.see_chat_non_mob || ismob(speaker)))
|
||||
if (client?.prefs.chat_on_map && (client?.prefs?.see_chat_non_mob || ismob(speaker)))
|
||||
create_chat_message(speaker, message_language, raw_message, spans, message_mode)
|
||||
|
||||
show_message(rendered, MSG_AUDIBLE)
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
if(!only_listener)
|
||||
// Play voice for all mobs in the z level
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M.client && M.can_hear() && (M.client.prefs.toggles & SOUND_ANNOUNCEMENTS))
|
||||
if(M.client && M.can_hear() && (M.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS))
|
||||
var/turf/T = get_turf(M)
|
||||
if(T.z == z_level)
|
||||
SEND_SOUND(M, voice)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
create_mob_hud()
|
||||
if(hud_used)
|
||||
hud_used.show_hud(hud_used.hud_version)
|
||||
hud_used.update_ui_style(ui_style2icon(client.prefs.UI_style))
|
||||
hud_used.update_ui_style(ui_style2icon(client?.prefs?.UI_style))
|
||||
|
||||
next_move = 1
|
||||
|
||||
|
||||
@@ -488,11 +488,11 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA
|
||||
if(!ckey)
|
||||
return
|
||||
SEND_SIGNAL(new_mob, COMSIG_MOB_PRE_PLAYER_CHANGE, new_mob, src)
|
||||
if (client && client.prefs && client.prefs.auto_ooc)
|
||||
if (client.prefs.chat_toggles & CHAT_OOC && isliving(new_mob))
|
||||
client.prefs.chat_toggles ^= CHAT_OOC
|
||||
if (!(client.prefs.chat_toggles & CHAT_OOC) && isdead(new_mob))
|
||||
client.prefs.chat_toggles ^= CHAT_OOC
|
||||
if (client && client.prefs && client?.prefs?.auto_ooc)
|
||||
if (client?.prefs?.chat_toggles & CHAT_OOC && isliving(new_mob))
|
||||
client?.prefs?.chat_toggles ^= CHAT_OOC
|
||||
if (!(client?.prefs?.chat_toggles & CHAT_OOC) && isdead(new_mob))
|
||||
client?.prefs?.chat_toggles ^= CHAT_OOC
|
||||
new_mob.ckey = ckey
|
||||
new_mob.client?.init_verbs()
|
||||
if(send_signal)
|
||||
|
||||
@@ -401,8 +401,8 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
|
||||
if(source)
|
||||
var/obj/screen/alert/notify_action/A = O.throw_alert("[REF(source)]_notify_action", /obj/screen/alert/notify_action)
|
||||
if(A)
|
||||
if(O.client.prefs && O.client.prefs.UI_style)
|
||||
A.icon = ui_style2icon(O.client.prefs.UI_style)
|
||||
if(O.client.prefs && O.client?.prefs?.UI_style)
|
||||
A.icon = ui_style2icon(O.client?.prefs?.UI_style)
|
||||
A.desc = message
|
||||
A.action = action
|
||||
A.target = source
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
|
||||
if (src.client)
|
||||
if(src.client.prefs.muted & MUTE_DEADCHAT)
|
||||
if(src.client?.prefs?.muted & MUTE_DEADCHAT)
|
||||
to_chat(src, "<span class='danger'>You cannot talk in deadchat (muted).</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ proc/get_top_level_mob(var/mob/S)
|
||||
if(jobban_isbanned(user, "emote"))
|
||||
to_chat(user, "You cannot send subtle emotes (banned).")
|
||||
return FALSE
|
||||
else if(user.client && user.client.prefs.muted & MUTE_IC)
|
||||
else if(user.client && user.client?.prefs?.muted & MUTE_IC)
|
||||
to_chat(user, "You cannot send IC messages (muted).")
|
||||
return FALSE
|
||||
else if(!params)
|
||||
@@ -69,7 +69,7 @@ proc/get_top_level_mob(var/mob/S)
|
||||
if(!M.client || isnewplayer(M))
|
||||
continue
|
||||
var/T = get_turf(src)
|
||||
if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)))
|
||||
if(M.stat == DEAD && M.client && (M.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)))
|
||||
M.show_message(message)
|
||||
|
||||
if(emote_type == EMOTE_AUDIBLE)
|
||||
@@ -100,7 +100,7 @@ proc/get_top_level_mob(var/mob/S)
|
||||
if(jobban_isbanned(user, "emote"))
|
||||
to_chat(user, "You cannot send subtle emotes (banned).")
|
||||
return FALSE
|
||||
else if(user.client && user.client.prefs.muted & MUTE_IC)
|
||||
else if(user.client && user.client?.prefs?.muted & MUTE_IC)
|
||||
to_chat(user, "You cannot send IC messages (muted).")
|
||||
return FALSE
|
||||
else if(!params)
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
// Remove titlebar and resize handles for a fancy window
|
||||
var/have_title_bar
|
||||
if(user.client.prefs.tgui_fancy)
|
||||
if(user.client?.prefs?.tgui_fancy)
|
||||
have_title_bar = "titlebar=0;can_resize=0;"
|
||||
else
|
||||
have_title_bar = "titlebar=1;can_resize=1;"
|
||||
@@ -219,8 +219,8 @@
|
||||
"screen" = ui_screen,
|
||||
"style" = style,
|
||||
"interface" = interface,
|
||||
"fancy" = user.client.prefs.tgui_fancy,
|
||||
"locked" = user.client.prefs.tgui_lock && !custom_browser_id,
|
||||
"fancy" = user.client?.prefs?.tgui_fancy,
|
||||
"locked" = user.client?.prefs?.tgui_lock && !custom_browser_id,
|
||||
"observer" = isobserver(user),
|
||||
"window" = window_id,
|
||||
// NOTE: Intentional \ref usage; tgui datums can't/shouldn't
|
||||
@@ -269,9 +269,9 @@
|
||||
if("tgui:link")
|
||||
user << link(params["url"])
|
||||
if("tgui:fancy")
|
||||
user.client.prefs.tgui_fancy = TRUE
|
||||
user.client?.prefs?.tgui_fancy = TRUE
|
||||
if("tgui:nofrills")
|
||||
user.client.prefs.tgui_fancy = FALSE
|
||||
user.client?.prefs?.tgui_fancy = FALSE
|
||||
else
|
||||
update_status(push = FALSE) // Update the window state.
|
||||
if(src_object.ui_act(action, params, src, state)) // Call ui_act() on the src_object.
|
||||
|
||||
@@ -108,8 +108,8 @@ Notes:
|
||||
/proc/openToolTip(mob/user = null, atom/movable/tip_src = null, params = null,title = "",content = "",theme = "")
|
||||
if(istype(user))
|
||||
if(user.client && user.client.tooltips)
|
||||
if(!theme && user.client.prefs && user.client.prefs.UI_style)
|
||||
theme = lowertext(user.client.prefs.UI_style)
|
||||
if(!theme && user.client.prefs && user.client?.prefs?.UI_style)
|
||||
theme = lowertext(user.client?.prefs?.UI_style)
|
||||
if(!theme)
|
||||
theme = "default"
|
||||
user.client.tooltips.show(tip_src, params,title,content,theme)
|
||||
|
||||
Reference in New Issue
Block a user