Latched vars were not displaying on the menus (only really noticable in the video menu)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@172 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
f1759c3619
commit
bb9f6374df
1 changed files with 11 additions and 4 deletions
|
@ -172,11 +172,13 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu)
|
||||||
if (option->slider.var)
|
if (option->slider.var)
|
||||||
{
|
{
|
||||||
#define SLIDER_RANGE 10
|
#define SLIDER_RANGE 10
|
||||||
float range = (option->slider.var->value - option->slider.min)/(option->slider.max-option->slider.min);
|
float range;
|
||||||
int i;
|
int i;
|
||||||
int x = xpos+option->common.posx;
|
int x = xpos+option->common.posx;
|
||||||
int y = ypos+option->common.posy;
|
int y = ypos+option->common.posy;
|
||||||
|
|
||||||
|
range = (option->slider.current - option->slider.min)/(option->slider.max-option->slider.min);
|
||||||
|
|
||||||
if (option->slider.text)
|
if (option->slider.text)
|
||||||
{
|
{
|
||||||
if (!menu->cursoritem && menu->selecteditem == option)
|
if (!menu->cursoritem && menu->selecteditem == option)
|
||||||
|
@ -206,6 +208,8 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu)
|
||||||
on = option->check.func(option, CHK_CHECKED);
|
on = option->check.func(option, CHK_CHECKED);
|
||||||
else if (!option->check.var)
|
else if (!option->check.var)
|
||||||
on = option->check.value;
|
on = option->check.value;
|
||||||
|
else if (option->check.var->latched_string)
|
||||||
|
on = atof(option->check.var->latched_string);
|
||||||
else
|
else
|
||||||
on = option->check.var->value;
|
on = option->check.var->value;
|
||||||
|
|
||||||
|
@ -754,6 +758,9 @@ void MC_CheckBox_Key(menucheck_t *option, int key)
|
||||||
option->value = !option->value;
|
option->value = !option->value;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (option->var->latched_string)
|
||||||
|
Cvar_SetValue(option->var, !atof(option->var->latched_string));
|
||||||
|
else
|
||||||
Cvar_SetValue(option->var, !option->var->value);
|
Cvar_SetValue(option->var, !option->var->value);
|
||||||
S_LocalSound ("misc/menu2.wav");
|
S_LocalSound ("misc/menu2.wav");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue