Explorar o código

Add pre-battle message

nordsoft %!s(int64=2) %!d(string=hai) anos
pai
achega
a5492b30c3
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      lib/mapObjects/CGCreature.cpp

+ 10 - 0
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...
 	{