From a657edd12655a4fe86802f5fe2a3223cff021c5b Mon Sep 17 00:00:00 2001 From: otta8634 Date: Sat, 25 Jan 2025 23:05:01 +0800 Subject: [PATCH] Make filtering work for gamemodes and mutators Did this by applying the same workaround as the COLORED_NAME macros, using .message if it exists, otherwise .m_name. In future ideally .message would be renamed to .m_name on Mutators and Gametypes. See https://gitlab.com/xonotic/xonotic-data.pk3dir/-/merge_requests/181#note_2291392189 for more. --- qcsrc/menu/xonotic/guide/guide.qh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qcsrc/menu/xonotic/guide/guide.qh b/qcsrc/menu/xonotic/guide/guide.qh index 568f0208f6..5da247225f 100644 --- a/qcsrc/menu/xonotic/guide/guide.qh +++ b/qcsrc/menu/xonotic/guide/guide.qh @@ -74,7 +74,8 @@ CLASS(id, DataSource) \ } \ METHOD(id, reload, int(id this, string filter)) { \ arr_name##_MENU_COUNT = 0; \ - _REGISTRY_SOURCE_FILL(arr_name, register_arr, cond1, cond2, cond3, num_conds, filter == "" ? true : (strstrofs(strtolower(it.m_name), strtolower(filter), 0) >= 0)); \ + _REGISTRY_SOURCE_FILL(arr_name, register_arr, cond1, cond2, cond3, num_conds, \ + (filter == "" ? true : (strstrofs(strtolower(it.message ? it.message : it.m_name), strtolower(filter), 0) >= 0))); \ return arr_name##_MENU_COUNT; \ } \ ENDCLASS(id) -- 2.39.5