1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Proper handling of bank names.

This commit is contained in:
DjWarmonger 2009-09-17 14:27:28 +00:00
parent 451c08922c
commit 4c1c03cf37
2 changed files with 16 additions and 6 deletions

View File

@ -3876,6 +3876,15 @@ void CBank::initObj()
daycounter = 0; daycounter = 0;
multiplier = 1; multiplier = 1;
} }
const std::string & CBank::getHoverText() const
{
hoverName = VLC->objh->creBanksNames[index];
if (bc == NULL)
hoverName += " " + VLC->generaltexth->allTexts[352];
else
hoverName += " " + VLC->generaltexth->allTexts[353];
return hoverName;
}
void CBank::reset(ui16 var1, ui16 var2) //prevents desync void CBank::reset(ui16 var1, ui16 var2) //prevents desync
{ {
ui8 chance = 0; ui8 chance = 0;
@ -4011,9 +4020,9 @@ void CBank::onHeroVisit (const CGHeroInstance * h) const
BlockingDialog bd (true, false); BlockingDialog bd (true, false);
bd.player = h->getOwner(); bd.player = h->getOwner();
bd.soundID = soundBase::DANGER; bd.soundID = soundBase::DANGER;
std::string desc = VLC->generaltexth->advobtxt[banktext]; bd.text << VLC->generaltexth->advobtxt[banktext];
boost::algorithm::replace_first (desc, "%s", VLC->generaltexth->names[ID]); if (ID == 16)
bd.text << desc; bd.text.addReplacement (VLC->objh->creBanksNames[index]);
cb->showBlockingDialog (&bd, boost::bind (&CBank::fightGuards, this, h, _1)); cb->showBlockingDialog (&bd, boost::bind (&CBank::fightGuards, this, h, _1));
} }
else else
@ -4034,9 +4043,9 @@ void CBank::onHeroVisit (const CGHeroInstance * h) const
} }
iw.soundID = soundBase::GRAVEYARD; iw.soundID = soundBase::GRAVEYARD;
iw.player = h->getOwner(); iw.player = h->getOwner();
std::string desc = VLC->generaltexth->advobtxt[33]; iw.text << VLC->generaltexth->advobtxt[33];
boost::algorithm::replace_first (desc, "%s", VLC->generaltexth->names[ID]); if (ID == 16 || ID == 24 || ID == 85)
iw.text << desc; iw.text.addReplacement (VLC->objh->creBanksNames[index]);
cb->showInfoDialog(&iw); cb->showInfoDialog(&iw);
} }
} }

View File

@ -874,6 +874,7 @@ class DLL_EXPORT CBank : public CArmedInstance
ui32 daycounter; ui32 daycounter;
void initObj(); void initObj();
const std::string & getHoverText() const;
void setPropertyDer (ui8 what, ui32 val); void setPropertyDer (ui8 what, ui32 val);
void reset(ui16 var1, ui16 var2); void reset(ui16 var1, ui16 var2);
void newTurn() const; void newTurn() const;