1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

backpack disassemble

This commit is contained in:
SoundSSGood
2022-11-18 00:24:06 +02:00
parent 2d078132bf
commit 16b650136a
2 changed files with 21 additions and 3 deletions

View File

@@ -828,8 +828,15 @@ void CArtifactsOfHero::artifactAssembled(const ArtifactLocation &al)
void CArtifactsOfHero::artifactDisassembled(const ArtifactLocation & al)
{
if(al.isHolder(curHero))
{
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;

View File

@@ -154,6 +154,7 @@ public:
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 updateBackpackSlots(bool redrawParent = true);
void updateSlot(ArtifactPosition i);