mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
backpack disassemble
This commit is contained in:
@@ -825,10 +825,17 @@ void CArtifactsOfHero::artifactAssembled(const ArtifactLocation &al)
|
||||
updateWornSlots();
|
||||
}
|
||||
|
||||
void CArtifactsOfHero::artifactDisassembled(const ArtifactLocation &al)
|
||||
void CArtifactsOfHero::artifactDisassembled(const ArtifactLocation & al)
|
||||
{
|
||||
if(al.isHolder(curHero))
|
||||
updateWornSlots();
|
||||
{
|
||||
if(al.slot >= GameConstants::BACKPACK_START)
|
||||
{
|
||||
updateBackpackSlots();
|
||||
}
|
||||
else
|
||||
updateWornSlots();
|
||||
}
|
||||
}
|
||||
|
||||
void CArtifactsOfHero::updateWornSlots(bool redrawParent)
|
||||
@@ -840,6 +847,16 @@ void CArtifactsOfHero::updateWornSlots(bool redrawParent)
|
||||
updateParentWindow();
|
||||
}
|
||||
|
||||
void CArtifactsOfHero::updateBackpackSlots(bool redrawParent)
|
||||
{
|
||||
for(auto & artPlace : backpack)
|
||||
updateSlot(artPlace->slotID);
|
||||
scrollBackpack(0);
|
||||
|
||||
if(redrawParent)
|
||||
updateParentWindow();
|
||||
}
|
||||
|
||||
const CGHeroInstance * CArtifactsOfHero::getHero() const
|
||||
{
|
||||
return curHero;
|
||||
|
@@ -153,7 +153,8 @@ public:
|
||||
void markPossibleSlots(const CArtifactInstance* art);
|
||||
void unmarkSlots(bool withRedraw = true); //unmarks slots in all visible AOHs
|
||||
void unmarkLocalSlots(bool withRedraw = true); //unmarks slots in that particular AOH
|
||||
void updateWornSlots (bool redrawParent = true);
|
||||
void updateWornSlots(bool redrawParent = true);
|
||||
void updateBackpackSlots(bool redrawParent = true);
|
||||
|
||||
void updateSlot(ArtifactPosition i);
|
||||
|
||||
|
Reference in New Issue
Block a user