diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 9fbf8e81ebf..c0ef908406e 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -337,3 +337,12 @@ proc/TextPreview(var/string,var/len=40) /proc/trim_strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN) return trim(strip_html_properly(input, max_length)) + +//For generating neat chat tag-images +//The icon var could be local in the proc, but it's a waste of resources +// to always create it and then throw it out. +/var/icon/text_tag_icons = new('./icons/chattags.dmi') +/proc/create_text_tag(var/tagname, var/tagdesc = tagname, var/client/C = null) + if(C && (C.prefs.toggles & CHAT_NOICONS)) + return tagdesc + return "[tagdesc]" diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index f071b10a0b3..c57633678a3 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -121,6 +121,16 @@ feedback_add_details("admin_verb","TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/verb/toggle_chattags() + set name = "Show/Hide Chat Tags" + set category = "Preferences" + set desc = "Toggles seeing chat tags/icons" + prefs.toggles ^= CHAT_NOICONS + prefs.save_preferences() + + src << "You will [!(prefs.toggles & CHAT_NOICONS) ? "now" : "no longer"] see chat tag icons." + feedback_add_details("admin_verb","TCTAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + /client/verb/Toggle_Soundscape() //All new ambience should be added here so it works with this verb until someone better at things comes up with a fix that isn't awful set name = "Hear/Silence Ambience" diff --git a/code/setup.dm b/code/setup.dm index 1bb0a424446..524c498f62a 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -653,7 +653,7 @@ var/list/robot_module_types = list("Standard", "Engineering", "Construction", "S #define CHAT_LOOC 4096 #define CHAT_GHOSTRADIO 8192 #define SHOW_TYPING 16384 - +#define CHAT_NOICONS 32768 #define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_ATTACKLOGS|CHAT_LOOC) diff --git a/icons/chattags.dmi b/icons/chattags.dmi new file mode 100644 index 00000000000..317ce5a992b Binary files /dev/null and b/icons/chattags.dmi differ