1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

Merge branch 'develop' into extended_statistic

This commit is contained in:
Laserlicht
2024-08-13 00:49:51 +02:00
committed by GitHub
151 changed files with 1062 additions and 499 deletions

View File

@ -340,12 +340,11 @@ Rect CMultiLineLabel::getTextLocation()
CLabelGroup::CLabelGroup(EFonts Font, ETextAlignment Align, const ColorRGBA & Color)
: font(Font), align(Align), color(Color)
{
defActions = 255 - DISPOSE;
}
void CLabelGroup::add(int x, int y, const std::string & text)
{
OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(255 - DISPOSE);
OBJECT_CONSTRUCTION;
labels.push_back(std::make_shared<CLabel>(x, y, font, align, color, text));
}
@ -358,7 +357,7 @@ CTextBox::CTextBox(std::string Text, const Rect & rect, int SliderStyle, EFonts
sliderStyle(SliderStyle),
slider(nullptr)
{
OBJECT_CONSTRUCTION_CAPTURING(255 - DISPOSE);
OBJECT_CONSTRUCTION;
label = std::make_shared<CMultiLineLabel>(rect, Font, Align, Color);
setRedrawParent(true);
@ -423,7 +422,7 @@ void CTextBox::setText(const std::string & text)
assert(label->pos.w > 0);
label->setText(text);
OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(255 - DISPOSE);
OBJECT_CONSTRUCTION;
slider = std::make_shared<CSlider>(Point(pos.w - 16, 0), pos.h, std::bind(&CTextBox::sliderMoved, this, _1),
label->pos.h, label->textSize.y, 0, Orientation::VERTICAL, CSlider::EStyle(sliderStyle));
slider->setScrollStep((int)graphics->fonts[label->font]->getLineHeight());
@ -506,7 +505,7 @@ CGStatusBar::CGStatusBar(int x, int y, const ImagePath & name, int maxw)
{
addUsedEvents(LCLICK);
OBJECT_CONSTRUCTION_CAPTURING(255 - DISPOSE);
OBJECT_CONSTRUCTION;
auto backgroundImage = std::make_shared<CPicture>(name);
background = backgroundImage;