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

fix compile error

This commit is contained in:
Michael
2023-08-17 20:34:31 +02:00
committed by GitHub
parent ac64b9f2b5
commit af347242b4
2 changed files with 7 additions and 7 deletions

View File

@ -660,7 +660,7 @@ int OptionsTab::SelectionWindow::getElement(const Point & cursorPosition)
return x + y * elementsPerLine; return x + y * elementsPerLine;
} }
void OptionsTab::SelectionWindow::setElement(int elem, bool apply) void OptionsTab::SelectionWindow::setElement(int elem, bool doApply)
{ {
PlayerSettings set = PlayerSettings(); PlayerSettings set = PlayerSettings();
if(type == SelType::TOWN) if(type == SelType::TOWN)
@ -678,7 +678,7 @@ void OptionsTab::SelectionWindow::setElement(int elem, bool apply)
} }
if(set.castle != PlayerSettings::NONE) if(set.castle != PlayerSettings::NONE)
{ {
if(!apply) if(!doApply)
{ {
CPlayerSettingsHelper helper = CPlayerSettingsHelper(set, SelType::TOWN); CPlayerSettingsHelper helper = CPlayerSettingsHelper(set, SelType::TOWN);
GH.windows().createAndPushWindow<CPlayerOptionTooltipBox>(helper); GH.windows().createAndPushWindow<CPlayerOptionTooltipBox>(helper);
@ -700,7 +700,7 @@ void OptionsTab::SelectionWindow::setElement(int elem, bool apply)
} }
if(set.hero != PlayerSettings::NONE) if(set.hero != PlayerSettings::NONE)
{ {
if(!apply) if(!doApply)
{ {
CPlayerSettingsHelper helper = CPlayerSettingsHelper(set, SelType::HERO); CPlayerSettingsHelper helper = CPlayerSettingsHelper(set, SelType::HERO);
GH.windows().createAndPushWindow<CPlayerOptionTooltipBox>(helper); GH.windows().createAndPushWindow<CPlayerOptionTooltipBox>(helper);
@ -714,7 +714,7 @@ void OptionsTab::SelectionWindow::setElement(int elem, bool apply)
set.bonus = static_cast<PlayerSettings::Ebonus>(elem-1); set.bonus = static_cast<PlayerSettings::Ebonus>(elem-1);
if(set.bonus != PlayerSettings::NONE) if(set.bonus != PlayerSettings::NONE)
{ {
if(!apply) if(!doApply)
{ {
CPlayerSettingsHelper helper = CPlayerSettingsHelper(set, SelType::BONUS); CPlayerSettingsHelper helper = CPlayerSettingsHelper(set, SelType::BONUS);
GH.windows().createAndPushWindow<CPlayerOptionTooltipBox>(helper); GH.windows().createAndPushWindow<CPlayerOptionTooltipBox>(helper);
@ -722,7 +722,7 @@ void OptionsTab::SelectionWindow::setElement(int elem, bool apply)
} }
} }
if(apply) if(doApply)
apply(); apply();
} }

View File

@ -98,7 +98,7 @@ public:
class SelectionWindow : public CWindowObject class SelectionWindow : public CWindowObject
{ {
const int ICON_SMALL_WIDTH = 48; //const int ICON_SMALL_WIDTH = 48;
const int ICON_SMALL_HEIGHT = 32; const int ICON_SMALL_HEIGHT = 32;
const int ICON_BIG_WIDTH = 58; const int ICON_BIG_WIDTH = 58;
const int ICON_BIG_HEIGHT = 64; const int ICON_BIG_HEIGHT = 64;
@ -138,7 +138,7 @@ public:
void recreate(); void recreate();
void setSelection(); void setSelection();
int getElement(const Point & cursorPosition); int getElement(const Point & cursorPosition);
void setElement(int element, bool apply); void setElement(int element, bool doApply);
void clickReleased(const Point & cursorPosition) override; void clickReleased(const Point & cursorPosition) override;
void showPopupWindow(const Point & cursorPosition) override; void showPopupWindow(const Point & cursorPosition) override;