mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
regression fixed. Artifact assemble dialog shows multiple times.
This commit is contained in:
parent
a35db9a696
commit
0032947735
@ -2591,7 +2591,11 @@ void CPlayerInterface::artifactMoved(const ArtifactLocation &src, const Artifact
|
|||||||
if (artWin)
|
if (artWin)
|
||||||
artWin->artifactMoved(src, dst);
|
artWin->artifactMoved(src, dst);
|
||||||
}
|
}
|
||||||
GH.listInt.back()->redraw();
|
GH.objsToBlit.back()->redraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayerInterface::artifactPossibleAssembling(const ArtifactLocation & dst)
|
||||||
|
{
|
||||||
askToAssembleArtifact(dst);
|
askToAssembleArtifact(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ public:
|
|||||||
void artifactRemoved(const ArtifactLocation &al) override;
|
void artifactRemoved(const ArtifactLocation &al) override;
|
||||||
void artifactMoved(const ArtifactLocation &src, const ArtifactLocation &dst) override;
|
void artifactMoved(const ArtifactLocation &src, const ArtifactLocation &dst) override;
|
||||||
void artifactAssembled(const ArtifactLocation &al) override;
|
void artifactAssembled(const ArtifactLocation &al) override;
|
||||||
|
void artifactPossibleAssembling(const ArtifactLocation & dst) override;
|
||||||
void artifactDisassembled(const ArtifactLocation &al) override;
|
void artifactDisassembled(const ArtifactLocation &al) override;
|
||||||
|
|
||||||
void heroVisit(const CGHeroInstance * visitor, const CGObjectInstance * visitedObj, bool start) override;
|
void heroVisit(const CGHeroInstance * visitor, const CGObjectInstance * visitedObj, bool start) override;
|
||||||
|
@ -275,8 +275,12 @@ void EraseArtifact::applyCl(CClient *cl)
|
|||||||
void MoveArtifact::applyCl(CClient *cl)
|
void MoveArtifact::applyCl(CClient *cl)
|
||||||
{
|
{
|
||||||
callInterfaceIfPresent(cl, src.owningPlayer(), &IGameEventsReceiver::artifactMoved, src, dst);
|
callInterfaceIfPresent(cl, src.owningPlayer(), &IGameEventsReceiver::artifactMoved, src, dst);
|
||||||
|
callInterfaceIfPresent(cl, src.owningPlayer(), &IGameEventsReceiver::artifactPossibleAssembling, dst);
|
||||||
if(src.owningPlayer() != dst.owningPlayer())
|
if(src.owningPlayer() != dst.owningPlayer())
|
||||||
|
{
|
||||||
callInterfaceIfPresent(cl, dst.owningPlayer(), &IGameEventsReceiver::artifactMoved, src, dst);
|
callInterfaceIfPresent(cl, dst.owningPlayer(), &IGameEventsReceiver::artifactMoved, src, dst);
|
||||||
|
callInterfaceIfPresent(cl, dst.owningPlayer(), &IGameEventsReceiver::artifactPossibleAssembling, dst);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BulkMoveArtifacts::applyCl(CClient * cl)
|
void BulkMoveArtifacts::applyCl(CClient * cl)
|
||||||
@ -286,7 +290,9 @@ void BulkMoveArtifacts::applyCl(CClient * cl)
|
|||||||
{
|
{
|
||||||
auto srcLoc = ArtifactLocation(movingArts.srcArtHolder, slotToMove.srcPos);
|
auto srcLoc = ArtifactLocation(movingArts.srcArtHolder, slotToMove.srcPos);
|
||||||
auto dstLoc = ArtifactLocation(movingArts.dstArtHolder, slotToMove.dstPos);
|
auto dstLoc = ArtifactLocation(movingArts.dstArtHolder, slotToMove.dstPos);
|
||||||
MoveArtifact(&srcLoc, &dstLoc).applyCl(cl);
|
callInterfaceIfPresent(cl, srcLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc);
|
||||||
|
if (srcLoc.owningPlayer() != dstLoc.owningPlayer())
|
||||||
|
callInterfaceIfPresent(cl, dstLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (artsPack1.has_value())
|
if (artsPack1.has_value())
|
||||||
@ -296,7 +302,9 @@ void BulkMoveArtifacts::applyCl(CClient * cl)
|
|||||||
{
|
{
|
||||||
auto srcLoc = ArtifactLocation(movingArts.srcArtHolder, slotToMove.srcPos);
|
auto srcLoc = ArtifactLocation(movingArts.srcArtHolder, slotToMove.srcPos);
|
||||||
auto dstLoc = ArtifactLocation(movingArts.dstArtHolder, slotToMove.dstPos);
|
auto dstLoc = ArtifactLocation(movingArts.dstArtHolder, slotToMove.dstPos);
|
||||||
MoveArtifact(&srcLoc, &dstLoc).applyCl(cl);
|
callInterfaceIfPresent(cl, srcLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc);
|
||||||
|
if (srcLoc.owningPlayer() != dstLoc.owningPlayer())
|
||||||
|
callInterfaceIfPresent(cl, dstLoc.owningPlayer(), &IGameEventsReceiver::artifactMoved, srcLoc, dstLoc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,7 @@ public:
|
|||||||
virtual void artifactAssembled(const ArtifactLocation &al){};
|
virtual void artifactAssembled(const ArtifactLocation &al){};
|
||||||
virtual void artifactDisassembled(const ArtifactLocation &al){};
|
virtual void artifactDisassembled(const ArtifactLocation &al){};
|
||||||
virtual void artifactMoved(const ArtifactLocation &src, const ArtifactLocation &dst){};
|
virtual void artifactMoved(const ArtifactLocation &src, const ArtifactLocation &dst){};
|
||||||
|
virtual void artifactPossibleAssembling(const ArtifactLocation & dst) {};
|
||||||
|
|
||||||
virtual void heroVisit(const CGHeroInstance *visitor, const CGObjectInstance *visitedObj, bool start){};
|
virtual void heroVisit(const CGHeroInstance *visitor, const CGObjectInstance *visitedObj, bool start){};
|
||||||
virtual void heroCreated(const CGHeroInstance*){};
|
virtual void heroCreated(const CGHeroInstance*){};
|
||||||
|
@ -180,7 +180,6 @@ public:
|
|||||||
void giveHeroArtifact(const CGHeroInstance *h, const CArtifactInstance *a, ArtifactPosition pos) override;
|
void giveHeroArtifact(const CGHeroInstance *h, const CArtifactInstance *a, ArtifactPosition pos) override;
|
||||||
void putArtifact(const ArtifactLocation &al, const CArtifactInstance *a) override;
|
void putArtifact(const ArtifactLocation &al, const CArtifactInstance *a) override;
|
||||||
void removeArtifact(const ArtifactLocation &al) override;
|
void removeArtifact(const ArtifactLocation &al) override;
|
||||||
bool moveArtifact(const ArtifactLocation &al1, const ArtifactLocation &al2) override;
|
|
||||||
bool moveArtifact(const ArtifactLocation & al1, const ArtifactLocation & al2) override;
|
bool moveArtifact(const ArtifactLocation & al1, const ArtifactLocation & al2) override;
|
||||||
bool bulkMoveArtifacts(ObjectInstanceID srcHero, ObjectInstanceID dstHero);
|
bool bulkMoveArtifacts(ObjectInstanceID srcHero, ObjectInstanceID dstHero);
|
||||||
bool bulkSwapArtifacts(ObjectInstanceID leftHero, ObjectInstanceID rightHero);
|
bool bulkSwapArtifacts(ObjectInstanceID leftHero, ObjectInstanceID rightHero);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user