From 7512246c8b1c85f89aded2e6691aa58a2c658e70 Mon Sep 17 00:00:00 2001 From: Amunak Date: Fri, 28 Nov 2014 11:15:22 +0100 Subject: [PATCH] Added toggleable 'chat tags' that can mark different channels in chat. They are toggleable in the player preferences verb-tab, default is on. They are not necessarily limited to anything, it is just an image in text. The main use is to mark some distinct channels (like OOC, LOOC, admin and mod cheat, dead chat, PMs, ...). To make them more visible, easily distinguishable and perhaps more visually appealing. --- code/__HELPERS/text.dm | 9 +++++++++ code/modules/client/preferences_toggles.dm | 10 ++++++++++ code/setup.dm | 2 +- icons/chattags.dmi | Bin 0 -> 1147 bytes 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 icons/chattags.dmi 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 0000000000000000000000000000000000000000..317ce5a992b23e3e37dc1c87c9789a1a03a4341e GIT binary patch literal 1147 zcmV->1cdvEP)V=-0C=2@&9Mr?Fce1NIrk}k+Fe?8%_1q%p?!rC%+&;%CZthc-$8JbWIMwL zr^RKsjx*FW(u>pX!Ul=+p(F8jCR<3HjwCF*hs}`aJKD3(42dR$TSLOQv_qmNaZlRw zw|{1>LE3n?6_pRBXbkHzihilsMZbh+u4Ic|>u9!|iqP^J|DhJcte~cmK8)9UJm2`% ztN;K5nMp)JRA_u+BD8w+RJ{vsz=IJ5>0LZ{u@KQ~CHA7n zia((tsko383Wd#~o_na!vVS3n`U9FCvSW8=-}%@z*$KwylFXBtefE84-kHbI@_irG z{q8z|LjW_#4;!tc=>`DQ@9&N19~6rXtNgCH4&Y0U!m*c_-+uv<`UUheFGcsN8f#B4 zw6r+|q}tzBR}3H*G!0F(L&C%Anx7wd64bsghQr>@C< zqQ2DgB2c%1v>YQ;Jn_w{Z z$DloX-ZkdLX3x8g&AMw$f3xoPo#6Mse{$CDV-{rqz}eNk5&aGTt6FLqErI4;6(;qi zcY@8^)raqEFTavpv`ukroB(ns*z3jHmX+ifpAG6e!D!&@J0FxNIs7;R>fN6O7Y&>x zLX;2&)<=wNPOy2qnwa^KgepN0I6)Qo869de6ai@Um#ln4E=EQa`%8ici8`JOje%}d(vyeMF@Bsjx;~3GO z1Yq?5qa_dqKblT34<{!3(P_71ZLd;EaE#BYPu>Z}U|GokSz8vk-ubP(6Z9&TM1ZU< z3!F+6r9YfILG|%7R57)SmzV N002ovPDHLkV1oRWEA#*W literal 0 HcmV?d00001