From ef9366a025f8ac300093523bd98f28e788eb4c7f Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 1 May 2020 00:04:41 +0200 Subject: [PATCH] Menu: If an item depending on a cvar which is also controlled by another item gets re-enabled, reload its controlled cvar since it may have changed; it fixes wrong color in the color picker of the hud panel dialogues, now it's correctly reset to white. --- qcsrc/menu/xonotic/util.qc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index a126b9e5da..5e9fdb03d9 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -127,6 +127,7 @@ void makeCallback(entity e, entity cbent, void(entity, entity) cbfunc) .bool disabled; void setDependent_Check(entity e) { + bool disabled_prev = e.disabled; float f; string s; if(e.func_setDependent) @@ -165,6 +166,8 @@ void setDependent_Check(entity e) e.disabled = (e.disabled + ((f >= e.cvar3Max_setDependent) && (f <= e.cvar3Min_setDependent)) > e.op_setDependent); } } + if (disabled_prev != e.disabled && e.loadCvars) + e.loadCvars(e); } void setDependent_Draw(entity e) { -- 2.39.2