From: Mario Date: Thu, 25 Jul 2024 16:23:45 +0000 (+1000) Subject: Add a hook to allow mutators to hide or override the chat bubble X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9ee259b109428cbb5c1b3d5dc1e6a3c14a9d60a8;p=xonotic%2Fxonotic-data.pk3dir.git Add a hook to allow mutators to hide or override the chat bubble --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 19a964361..bc5c57600 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1326,7 +1326,7 @@ void ChatBubbleThink(entity this) this.mdl = ""; - if ( !IS_DEAD(this.owner) && IS_PLAYER(this.owner) ) + if ( !IS_DEAD(this.owner) && IS_PLAYER(this.owner) && !MUTATOR_CALLHOOK(ShowChatBubble, this.owner, this) ) { if ( CS(this.owner).active_minigame && PHYS_INPUT_BUTTON_MINIGAME(this.owner) ) this.mdl = "models/sprites/minigame_busy.iqm"; diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 0022605ca..613392788 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -1295,3 +1295,10 @@ MUTATOR_HOOKABLE(Sandbox_SaveAllowed, EV_NO_ARGS); /** player */ i(entity, MUTATOR_ARGV_0_entity) \ /**/ MUTATOR_HOOKABLE(Sandbox_EditAllowed, EV_Sandbox_EditAllowed); + +/** Return true to hide the chat bubble above typing players */ +#define EV_ShowChatBubble(i, o) \ + /** player */ i(entity, MUTATOR_ARGV_0_entity) \ + /** bubble */ i(entity, MUTATOR_ARGV_1_entity) \ + /**/ +MUTATOR_HOOKABLE(ShowChatBubble, EV_ShowChatBubble);