From: terencehill Date: Thu, 30 Apr 2020 22:04:41 +0000 (+0200) Subject: Menu: If an item depending on a cvar which is also controlled by another item gets... X-Git-Tag: xonotic-v0.8.5~1096 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=ef9366a025f8ac300093523bd98f28e788eb4c7f 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. --- 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) {