1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

remember slider location

This commit is contained in:
Laserlicht
2024-06-29 18:18:05 +02:00
parent 3f0be7e904
commit 27dd00f8ce
2 changed files with 5 additions and 5 deletions

View File

@ -402,8 +402,8 @@ void OptionsTab::CPlayerOptionTooltipBox::genBonusWindow()
textBonusDescription = std::make_shared<CTextBox>(getDescription(), Rect(10, 100, pos.w - 20, 70), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE); textBonusDescription = std::make_shared<CTextBox>(getDescription(), Rect(10, 100, pos.w - 20, 70), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE);
} }
OptionsTab::SelectionWindow::SelectionWindow(const PlayerColor & color, SelType _type) OptionsTab::SelectionWindow::SelectionWindow(const PlayerColor & color, SelType _type, int sliderLine)
: CWindowObject(BORDERED), color(color) : CWindowObject(BORDERED), color(color), sliderLine(sliderLine)
{ {
addUsedEvents(LCLICK | SHOW_POPUP); addUsedEvents(LCLICK | SHOW_POPUP);
@ -482,7 +482,7 @@ void OptionsTab::SelectionWindow::setSelection()
void OptionsTab::SelectionWindow::reopen() void OptionsTab::SelectionWindow::reopen()
{ {
auto window = std::shared_ptr<SelectionWindow>(new SelectionWindow(color, type)); auto window = std::shared_ptr<SelectionWindow>(new SelectionWindow(color, type, sliderLine));
close(); close();
if(CSH->isMyColor(color) || CSH->isHost()) if(CSH->isMyColor(color) || CSH->isHost())
GH.windows().pushWindow(window); GH.windows().pushWindow(window);
@ -492,7 +492,7 @@ void OptionsTab::SelectionWindow::recreate()
{ {
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE; OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
sliderLine = slider ? slider->getValue() : 0; sliderLine = slider ? slider->getValue() : sliderLine;
int amountLines = 1; int amountLines = 1;
if(type == SelType::BONUS) if(type == SelType::BONUS)

View File

@ -157,7 +157,7 @@ private:
public: public:
void reopen(); void reopen();
SelectionWindow(const PlayerColor & color, SelType _type); SelectionWindow(const PlayerColor & color, SelType _type, int sliderLine = 0);
}; };
/// Image with current town/hero/bonus /// Image with current town/hero/bonus