]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hook for custom gameplay tips
authorMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 13:49:02 +0000 (23:49 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 13:49:02 +0000 (23:49 +1000)
qcsrc/common/mutators/events.qh
qcsrc/server/teamplay.qc

index eb46486b6b8e6ca4a00ed7f4fedcd6fee7990c37..8a5c153ad7024f7eb1ae6c728b6243e4869438df 100644 (file)
@@ -39,4 +39,11 @@ MUTATOR_HOOKABLE(BuildMutatorsString, EV_BuildMutatorsString);
     /**/
 MUTATOR_HOOKABLE(BuildMutatorsPrettyString, EV_BuildMutatorsPrettyString);
 
     /**/
 MUTATOR_HOOKABLE(BuildMutatorsPrettyString, EV_BuildMutatorsPrettyString);
 
+/** appends mutator string for displaying extra gameplay tips */
+#define EV_BuildGameplayTipsString(i, o) \
+    /**/ i(string, ret_string) \
+    /**/ o(string, ret_string) \
+    /**/
+MUTATOR_HOOKABLE(BuildGameplayTipsString, EV_BuildGameplayTipsString);
+
 #endif
 #endif
index 3621f7214e5611afcdc9d1bb76f6804041170e69..b41ebaca9f6c4b3606808dc58394a53ff9b8d279 100644 (file)
@@ -344,6 +344,12 @@ string getwelcomemessage(void)
                s = strcat(s, "\n\n^8special gameplay tips: ^7", cache_mutatormsg);
        }
 
                s = strcat(s, "\n\n^8special gameplay tips: ^7", cache_mutatormsg);
        }
 
+       string mutator_msg = "";
+       MUTATOR_CALLHOOK(BuildGameplayTipsString, mutator_msg);
+       mutator_msg = ret_string;
+
+       s = strcat(s, mutator_msg); // trust that the mutator will do proper formatting
+
        motd = autocvar_sv_motd;
        if (motd != "") {
                s = strcat(s, "\n\n^8MOTD: ^7", strreplace("\\n", "\n", motd));
        motd = autocvar_sv_motd;
        if (motd != "") {
                s = strcat(s, "\n\n^8MOTD: ^7", strreplace("\\n", "\n", motd));