|
@@ -131,7 +131,9 @@ struct HeroObjectRetriever
|
|
|
|
|
|
CPlayerInterface::CPlayerInterface(PlayerColor Player):
|
|
|
localState(std::make_unique<PlayerLocalState>(*this)),
|
|
|
- movementController(std::make_unique<HeroMovementController>())
|
|
|
+ movementController(std::make_unique<HeroMovementController>()),
|
|
|
+ artifactController(std::make_unique<ArtifactsUIController>())
|
|
|
+
|
|
|
{
|
|
|
logGlobal->trace("\tHuman player interface for player %s being constructed", Player.toString());
|
|
|
GH.defActionsDef = 0;
|
|
@@ -147,7 +149,6 @@ CPlayerInterface::CPlayerInterface(PlayerColor Player):
|
|
|
isAutoFightOn = false;
|
|
|
isAutoFightEndBattle = false;
|
|
|
ignoreEvents = false;
|
|
|
- numOfMovedArts = 0;
|
|
|
}
|
|
|
|
|
|
CPlayerInterface::~CPlayerInterface()
|
|
@@ -1707,7 +1708,7 @@ void CPlayerInterface::showShipyardDialogOrProblemPopup(const IShipyard *obj)
|
|
|
|
|
|
void CPlayerInterface::askToAssembleArtifact(const ArtifactLocation &al)
|
|
|
{
|
|
|
- ArtifactsUIController::askToAssemble(al, true, &ignoredArtifacts);
|
|
|
+ artifactController->askToAssemble(al, true, true);
|
|
|
}
|
|
|
|
|
|
void CPlayerInterface::artifactPut(const ArtifactLocation &al)
|
|
@@ -1720,33 +1721,33 @@ void CPlayerInterface::artifactRemoved(const ArtifactLocation &al)
|
|
|
{
|
|
|
EVENT_HANDLER_CALLED_BY_CLIENT;
|
|
|
adventureInt->onHeroChanged(cb->getHero(al.artHolder));
|
|
|
- ArtifactsUIController::artifactRemoved();
|
|
|
+ artifactController->artifactRemoved();
|
|
|
}
|
|
|
|
|
|
void CPlayerInterface::artifactMoved(const ArtifactLocation &src, const ArtifactLocation &dst)
|
|
|
{
|
|
|
EVENT_HANDLER_CALLED_BY_CLIENT;
|
|
|
adventureInt->onHeroChanged(cb->getHero(dst.artHolder));
|
|
|
- ArtifactsUIController::artifactMoved();
|
|
|
+ artifactController->artifactMoved();
|
|
|
}
|
|
|
|
|
|
void CPlayerInterface::bulkArtMovementStart(size_t totalNumOfArts, size_t possibleAssemblyNumOfArts)
|
|
|
{
|
|
|
- ArtifactsUIController::bulkArtMovementStart(totalNumOfArts, possibleAssemblyNumOfArts);
|
|
|
+ artifactController->bulkArtMovementStart(totalNumOfArts, possibleAssemblyNumOfArts);
|
|
|
}
|
|
|
|
|
|
void CPlayerInterface::artifactAssembled(const ArtifactLocation &al)
|
|
|
{
|
|
|
EVENT_HANDLER_CALLED_BY_CLIENT;
|
|
|
adventureInt->onHeroChanged(cb->getHero(al.artHolder));
|
|
|
- ArtifactsUIController::artifactAssembled();
|
|
|
+ artifactController->artifactAssembled();
|
|
|
}
|
|
|
|
|
|
void CPlayerInterface::artifactDisassembled(const ArtifactLocation &al)
|
|
|
{
|
|
|
EVENT_HANDLER_CALLED_BY_CLIENT;
|
|
|
adventureInt->onHeroChanged(cb->getHero(al.artHolder));
|
|
|
- ArtifactsUIController::artifactDisassembled();
|
|
|
+ artifactController->artifactDisassembled();
|
|
|
}
|
|
|
|
|
|
void CPlayerInterface::waitForAllDialogs()
|