- some layout tweaks for the option menu system, in particular to shorten the sliders if the menu is too wide.
- allow specifying the fractional precision for the numbers behind the sliders. - took all HUD related options out of the display options menu and created a seaparate one for them. - added several more display and HUD options to the menu. - created a new 'Miscellaneous options' menu for a few items that should be accessible but don't fit anywhere else. SVN r2795 (trunk)
This commit is contained in:
parent
deef0e0a88
commit
ee87fdc58e
4 changed files with 172 additions and 73 deletions
|
|
@ -66,47 +66,6 @@ void M_DrawConText (int color, int x, int y, const char *str)
|
|||
TAG_DONE);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Draw a slider. Set fracdigits negative to not display the current value numerically.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
void M_DrawSlider (int x, int y, double min, double max, double cur,int fracdigits)
|
||||
{
|
||||
double range;
|
||||
|
||||
range = max - min;
|
||||
double ccur = clamp(cur, min, max) - min;
|
||||
|
||||
if (CleanXfac > CleanXfac_1 || CleanXfac_1 * 320 < screen->GetWidth())
|
||||
{
|
||||
M_DrawConText(CR_WHITE, x, y, "\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12");
|
||||
M_DrawConText(CR_ORANGE, x + int((5 + ((ccur * 78) / range)) * CleanXfac_1), y, "\x13");
|
||||
|
||||
if (fracdigits >= 0)
|
||||
{
|
||||
char textbuf[16];
|
||||
mysnprintf(textbuf, countof(textbuf), "%.*f", fracdigits, cur);
|
||||
screen->DrawText(SmallFont, CR_DARKGRAY, x + (12*8 + 4) * CleanXfac_1, y, textbuf, DTA_CleanNoMove_1, true, TAG_DONE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// On 320x200 we need a shorter slider
|
||||
M_DrawConText(CR_WHITE, x, y, "\x10\x11\x11\x11\x11\x11\x12");
|
||||
M_DrawConText(CR_ORANGE, x + int((5 + ((ccur * 38) / range)) * CleanXfac_1), y, "\x13");
|
||||
|
||||
if (fracdigits >= 0)
|
||||
{
|
||||
char textbuf[16];
|
||||
mysnprintf(textbuf, countof(textbuf), "%.*f", fracdigits, cur);
|
||||
screen->DrawText(SmallFont, CR_DARKGRAY, x + (7*8 + 4) * CleanXfac_1, y, textbuf, DTA_CleanNoMove_1, true, TAG_DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
IMPLEMENT_CLASS(DOptionMenu)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue