From a5492b30c3b529a700371411bf6d246c44d369b9 Mon Sep 17 00:00:00 2001 From: nordsoft Date: Sat, 23 Sep 2023 02:35:21 +0200 Subject: [PATCH] Add pre-battle message --- lib/mapObjects/CGCreature.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/mapObjects/CGCreature.cpp b/lib/mapObjects/CGCreature.cpp index 7da445fca..a2891c2cb 100644 --- a/lib/mapObjects/CGCreature.cpp +++ b/lib/mapObjects/CGCreature.cpp @@ -103,6 +103,16 @@ std::string CGCreature::getHoverText(const CGHeroInstance * hero) const void CGCreature::onHeroVisit( const CGHeroInstance * h ) const { + //show message + if(!message.empty()) + { + InfoWindow iw; + iw.player = h->tempOwner; + iw.text.appendRawString(message); + iw.type = EInfoWindowMode::MODAL; + cb->showInfoDialog(&iw); + } + int action = takenAction(h); switch( action ) //decide what we do... {