Files
Paradise/code/datums/keybindings/communication_keybinds.dm
T
3be2d5f8b6 TGUI say: Upgrades chat input with modern features (#23907)
* initial stuff (broken)

* initial stuff (works)

* fix most other things

* fix thinking indicator

* file name moment

* contra review

* better logs

* snowball feedback

* expanded drag handles

* Update code/modules/tgui_input/say_modal/tgui_say_modal.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* Update code/modules/tgui_input/say_modal/tgui_say_modal.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* Drag handle

* fix missing colours

* TGUI rebuild (im clever)

* Make msay useable by admins again (i hope)

* fixed blacklist channel leaks due to lack of user eyes

* clear old TGUIsay macros on keybind update

* TGUI say tweaks

* Update code/modules/tgui_input/say_modal/tgui_say_modal.dm

* whisper is now a channel

* remove placeholder, shorten width

* tidies prefs, fix lightmode, refactor typing/thinking indicators

* clarify more prefs

* TG Typing Indicators and increace layer

* modifiers?

* makes the TGUI say macros serverside

* add checks for muted stuff

* dgamer review

* fix talk and type issue

* Update code/datums/keybindings/communication_keybinds.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* review and binary stuff

* Removes force say from TGUI say

* updated

* Apply suggestions from code review

Co-authored-by: Aylong <69762909+AyIong@users.noreply.github.com>

* remove verb

* le rebuild

* better behaviour on illegal entries

---------

Co-authored-by: Aylong <alexanderkitsa@gmail.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: GDN <Roanrichards1@Gmail.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Aylong <69762909+AyIong@users.noreply.github.com>
2024-02-15 19:31:29 +01:00

75 lines
2.0 KiB
Plaintext

/datum/keybinding/client/communication
category = KB_CATEGORY_COMMUNICATION
/// Used to store special rights if required by a keybind, such as R_ADMIN
var/required_rights
/// Used to map muted categories to channels
var/mute_category = MUTE_OOC
/datum/keybinding/client/communication/down(client/C)
. = ..()
if(required_rights && !check_rights(required_rights, FALSE, C.mob))
return
if(mute_category && check_mute(C.ckey, mute_category))
to_chat(C, "<span class='danger'>You cannot use [name] (muted).</span>", MESSAGE_TYPE_WARNING)
return
winset(C, null, "command=[C.tgui_say_create_open_command(name)]")
/datum/keybinding/client/communication/ooc
name = OOC_CHANNEL
keys = list("O")
/datum/keybinding/client/communication/ooc/down(client/C)
if(check_rights(R_ADMIN, FALSE, C.mob)) // You may pass
return ..()
if(!GLOB.ooc_enabled)
to_chat(C, "<span class='danger'>OOC is globally muted.</span>", MESSAGE_TYPE_WARNING)
return
if(!GLOB.dooc_enabled && C.mob.stat == DEAD)
to_chat(C, "<span class='danger'>OOC for dead mobs has been turned off.</span>", MESSAGE_TYPE_WARNING)
return
return ..()
/datum/keybinding/client/communication/looc
name = LOOC_CHANNEL
keys = list("L")
/datum/keybinding/client/communication/say
name = SAY_CHANNEL
keys = list("T")
mute_category = MUTE_IC
/datum/keybinding/client/communication/me
name = ME_CHANNEL
keys = list("M")
mute_category = MUTE_EMOTE
/datum/keybinding/client/communication/whisper
name = WHISPER_CHANNEL
keys = list("U")
mute_category = MUTE_IC
/datum/keybinding/client/communication/radio
name = RADIO_CHANNEL
keys = list("Y")
mute_category = MUTE_IC
/datum/keybinding/client/communication/msay
name = MENTOR_CHANNEL
keys = list("F4")
required_rights = R_MENTOR | R_ADMIN
/datum/keybinding/client/communication/asay
name = ADMIN_CHANNEL
keys = list("F5")
required_rights = R_ADMIN
/datum/keybinding/client/communication/dsay
name = DSAY_CHANNEL
keys = list("F10")
required_rights = R_ADMIN