1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-07 00:58:39 +02:00

- setting system: replaced settings.txt + sysopt.bin with json-based system (defaultSetting.json + settings.json)

- some work on system settings window
- new menu for selecting resolution (reused town portal graphics), can be opened from system settings
This commit is contained in:
Ivan Savenko
2012-01-12 15:23:00 +00:00
parent 046e54563c
commit 86e7d96b39
25 changed files with 1179 additions and 758 deletions

View File

@ -941,6 +941,16 @@ void CListBox::reset()
updatePositions();
}
void CListBox::scrollTo(size_t which)
{
//scroll up
if (first > which)
moveToPos(which);
//scroll down
else if (first + items.size() <= which)
moveToPos(which - items.size());
}
void CListBox::moveToPos(size_t which)
{
//Calculate new position
@ -1193,6 +1203,16 @@ void CLabel::setTxt(const std::string &Txt)
}
}
CLabelGroup::CLabelGroup(EFonts Font, EAlignment Align, const SDL_Color &Color):
font(Font), align(Align), color(Color)
{};
void CLabelGroup::add(int x, int y, const std::string &text)
{
OBJ_CONSTRUCTION_CAPTURING_ALL;
new CLabel(x, y, font, align, color, text);
};
CTextBox::CTextBox(std::string Text, const Rect &rect, int SliderStyle, EFonts Font /*= FONT_SMALL*/, EAlignment Align /*= TOPLEFT*/, const SDL_Color &Color /*= Colors::Cornsilk*/)
:CLabel(rect.x, rect.y, Font, Align, Color, Text), sliderStyle(SliderStyle), slider(NULL)
{