mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +02:00
Fixed a few CWE-457
This commit is contained in:
parent
c4ab962cc0
commit
27b853618c
@ -946,6 +946,7 @@ bool CArtifactsOfHero::SCommonPart::Artpos::valid()
|
|||||||
|
|
||||||
CArtPlace::CArtPlace(Point position, const CArtifactInstance * Art) : ourArt(Art)
|
CArtPlace::CArtPlace(Point position, const CArtifactInstance * Art) : ourArt(Art)
|
||||||
{
|
{
|
||||||
|
image = nullptr;
|
||||||
pos += position;
|
pos += position;
|
||||||
pos.w = pos.h = 44;
|
pos.w = pos.h = 44;
|
||||||
}
|
}
|
||||||
|
@ -475,6 +475,7 @@ CGarrisonInt::CGarrisonInt(int x, int y, int inx, const Point &garsOffset,
|
|||||||
inSplittingMode(false),
|
inSplittingMode(false),
|
||||||
interx(inx),
|
interx(inx),
|
||||||
garOffset(garsOffset),
|
garOffset(garsOffset),
|
||||||
|
pb(false),
|
||||||
smallIcons(smallImgs),
|
smallIcons(smallImgs),
|
||||||
removableUnits(_removableUnits),
|
removableUnits(_removableUnits),
|
||||||
twoRows(_twoRows)
|
twoRows(_twoRows)
|
||||||
|
@ -78,19 +78,14 @@ public:
|
|||||||
std::vector<CButton *> splitButtons; ///< May be empty if no buttons
|
std::vector<CButton *> splitButtons; ///< May be empty if no buttons
|
||||||
|
|
||||||
SlotID p2; ///< TODO: comment me
|
SlotID p2; ///< TODO: comment me
|
||||||
int shiftPos; ///< 1st slot of the second row, set shiftPoint for effect
|
|
||||||
bool pb,
|
bool pb,
|
||||||
smallIcons, ///< true - 32x32 imgs, false - 58x64
|
smallIcons, ///< true - 32x32 imgs, false - 58x64
|
||||||
removableUnits, ///< player Can remove units from up
|
removableUnits, ///< player Can remove units from up
|
||||||
twoRows, ///< slots Will be placed in 2 rows
|
twoRows, ///< slots Will be placed in 2 rows
|
||||||
owned[2]; ///< player Owns up or down army ([0] upper, [1] lower)
|
owned[2]; ///< player Owns up or down army ([0] upper, [1] lower)
|
||||||
|
|
||||||
// const CCreatureSet *set1; ///< Top set of creatures
|
|
||||||
// const CCreatureSet *set2; ///< Bottom set of creatures
|
|
||||||
|
|
||||||
std::vector<CGarrisonSlot*> slotsUp, slotsDown; ///< Slots of upper and lower garrison
|
std::vector<CGarrisonSlot*> slotsUp, slotsDown; ///< Slots of upper and lower garrison
|
||||||
const CArmedInstance *armedObjs[2]; ///< [0] is upper, [1] is down
|
const CArmedInstance *armedObjs[2]; ///< [0] is upper, [1] is down
|
||||||
//const CArmedInstance *oup, *odown; ///< Upper and lower garrisons (heroes or towns)
|
|
||||||
|
|
||||||
void setArmy(const CArmedInstance *army, bool bottomGarrison);
|
void setArmy(const CArmedInstance *army, bool bottomGarrison);
|
||||||
void addSplitBtn(CButton * button);
|
void addSplitBtn(CButton * button);
|
||||||
|
@ -94,7 +94,7 @@ void LRClickableAreaWTextComp::clickLeft(tribool down, bool previousState)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LRClickableAreaWTextComp::LRClickableAreaWTextComp(const Rect &Pos, int BaseType)
|
LRClickableAreaWTextComp::LRClickableAreaWTextComp(const Rect &Pos, int BaseType)
|
||||||
: LRClickableAreaWText(Pos), baseType(BaseType), bonusValue(-1)
|
: LRClickableAreaWText(Pos), baseType(BaseType), bonusValue(-1), type(-1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,8 +170,8 @@ void LRClickableAreaOpenTown::clickRight(tribool down, bool previousState)
|
|||||||
LOCPLINT->openTownWindow(town);//TODO: popup?
|
LOCPLINT->openTownWindow(town);//TODO: popup?
|
||||||
}
|
}
|
||||||
|
|
||||||
LRClickableAreaOpenTown::LRClickableAreaOpenTown()
|
LRClickableAreaOpenTown::LRClickableAreaOpenTown(const Rect & Pos, const CGTownInstance * Town)
|
||||||
: LRClickableAreaWTextComp(Rect(0,0,0,0), -1)
|
: LRClickableAreaWTextComp(Pos, -1), town(Town)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ public:
|
|||||||
const CGTownInstance * town;
|
const CGTownInstance * town;
|
||||||
void clickLeft(tribool down, bool previousState) override;
|
void clickLeft(tribool down, bool previousState) override;
|
||||||
void clickRight(tribool down, bool previousState) override;
|
void clickRight(tribool down, bool previousState) override;
|
||||||
LRClickableAreaOpenTown();
|
LRClickableAreaOpenTown(const Rect & Pos, const CGTownInstance * Town);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MoraleLuckBox : public LRClickableAreaWTextComp
|
class MoraleLuckBox : public LRClickableAreaWTextComp
|
||||||
|
@ -792,9 +792,7 @@ CTownItem::CTownItem(const CGTownInstance* Town):
|
|||||||
size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->builded >= CGI->modh->settings.MAX_BUILDING_PER_TURN];
|
size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->builded >= CGI->modh->settings.MAX_BUILDING_PER_TURN];
|
||||||
|
|
||||||
picture = new CAnimImage("ITPT", iconIndex, 0, 5, 6);
|
picture = new CAnimImage("ITPT", iconIndex, 0, 5, 6);
|
||||||
townArea = new LRClickableAreaOpenTown;
|
new LRClickableAreaOpenTown(Rect(5, 6, 58, 64), town);
|
||||||
townArea->pos = Rect(pos.x+5, pos.y+6, 58, 64);
|
|
||||||
townArea->town = town;
|
|
||||||
|
|
||||||
for (size_t i=0; i<town->creatures.size(); i++)
|
for (size_t i=0; i<town->creatures.size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -265,7 +265,6 @@ class CTownItem : public CIntObject, public CGarrisonHolder
|
|||||||
CLabel *name;
|
CLabel *name;
|
||||||
CLabel *income;
|
CLabel *income;
|
||||||
CGarrisonInt *garr;
|
CGarrisonInt *garr;
|
||||||
LRClickableAreaOpenTown *townArea;
|
|
||||||
|
|
||||||
HeroSlots *heroes;
|
HeroSlots *heroes;
|
||||||
CTownInfo *hall, *fort;
|
CTownInfo *hall, *fort;
|
||||||
|
Loading…
Reference in New Issue
Block a user