Skip to content

Commit

Permalink
port ckey in deadchat from yogs (shiptest-ss13#2187)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
ports yogstation13/Yogstation#4134

## Why It's Good For The Game

helps people find each other

## Changelog

:cl:
add: adds a preference to show your username in deadchat
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: GenericDM <34109002+GenericDM@users.noreply.github.com>
Co-authored-by: Generic DM <genericdm.dm@gmail.com>
  • Loading branch information
2 people authored and MarkSuckerberg committed Aug 11, 2023
1 parent 7d00283 commit ea4f8a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/__DEFINES/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#define CHAT_GHOSTLAWS (1<<11)
#define CHAT_LOOC (1<<12)
#define CHAT_LOGIN_LOGOUT (1<<13)
#define CHAT_GHOSTCKEY (1<<14)

#define TOGGLES_DEFAULT_CHAT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_PULLR|CHAT_GHOSTWHISPER|CHAT_GHOSTPDA|CHAT_GHOSTRADIO|CHAT_BANKCARD|CHAT_GHOSTLAWS|CHAT_LOOC|CHAT_LOGIN_LOGOUT)

Expand Down
11 changes: 11 additions & 0 deletions code/modules/client/preferences_toggles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,17 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/settings, listen_looc)()
return C.prefs.chat_toggles & CHAT_LOOC
//EndWS Edit

TOGGLE_CHECKBOX(/datum/verbs/menu/Settings, chat_ghostckey)()
set name = "Show/Hide ckey in deadchat"
set category = "Preferences"
set desc = "Toggle if players will see your ckey in deadchat"
usr.client.prefs.chat_toggles ^= CHAT_GHOSTCKEY
usr.client.prefs.save_preferences()
to_chat(usr, "Your ckey is [(usr.client.prefs.chat_toggles & CHAT_GHOSTCKEY) ? "now" : "no longer"] visible in deadchat.")
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle ckey in Deadchat", "[usr.client.prefs.toggles & CHAT_GHOSTCKEY ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/verbs/menu/Settings/chat_ghostckey/Get_checked(client/C)
return C.prefs.chat_toggles & CHAT_GHOSTCKEY

TOGGLE_CHECKBOX(/datum/verbs/menu/Settings, listen_bank_card)()
set name = "Show/Hide Income Updates"
set category = "Preferences"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
alt_name = " (died as [real_name])"

var/spanned = say_quote(say_emphasis(message))
var/source = "<span class='game'><span class='prefix'>DEAD:</span> <span class='name'>[name]</span>[alt_name]"
var/source = "<span class='game'><span class='prefix'>DEAD:</span> <span class='name'>[(src.client.prefs.chat_toggles & CHAT_GHOSTCKEY) ? "([src.key]) " : ""][name]</span>[alt_name]"
var/rendered = " <span class='message'>[emoji_parse(spanned)]</span></span>"
log_talk(message, LOG_SAY, tag="DEAD")
if(SEND_SIGNAL(src, COMSIG_MOB_DEADSAY, message) & MOB_DEADSAY_SIGNAL_INTERCEPT)
Expand Down

0 comments on commit ea4f8a2

Please sign in to comment.