From 05460a0fbdadb921ed3b5814a2441e465ddac555 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 10 Mar 2014 11:41:15 +0100 Subject: [PATCH] By default, show changed cvars only. --- qcsrc/menu/xonotic/cvarlist.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/qcsrc/menu/xonotic/cvarlist.c b/qcsrc/menu/xonotic/cvarlist.c index 15cd91758..a0d0bc00d 100644 --- a/qcsrc/menu/xonotic/cvarlist.c +++ b/qcsrc/menu/xonotic/cvarlist.c @@ -53,8 +53,7 @@ void XonoticCvarList_configureXonoticCvarList(entity me) me.configureXonoticListBox(me); me.handle = buf_create(); - buf_cvarlist(me.handle, "", "_"); - me.nItems = buf_getsize(me.handle); + CvarList_Filter_Change(world, me); // world.text is always "" } void XonoticCvarList_destroy(entity me) { @@ -139,9 +138,16 @@ void CvarList_Filter_Change(entity box, entity me) float o; for (i = 0, o = 0; i < n; ++i) { string n = bufstr_get(me.handle, i); - if (strstrofs(n, filter, 0) < 0) - if (strstrofs(cvar_description(n), filter, 0) < 0) - continue; + if (filter == "") { + // Empty filter? Show changed only. + if (cvar_string(n) == cvar_defstring(n)) + continue; + } else { + // Otherwise apply filter. + if (strstrofs(n, filter, 0) < 0) + if (strstrofs(cvar_description(n), filter, 0) < 0) + continue; + } bufstr_set(me.handle, o, bufstr_get(me.handle, i)); ++o; } -- 2.39.2