1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-08 22:26:51 +02:00

Merge pull request #5413 from IvanSavenko/bugfixing

[1.6.6] Minor fixes
This commit is contained in:
Ivan Savenko
2025-02-14 12:49:14 +02:00
committed by GitHub
6 changed files with 14 additions and 6 deletions

View File

@@ -890,7 +890,7 @@ BattleResultResources BattleResultWindow::getResources(const BattleResult & br)
if (ourHero)
{
resources.resultText.appendTextID("core.genrltxt.305");
resources.resultText.replaceTextID(ourHero->getNameTranslated());
resources.resultText.replaceTextID(ourHero->getNameTextID());
resources.resultText.replaceNumber(br.exp[weAreAttacker ? BattleSide::ATTACKER : BattleSide::DEFENDER]);
}
}

View File

@@ -200,9 +200,16 @@ CreatureAnimation::CreatureAnimation(const AnimationPath & name_, TSpeedControll
speedController(controller),
once(false)
{
forward = GH.renderHandler().loadAnimation(name_, EImageBlitMode::WITH_SHADOW_AND_SELECTION);
reverse = GH.renderHandler().loadAnimation(name_, EImageBlitMode::WITH_SHADOW_AND_SELECTION);
if (forward->size(size_t(ECreatureAnimType::DEATH)) == 0)
throw std::runtime_error("Animation '" + name_.getOriginalName() + "' has empty death animation!");
if (forward->size(size_t(ECreatureAnimType::HOLDING)) == 0)
throw std::runtime_error("Animation '" + name_.getOriginalName() + "' has empty holding animation!");
// if necessary, add one frame into vcmi-only group DEAD
if(forward->size(size_t(ECreatureAnimType::DEAD)) == 0)
{

View File

@@ -211,7 +211,7 @@ AssetGenerator::CanvasPtr AssetGenerator::createCampaignBackground()
auto locator = ImageLocator(ImagePath::builtin("CAMPBACK"), EImageBlitMode::OPAQUE);
std::shared_ptr<IImage> img = GH.renderHandler().loadImage(locator);
auto image = GH.renderHandler().createImage(Point(200, 116), CanvasScalingPolicy::IGNORE);
auto image = GH.renderHandler().createImage(Point(800, 600), CanvasScalingPolicy::IGNORE);
Canvas canvas = image->getCanvas();
canvas.draw(img, Point(0, 0), Rect(0, 0, 800, 600));
@@ -251,7 +251,7 @@ AssetGenerator::CanvasPtr AssetGenerator::createChroniclesCampaignImages(int chr
auto locator = ImageLocator(imgPathBg, EImageBlitMode::OPAQUE);
std::shared_ptr<IImage> img = GH.renderHandler().loadImage(locator);
auto image = GH.renderHandler().createImage(Point(800, 600), CanvasScalingPolicy::IGNORE);
auto image = GH.renderHandler().createImage(Point(200, 116), CanvasScalingPolicy::IGNORE);
Canvas canvas = image->getCanvas();
std::array sourceRect = {

View File

@@ -82,6 +82,7 @@
"DARKNESS":
{
"hidden": true
},
"DEATH_STARE":

View File

@@ -216,7 +216,7 @@ InternalConnection::InternalConnection(INetworkConnectionListener & listener, co
void InternalConnection::receivePacket(const std::vector<std::byte> & message)
{
io->post([self = std::static_pointer_cast<InternalConnection>(shared_from_this()), message](){
boost::asio::post(*io, [self = std::static_pointer_cast<InternalConnection>(shared_from_this()), message](){
if (self->connectionActive)
self->listener.onPacketReceived(self, message);
});
@@ -224,7 +224,7 @@ void InternalConnection::receivePacket(const std::vector<std::byte> & message)
void InternalConnection::disconnect()
{
io->post([self = std::static_pointer_cast<InternalConnection>(shared_from_this())](){
boost::asio::post(*io, [self = std::static_pointer_cast<InternalConnection>(shared_from_this())](){
self->listener.onDisconnected(self, "Internal connection has been terminated");
self->otherSideWeak.reset();
self->connectionActive = false;

View File

@@ -79,7 +79,7 @@ void NetworkHandler::createInternalConnection(INetworkClientListener & listener,
server.receiveInternalConnection(localConnection);
io->post([&listener, localConnection](){
boost::asio::post(*io, [&listener, localConnection](){
listener.onConnectionEstablished(localConnection);
});
}