1
0
Fork 0
forked from fte/fteqw

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:
Spoike 2004-09-07 23:15:19 +00:00
parent f1759c3619
commit bb9f6374df

View file

@ -172,11 +172,13 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu)
if (option->slider.var)
{
#define SLIDER_RANGE 10
float range = (option->slider.var->value - option->slider.min)/(option->slider.max-option->slider.min);
float range;
int i;
int x = xpos+option->common.posx;
int y = ypos+option->common.posy;
range = (option->slider.current - option->slider.min)/(option->slider.max-option->slider.min);
if (option->slider.text)
{
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);
else if (!option->check.var)
on = option->check.value;
else if (option->check.var->latched_string)
on = atof(option->check.var->latched_string);
else
on = option->check.var->value;
@ -754,7 +758,10 @@ void MC_CheckBox_Key(menucheck_t *option, int key)
option->value = !option->value;
else
{
Cvar_SetValue(option->var, !option->var->value);
if (option->var->latched_string)
Cvar_SetValue(option->var, !atof(option->var->latched_string));
else
Cvar_SetValue(option->var, !option->var->value);
S_LocalSound ("misc/menu2.wav");
}
}