From: otta8634 Date: Sat, 25 Jan 2025 15:05:01 +0000 (+0800) Subject: Make filtering work for gamemodes and mutators X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a657edd12655a4fe86802f5fe2a3223cff021c5b;p=xonotic%2Fxonotic-data.pk3dir.git 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. --- 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)