1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Renamed & unified OBJECT_CONSTRUCTION macro set

This commit is contained in:
Ivan Savenko
2024-08-09 15:30:04 +00:00
parent 337431901f
commit 9fba3d97f1
80 changed files with 287 additions and 308 deletions

View File

@@ -270,7 +270,7 @@ bool CBuildingRect::receiveEvent(const Point & position, int eventType) const
CDwellingInfoBox::CDwellingInfoBox(int centerX, int centerY, const CGTownInstance * Town, int level)
: CWindowObject(RCLICK_POPUP, ImagePath::builtin("CRTOINFO"), Point(centerX, centerY))
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
background->setPlayerColor(Town->tempOwner);
const CCreature * creature = Town->creatures.at(level).second.back().toCreature();
@@ -306,7 +306,7 @@ CDwellingInfoBox::~CDwellingInfoBox() = default;
CHeroGSlot::CHeroGSlot(int x, int y, int updown, const CGHeroInstance * h, HeroSlots * Owner)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
owner = Owner;
pos.x += x;
@@ -482,7 +482,7 @@ void CHeroGSlot::setHighlight(bool on)
void CHeroGSlot::set(const CGHeroInstance * newHero)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
hero = newHero;
@@ -507,7 +507,7 @@ HeroSlots::HeroSlots(const CGTownInstance * Town, Point garrPos, Point visitPos,
town(Town),
garr(Garrison)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
garrisonedHero = std::make_shared<CHeroGSlot>(garrPos.x, garrPos.y, 0, town->garrisonHero, this);
visitingHero = std::make_shared<CHeroGSlot>(visitPos.x, visitPos.y, 1, town->visitingHero, this);
}
@@ -563,7 +563,7 @@ CCastleBuildings::CCastleBuildings(const CGTownInstance* Town):
town(Town),
selectedBuilding(nullptr)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
background = std::make_shared<CPicture>(town->town->clientInfo.townBackground);
background->needRefresh = true;
@@ -579,7 +579,7 @@ CCastleBuildings::~CCastleBuildings() = default;
void CCastleBuildings::recreate()
{
selectedBuilding = nullptr;
OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
buildings.clear();
groups.clear();
@@ -1079,7 +1079,7 @@ CCreaInfo::CCreaInfo(Point position, const CGTownInstance * Town, int Level, boo
level(Level),
showAvailable(_showAvailable)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
pos += position;
if(town->creatures.size() <= level || town->creatures[level].second.empty())
@@ -1189,7 +1189,7 @@ CTownInfo::CTownInfo(int posX, int posY, const CGTownInstance * Town, bool townH
: town(Town),
building(nullptr)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
addUsedEvents(SHOW_POPUP | HOVER);
pos.x += posX;
pos.y += posY;
@@ -1237,7 +1237,7 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
CWindowObject(PLAYER_COLORED | BORDERED),
town(Town)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
LOCPLINT->castleInt = this;
addUsedEvents(KEYBOARD);
@@ -1362,7 +1362,7 @@ void CCastleInterface::removeBuilding(BuildingID bid)
void CCastleInterface::recreateIcons()
{
OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->built >= CGI->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)];
icon->setFrame(iconIndex);
@@ -1469,7 +1469,7 @@ CHallInterface::CBuildingBox::CBuildingBox(int x, int y, const CGTownInstance *
town(Town),
building(Building)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
pos.x += x;
pos.y += y;
@@ -1532,7 +1532,7 @@ CHallInterface::CHallInterface(const CGTownInstance * Town):
CWindowObject(PLAYER_COLORED | BORDERED, Town->town->clientInfo.hallBackground),
town(Town)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
resdatabar = std::make_shared<CMinorResDataBar>();
resdatabar->moveBy(pos.topLeft(), true);
@@ -1587,7 +1587,7 @@ CBuildWindow::CBuildWindow(const CGTownInstance *Town, const CBuilding * Buildin
town(Town),
building(Building)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
icon = std::make_shared<CAnimImage>(town->town->clientInfo.buildingsIcons, building->bid, 0, 125, 50);
auto statusbarBackground = std::make_shared<CPicture>(background->getSurface(), Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26);
@@ -1690,7 +1690,7 @@ std::string CBuildWindow::getTextForState(EBuildingState state)
LabeledValue::LabeledValue(Rect size, std::string name, std::string descr, int min, int max)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
pos.x+=size.x;
pos.y+=size.y;
pos.w = size.w;
@@ -1700,7 +1700,7 @@ LabeledValue::LabeledValue(Rect size, std::string name, std::string descr, int m
LabeledValue::LabeledValue(Rect size, std::string name, std::string descr, int val)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
pos.x+=size.x;
pos.y+=size.y;
pos.w = size.w;
@@ -1738,7 +1738,7 @@ void LabeledValue::hover(bool on)
CFortScreen::CFortScreen(const CGTownInstance * town):
CWindowObject(PLAYER_COLORED | BORDERED, getBgName(town))
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
ui32 fortSize = static_cast<ui32>(town->creatures.size());
if(fortSize > GameConstants::CREATURES_PER_TOWN && town->creatures.back().second.empty())
fortSize--;
@@ -1820,7 +1820,7 @@ CFortScreen::RecruitArea::RecruitArea(int posX, int posY, const CGTownInstance *
level(Level),
availableCount(nullptr)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
pos.x +=posX;
pos.y +=posY;
pos.w = 386;
@@ -1927,7 +1927,7 @@ void CFortScreen::RecruitArea::showPopupWindow(const Point & cursorPosition)
CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner, const ImagePath & imagename)
: CWindowObject(BORDERED, imagename)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
window = std::make_shared<CPicture>(owner->town->town->clientInfo.guildWindow, 332, 76);
@@ -1966,7 +1966,7 @@ CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner, const ImagePath & i
CMageGuildScreen::Scroll::Scroll(Point position, const CSpell *Spell)
: spell(Spell)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
pos += position;
@@ -1996,7 +1996,7 @@ void CMageGuildScreen::Scroll::hover(bool on)
CBlacksmithDialog::CBlacksmithDialog(bool possible, CreatureID creMachineID, ArtifactID aid, ObjectInstanceID hid):
CWindowObject(PLAYER_COLORED, ImagePath::builtin("TPSMITH"))
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
OBJECT_CONSTRUCTION;
Rect barRect(8, pos.h - 26, pos.w - 16, 19);