]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hook to allow mutators to hide or override the chat bubble
authorMario <mario.mario@y7mail.com>
Thu, 25 Jul 2024 16:23:45 +0000 (02:23 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 25 Jul 2024 16:23:45 +0000 (02:23 +1000)
qcsrc/server/client.qc
qcsrc/server/mutators/events.qh

index 19a9643616cc0ff5cc3438222be5779e90820d2a..bc5c576003b76562e54b58224e9510d0c3ca1391 100644 (file)
@@ -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";
index 0022605caeed1ce8b5e0fd6f1c3533317d214cf6..613392788616520b0f60cf5e2e17005e51c8d8cb 100644 (file)
@@ -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);