- changed autoaim menu option to a slider which allows a more precise control of the property.

- having a value of 5000 as the default for autoaim makes no sense, since this is an angle value that will always be clamped to [0..35]. So now 35 is both the default and the maximum.
This commit is contained in:
Christoph Oelckers 2016-01-30 13:43:39 +01:00
parent 3b5af8484c
commit afcd755c7a
3 changed files with 8 additions and 28 deletions

View File

@ -60,7 +60,7 @@
static FRandom pr_pickteam ("PickRandomTeam"); static FRandom pr_pickteam ("PickRandomTeam");
CVAR (Float, autoaim, 5000.f, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Float, autoaim, 35.f, CVAR_USERINFO | CVAR_ARCHIVE);
CVAR (String, name, "Player", CVAR_USERINFO | CVAR_ARCHIVE); CVAR (String, name, "Player", CVAR_USERINFO | CVAR_ARCHIVE);
CVAR (Color, color, 0x40cf00, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Color, color, 0x40cf00, CVAR_USERINFO | CVAR_ARCHIVE);
CVAR (Int, colorset, 0, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Int, colorset, 0, CVAR_USERINFO | CVAR_ARCHIVE);
@ -518,9 +518,9 @@ void D_UserInfoChanged (FBaseCVar *cvar)
autoaim = 0.0f; autoaim = 0.0f;
return; return;
} }
else if (autoaim > 5000.0f) else if (autoaim > 35.0f)
{ {
autoaim = 5000.f; autoaim = 35.f;
return; return;
} }
} }

View File

@ -479,7 +479,8 @@ void FSliderItem::Drawer(bool selected)
screen->DrawText(mFont, selected? OptionSettings.mFontColorSelection : mFontColor, mXpos, mYpos, text, DTA_Clean, true, TAG_DONE); screen->DrawText(mFont, selected? OptionSettings.mFontColorSelection : mFontColor, mXpos, mYpos, text, DTA_Clean, true, TAG_DONE);
int x = SmallFont->StringWidth ("Green") + 8 + mXpos; int x = SmallFont->StringWidth ("Green") + 8 + mXpos;
DrawSlider (x, mYpos); int x2 = SmallFont->StringWidth (mText) + 8 + mXpos;
DrawSlider (MAX(x2, x), mYpos);
} }
@ -630,14 +631,7 @@ void DPlayerMenu::Init(DMenu *parent, FListMenuDescriptor *desc)
li = GetItem(NAME_Autoaim); li = GetItem(NAME_Autoaim);
if (li != NULL) if (li != NULL)
{ {
int sel = li->SetValue(0, (int)autoaim);
autoaim == 0 ? 0 :
autoaim <= 0.25 ? 1 :
autoaim <= 0.5 ? 2 :
autoaim <= 1 ? 3 :
autoaim <= 2 ? 4 :
autoaim <= 3 ? 5:6;
li->SetValue(0, sel);
} }
li = GetItem(NAME_Switch); li = GetItem(NAME_Switch);
@ -966,13 +960,11 @@ void DPlayerMenu::SkinChanged (FListMenuItem *li)
void DPlayerMenu::AutoaimChanged (FListMenuItem *li) void DPlayerMenu::AutoaimChanged (FListMenuItem *li)
{ {
static const float ranges[] = { 0, 0.25, 0.5, 1, 2, 3, 5000 };
int sel; int sel;
if (li->GetValue(0, &sel)) if (li->GetValue(0, &sel))
{ {
autoaim = ranges[sel]; autoaim = (float)sel;
} }
} }

View File

@ -364,18 +364,6 @@ OptionValue "Gender"
2, "Other" 2, "Other"
} }
OptionValue "Autoaim"
{
0, "Never"
1, "Very low"
2, "Low"
3, "Medium"
4, "High"
5, "Very high"
6, "Always"
}
ListMenu "PlayerMenu" ListMenu "PlayerMenu"
{ {
StaticTextCentered 160, 6, "$MNU_PLAYERSETUP" StaticTextCentered 160, 6, "$MNU_PLAYERSETUP"
@ -414,7 +402,7 @@ ListMenu "PlayerMenu"
ValueText "Class", "Class" ValueText "Class", "Class"
ValueText "Skin", "Skin" ValueText "Skin", "Skin"
ValueText "Gender", "Gender", "Gender" ValueText "Gender", "Gender", "Gender"
ValueText "Autoaim", "Autoaim", "Autoaim" Slider "Autoaim", "Autoaim", 0, 35, 1
ValueText "Switch on pickup", "Switch", "OffOn" ValueText "Switch on pickup", "Switch", "OffOn"
ValueText "Always Run", "AlwaysRun", "OnOff" ValueText "Always Run", "AlwaysRun", "OnOff"
Class "PlayerMenu" Class "PlayerMenu"