1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Spell scroll improvements, fixing #689, #690, #691.

CArtPlace now uses common CInfoWindow for r-click popup (with or without a custom component), old CMessage::genWindow no longer needed.
This commit is contained in:
Michał W. Urbańczyk
2011-03-12 21:55:31 +00:00
parent 122a6a039e
commit 39120fe4a5
10 changed files with 140 additions and 76 deletions

View File

@ -3612,12 +3612,12 @@ void CGArtifact::onHeroVisit( const CGHeroInstance * h ) const
if(!stacksCount())
{
InfoWindow iw;
iw.soundID = soundBase::treasure;
iw.player = h->tempOwner;
switch(ID)
{
case 5:
case 5:
{
iw.soundID = soundBase::treasure; //play sound only for non-scroll arts
iw.components.push_back(Component(4,subID,0,0));
if(message.length())
iw.text << message;
@ -3625,15 +3625,14 @@ void CGArtifact::onHeroVisit( const CGHeroInstance * h ) const
iw.text << std::pair<ui8,ui32>(12,subID);
}
break;
case 93:
{
int spellID = storedArtifact->getBonus(Selector::type(Bonus::SPELL))->subtype;
iw.components.push_back (Component(Component::SPELL, spellID,0,0));
iw.text.addTxt (MetaString::ADVOB_TXT,135);
iw.text.addReplacement(MetaString::SPELL_NAME, spellID);
}
case 93:
{
int spellID = storedArtifact->getGivenSpellID();
iw.components.push_back (Component(Component::SPELL, spellID,0,0));
iw.text.addTxt (MetaString::ADVOB_TXT,135);
iw.text.addReplacement(MetaString::SPELL_NAME, spellID);
}
break;
}
cb->showInfoDialog(&iw);
pick(h);