mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-09 13:14:02 +02:00
correct starting bonus in selection windows
This commit is contained in:
parent
9cf5c6a6c1
commit
8f2f5344a9
@ -400,12 +400,12 @@ 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(PlayerColor _color, SelType _type)
|
OptionsTab::SelectionWindow::SelectionWindow(CPlayerSettingsHelper & helper, SelType _type)
|
||||||
: CWindowObject(BORDERED)
|
: CWindowObject(BORDERED), CPlayerSettingsHelper(helper)
|
||||||
{
|
{
|
||||||
addUsedEvents(LCLICK | SHOW_POPUP);
|
addUsedEvents(LCLICK | SHOW_POPUP);
|
||||||
|
|
||||||
color = _color;
|
color = helper.playerSettings.color;
|
||||||
type = _type;
|
type = _type;
|
||||||
|
|
||||||
initialFaction = SEL->getStartInfo()->playerInfos.find(color)->second.castle;
|
initialFaction = SEL->getStartInfo()->playerInfos.find(color)->second.castle;
|
||||||
@ -481,7 +481,7 @@ void OptionsTab::SelectionWindow::setSelection()
|
|||||||
|
|
||||||
void OptionsTab::SelectionWindow::reopen()
|
void OptionsTab::SelectionWindow::reopen()
|
||||||
{
|
{
|
||||||
std::shared_ptr<SelectionWindow> window = std::shared_ptr<SelectionWindow>(new SelectionWindow(color, type));
|
std::shared_ptr<SelectionWindow> window = std::shared_ptr<SelectionWindow>(new SelectionWindow(*this, type));
|
||||||
close();
|
close();
|
||||||
GH.windows().pushWindow(window);
|
GH.windows().pushWindow(window);
|
||||||
}
|
}
|
||||||
@ -632,7 +632,7 @@ void OptionsTab::SelectionWindow::genContentHeroes()
|
|||||||
|
|
||||||
void OptionsTab::SelectionWindow::genContentBonus()
|
void OptionsTab::SelectionWindow::genContentBonus()
|
||||||
{
|
{
|
||||||
PlayerSettings set = PlayerSettings();
|
PlayerSettings set = PlayerSettings(playerSettings);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(auto elem : allowedBonus)
|
for(auto elem : allowedBonus)
|
||||||
@ -819,7 +819,7 @@ void OptionsTab::SelectedBox::clickReleased(const Point & cursorPosition)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
GH.input().hapticFeedback();
|
GH.input().hapticFeedback();
|
||||||
GH.windows().createAndPushWindow<SelectionWindow>(playerSettings.color, selectionType);
|
GH.windows().createAndPushWindow<SelectionWindow>(*this, selectionType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsTab::SelectedBox::scrollBy(int distance)
|
void OptionsTab::SelectedBox::scrollBy(int distance)
|
||||||
|
@ -96,7 +96,7 @@ private:
|
|||||||
CPlayerOptionTooltipBox(CPlayerSettingsHelper & helper);
|
CPlayerOptionTooltipBox(CPlayerSettingsHelper & helper);
|
||||||
};
|
};
|
||||||
|
|
||||||
class SelectionWindow : public CWindowObject
|
class SelectionWindow : public CWindowObject, public CPlayerSettingsHelper
|
||||||
{
|
{
|
||||||
//const int ICON_SMALL_WIDTH = 48;
|
//const int ICON_SMALL_WIDTH = 48;
|
||||||
const int ICON_SMALL_HEIGHT = 32;
|
const int ICON_SMALL_HEIGHT = 32;
|
||||||
@ -148,7 +148,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
void reopen();
|
void reopen();
|
||||||
|
|
||||||
SelectionWindow(PlayerColor _color, SelType _type);
|
SelectionWindow(CPlayerSettingsHelper & helper, SelType _type);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Image with current town/hero/bonus
|
/// Image with current town/hero/bonus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user