1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

* code reorganization

* minor stuff for resource <-> infoBar interaction
This commit is contained in:
Michał W. Urbańczyk
2007-12-22 14:40:27 +00:00
parent 84261a5de8
commit e427974875
7 changed files with 400 additions and 379 deletions

View File

@@ -16,6 +16,8 @@
#include "hch/CGeneralTextHandler.h"
#include <sstream>
#include "CPlayerInterface.h"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/replace.hpp>
#pragma warning (disable : 4311)
bool getGlobalFunc(lua_State * L, std::string fname)
{
@@ -470,7 +472,11 @@ void CPickable::onHeroVisit(CGObjectInstance *os, int heroID)
val = 3 + (rand()%3);
break;
}
SComponent ccc(SComponent::resource,os->subID,val);
ccc.description = CGI->objh->advobtxt[113];
boost::algorithm::replace_first(ccc.description,"%s",CGI->objh->restypes[os->subID]);
cb->giveResource(cb->getHeroOwner(heroID),os->subID,val);
cb->showCompInfo(cb->getHeroOwner(heroID),&ccc);
break;
}
}