mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-10 22:31:40 +02:00
add scrollbar for hero overview
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
#include "../render/IImage.h"
|
#include "../render/IImage.h"
|
||||||
#include "../renderSDL/RenderHandler.h"
|
#include "../renderSDL/RenderHandler.h"
|
||||||
#include "../widgets/CComponentHolder.h"
|
#include "../widgets/CComponentHolder.h"
|
||||||
|
#include "../widgets/Slider.h"
|
||||||
#include "../widgets/Images.h"
|
#include "../widgets/Images.h"
|
||||||
#include "../widgets/TextControls.h"
|
#include "../widgets/TextControls.h"
|
||||||
#include "../widgets/GraphicalPrimitiveCanvas.h"
|
#include "../widgets/GraphicalPrimitiveCanvas.h"
|
||||||
@@ -99,7 +100,9 @@ void CHeroOverview::genControls()
|
|||||||
// hero biography
|
// hero biography
|
||||||
r = Rect(borderOffset, 5 * borderOffset + yOffset + 148, 284, 130);
|
r = Rect(borderOffset, 5 * borderOffset + yOffset + 148, 284, 130);
|
||||||
backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
|
backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
|
||||||
labelHeroBiography = std::make_shared<CMultiLineLabel>(r.resize(-borderOffset), FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*CGI->heroh)[heroIdx]->getBiographyTranslated());
|
labelHeroBiography = std::make_shared<CTextBox>((*CGI->heroh)[heroIdx]->getBiographyTranslated(), r.resize(-borderOffset), CSlider::EStyle::BROWN, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
|
||||||
|
if(labelHeroBiography->slider)
|
||||||
|
labelHeroBiography->slider->clearScrollBounds();
|
||||||
|
|
||||||
// speciality name
|
// speciality name
|
||||||
r = Rect(2 * borderOffset + 44, 6 * borderOffset + yOffset + 278, 235, 44);
|
r = Rect(2 * borderOffset + 44, 6 * borderOffset + yOffset + 278, 235, 44);
|
||||||
@@ -115,7 +118,9 @@ void CHeroOverview::genControls()
|
|||||||
// speciality description
|
// speciality description
|
||||||
r = Rect(borderOffset, 7 * borderOffset + yOffset + 322, 284, 85);
|
r = Rect(borderOffset, 7 * borderOffset + yOffset + 322, 284, 85);
|
||||||
backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
|
backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
|
||||||
labelSpecialityDescription = std::make_shared<CMultiLineLabel>(r.resize(-borderOffset), FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*CGI->heroh)[heroIdx]->getSpecialtyDescriptionTranslated());
|
labelSpecialityDescription = std::make_shared<CTextBox>((*CGI->heroh)[heroIdx]->getSpecialtyDescriptionTranslated(), r.resize(-borderOffset), CSlider::EStyle::BROWN, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
|
||||||
|
if(labelSpecialityDescription->slider)
|
||||||
|
labelSpecialityDescription->slider->clearScrollBounds();
|
||||||
|
|
||||||
// army title
|
// army title
|
||||||
r = Rect(302, borderOffset + yOffset, 292, 30);
|
r = Rect(302, borderOffset + yOffset, 292, 30);
|
||||||
|
@@ -39,7 +39,7 @@ class CHeroOverview : public CWindowObject
|
|||||||
std::shared_ptr<CLabel> labelTitle;
|
std::shared_ptr<CLabel> labelTitle;
|
||||||
std::shared_ptr<CAnimImage> imageHero;
|
std::shared_ptr<CAnimImage> imageHero;
|
||||||
std::shared_ptr<CLabel> labelHeroName;
|
std::shared_ptr<CLabel> labelHeroName;
|
||||||
std::shared_ptr<CMultiLineLabel> labelHeroBiography;
|
std::shared_ptr<CTextBox> labelHeroBiography;
|
||||||
std::shared_ptr<CLabel> labelHeroClass;
|
std::shared_ptr<CLabel> labelHeroClass;
|
||||||
std::shared_ptr<CLabel> labelHeroSpeciality;
|
std::shared_ptr<CLabel> labelHeroSpeciality;
|
||||||
std::shared_ptr<CAnimImage> imageSpeciality;
|
std::shared_ptr<CAnimImage> imageSpeciality;
|
||||||
@@ -47,7 +47,7 @@ class CHeroOverview : public CWindowObject
|
|||||||
std::vector<std::shared_ptr<CAnimImage>> imageSkill;
|
std::vector<std::shared_ptr<CAnimImage>> imageSkill;
|
||||||
std::vector<std::shared_ptr<CLabel>> labelSkillFooter;
|
std::vector<std::shared_ptr<CLabel>> labelSkillFooter;
|
||||||
std::shared_ptr<CLabel> labelSpecialityName;
|
std::shared_ptr<CLabel> labelSpecialityName;
|
||||||
std::shared_ptr<CMultiLineLabel> labelSpecialityDescription;
|
std::shared_ptr<CTextBox> labelSpecialityDescription;
|
||||||
|
|
||||||
std::shared_ptr<CLabel> labelArmyTitle;
|
std::shared_ptr<CLabel> labelArmyTitle;
|
||||||
std::vector<std::shared_ptr<CAnimImage>> imageArmy;
|
std::vector<std::shared_ptr<CAnimImage>> imageArmy;
|
||||||
|
Reference in New Issue
Block a user