diff --git a/client/adventureMap/CInfoBar.h b/client/adventureMap/CInfoBar.h index 00ee54c78..c69fed1f0 100644 --- a/client/adventureMap/CInfoBar.h +++ b/client/adventureMap/CInfoBar.h @@ -69,14 +69,14 @@ private: class VisibleHeroInfo : public CVisibleInfo { - std::variant, std::shared_ptr> heroTooltip; + std::shared_ptr heroTooltip; //should have CHeroTooltip or CInteractableHeroTooltip; public: VisibleHeroInfo(const CGHeroInstance * hero); }; class VisibleTownInfo : public CVisibleInfo { - std::variant, std::shared_ptr> townTooltip; + std::shared_ptr townTooltip; //should have CTownTooltip or CInteractableTownTooltip; public: VisibleTownInfo(const CGTownInstance * town); }; diff --git a/client/widgets/CGarrisonInt.cpp b/client/widgets/CGarrisonInt.cpp index 9083db69e..95c068a54 100644 --- a/client/widgets/CGarrisonInt.cpp +++ b/client/widgets/CGarrisonInt.cpp @@ -413,12 +413,12 @@ CGarrisonSlot::CGarrisonSlot(CGarrisonInt * Owner, int x, int y, SlotID IID, CGa int labelPosW = pos.w; int labelPosH = pos.h; - if(Owner->layout == CGarrisonInt::EGarrisonIntSlotsLayout::REVERSED_TWO_ROWS) //labels under icon + if(Owner->layout == CGarrisonInt::ESlotsLayout::REVERSED_TWO_ROWS) //labels under icon { labelPosW = pos.w / 2 + 1; labelPosH += 7; } - ETextAlignment labelAlignment = Owner->layout == CGarrisonInt::EGarrisonIntSlotsLayout::REVERSED_TWO_ROWS + ETextAlignment labelAlignment = Owner->layout == CGarrisonInt::ESlotsLayout::REVERSED_TWO_ROWS ? ETextAlignment::CENTER : ETextAlignment::BOTTOMRIGHT; @@ -516,11 +516,11 @@ void CGarrisonInt::createSlots() if(!garrisonSlots[j]) garrisonSlots[j] = std::make_shared(this, i*garOffset.x + (j*distance), i*garOffset.y, SlotID(j), static_cast(i), nullptr); - if(layout == EGarrisonIntSlotsLayout::TWO_ROWS && j >= 4) + if(layout == ESlotsLayout::TWO_ROWS && j >= 4) { garrisonSlots[j]->moveBy(Point(-126, 37)); } - else if(layout == EGarrisonIntSlotsLayout::REVERSED_TWO_ROWS) + else if(layout == ESlotsLayout::REVERSED_TWO_ROWS) { if(j >= 3) { @@ -671,7 +671,7 @@ void CGarrisonInt::bulkSmartSplitStack(const CGarrisonSlot * selected) CGarrisonInt::CGarrisonInt(int x, int y, int inx, const Point & garsOffset, const CArmedInstance * s1, const CArmedInstance * s2, - bool _removableUnits, bool smallImgs, EGarrisonIntSlotsLayout _layout) + bool _removableUnits, bool smallImgs, ESlotsLayout _layout) : highlighted(nullptr), inSplittingMode(false), interx(inx), diff --git a/client/widgets/CGarrisonInt.h b/client/widgets/CGarrisonInt.h index f2aaa521c..baa1360ca 100644 --- a/client/widgets/CGarrisonInt.h +++ b/client/widgets/CGarrisonInt.h @@ -81,7 +81,7 @@ class CGarrisonInt :public CIntObject bool checkSelected(const CGarrisonSlot * selected, TQuantity min = 0) const; public: - enum class EGarrisonIntSlotsLayout + enum class ESlotsLayout { ONE_ROW, TWO_ROWS, @@ -98,7 +98,7 @@ public: removableUnits, ///< player Can remove units from up owned[2]; ///< player Owns up or down army ([0] upper, [1] lower) - EGarrisonIntSlotsLayout layout; + ESlotsLayout layout; void selectSlot(CGarrisonSlot * slot); ///< @param slot null = deselect const CGarrisonSlot * getSelection() const; @@ -133,11 +133,11 @@ public: /// @param smallImgs Units images size 64x58 or 32x32 /// @param _layout - when TWO_ROWS - Display slots in 2 rows (1st row = 4 slots, 2nd = 3 slots), REVERSED_TWO_ROWS = 3 slots in 1st row CGarrisonInt(int x, int y, int inx, - const Point & garsOffset, - const CArmedInstance * s1, const CArmedInstance * s2 = nullptr, - bool _removableUnits = true, - bool smallImgs = false, - EGarrisonIntSlotsLayout _layout = EGarrisonIntSlotsLayout::ONE_ROW); + const Point & garsOffset, + const CArmedInstance * s1, const CArmedInstance * s2 = nullptr, + bool _removableUnits = true, + bool smallImgs = false, + ESlotsLayout _layout = ESlotsLayout::ONE_ROW); }; class CGarrisonHolder diff --git a/client/widgets/MiscWidgets.cpp b/client/widgets/MiscWidgets.cpp index 3677ea6a9..9ef040193 100644 --- a/client/widgets/MiscWidgets.cpp +++ b/client/widgets/MiscWidgets.cpp @@ -304,7 +304,7 @@ CHeroTooltip::CHeroTooltip(Point pos, const CGHeroInstance * hero): } CInteractableHeroTooltip::CInteractableHeroTooltip(Point pos, const CGHeroInstance * hero): - CGarrisonInt(pos.x, pos.y+73, 4, Point(0, 0), hero, nullptr, true, true, CGarrisonInt::EGarrisonIntSlotsLayout::REVERSED_TWO_ROWS) + CGarrisonInt(pos.x, pos.y+73, 4, Point(0, 0), hero, nullptr, true, true, CGarrisonInt::ESlotsLayout::REVERSED_TWO_ROWS) { init(InfoAboutHero(hero, InfoAboutHero::EInfoLevel::DETAILED)); } @@ -383,7 +383,7 @@ CTownTooltip::CTownTooltip(Point pos, const CGTownInstance * town) } CInteractableTownTooltip::CInteractableTownTooltip(Point pos, const CGTownInstance * town) - : CGarrisonInt(pos.x, pos.y+73, 4, Point(0, 0), town->getUpperArmy(), nullptr, true, true, CGarrisonInt::EGarrisonIntSlotsLayout::REVERSED_TWO_ROWS) + : CGarrisonInt(pos.x, pos.y+73, 4, Point(0, 0), town->getUpperArmy(), nullptr, true, true, CGarrisonInt::ESlotsLayout::REVERSED_TWO_ROWS) { init(InfoAboutTown(town, true)); } diff --git a/client/windows/CKingdomInterface.cpp b/client/windows/CKingdomInterface.cpp index 00a68986a..9e1a07dde 100644 --- a/client/windows/CKingdomInterface.cpp +++ b/client/windows/CKingdomInterface.cpp @@ -772,7 +772,7 @@ CTownItem::CTownItem(const CGTownInstance * Town) hall = std::make_shared( 69, 31, town, true); fort = std::make_shared(111, 31, town, false); - garr = std::make_shared(313, 3, 4, Point(232,0), town->getUpperArmy(), town->visitingHero, true, true, CGarrisonInt::EGarrisonIntSlotsLayout::TWO_ROWS); + garr = std::make_shared(313, 3, 4, Point(232,0), town->getUpperArmy(), town->visitingHero, true, true, CGarrisonInt::ESlotsLayout::TWO_ROWS); heroes = std::make_shared(town, Point(244,6), Point(475,6), garr, false); size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->builded >= CGI->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)];