From 64a15470dfd58e21364310f5931739708c61e9b9 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 23 Aug 2015 11:20:38 +1000 Subject: [PATCH] Add another hook, also reserve some stat slots for the mod --- qcsrc/client/main.qc | 2 ++ qcsrc/client/mutators/events.qh | 3 +++ qcsrc/client/view.qc | 4 ++++ qcsrc/common/stats.qh | 32 ++++++++++++++++---------------- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 231dd6867..12157531d 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -23,6 +23,8 @@ #include "wall.qh" #include "waypointsprites.qh" +#include "mutators/events.qh" + #include "../common/vehicles/unit/bumblebee.qh" #include "../common/vehicles/cl_vehicles.qh" #include "../common/vehicles/vehicles.qh" diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index 362e8d321..41177cb66 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -35,4 +35,7 @@ string cmd_string; /**/ MUTATOR_HOOKABLE(CSQC_ConsoleCommand, EV_CSQC_ConsoleCommand); +/* Called when the crosshair is being updated */ +MUTATOR_HOOKABLE(UpdateCrosshair, EV_NO_ARGS); + #endif diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 67bcf4224..1475bf232 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -10,6 +10,8 @@ #include "shownames.qh" #include "waypointsprites.qh" +#include "mutators/events.qh" + #include "../common/constants.qh" #include "../common/mapinfo.qh" #include "../common/nades.qh" @@ -801,6 +803,8 @@ void UpdateCrosshair() wcross_alpha_prev = wcross_alpha; wcross_color_prev = wcross_color; + MUTATOR_CALLHOOK(UpdateCrosshair); + wcross_scale *= 1 - autocvar__menu_alpha; wcross_alpha *= 1 - autocvar__menu_alpha; wcross_size = draw_getimagesize(wcross_name) * wcross_scale; diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index eb6b0ea97..7f82ae598 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -190,22 +190,22 @@ const int STAT_CTF_FLAGSTATUS = 124; // 137 empty? // 138 empty? // 139 empty? -// 140 empty? -// 141 empty? -// 142 empty? -// 143 empty? -// 144 empty? -// 145 empty? -// 146 empty? -// 147 empty? -// 148 empty? -// 149 empty? -// 150 empty? -// 151 empty? -// 152 empty? -// 153 empty? -// 154 empty? -// 155 empty? +// 140 reserved +// 141 reserved +// 142 reserved +// 143 reserved +// 144 reserved +// 145 reserved +// 146 reserved +// 147 reserved +// 148 reserved +// 149 reserved +// 150 reserved +// 151 reserved +// 152 reserved +// 153 reserved +// 154 reserved +// 155 reserved // 156 empty? // 157 empty? // 158 empty? -- 2.39.2