]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make filtering work for gamemodes and mutators
authorotta8634 <k9wolf@pm.me>
Sat, 25 Jan 2025 15:05:01 +0000 (23:05 +0800)
committerotta8634 <k9wolf@pm.me>
Sat, 25 Jan 2025 15:05:01 +0000 (23:05 +0800)
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

index 568f0208f64c8f7bb78e95dc61f0c200631a422e..5da247225f260e74ad7973526ac9a8d6f014c630 100644 (file)
@@ -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)