1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Support for Tree of knowledge and minor changes.

This commit is contained in:
Michał W. Urbańczyk
2008-08-22 12:21:09 +00:00
parent 1c7e3718a7
commit 0607ec70cf
16 changed files with 256 additions and 81 deletions

View File

@ -605,7 +605,14 @@ void SComponent::init(Etype Type, int Subtype, int Val)
case experience:
description = CGI->generaltexth->allTexts[241];
oss << Val ;
subtitle = oss.str();
if(Subtype && Val==1)
{
subtitle = CGI->generaltexth->allTexts[442];
}
else
{
subtitle = oss.str();
}
break;
}
type = Type;
@ -622,8 +629,8 @@ SComponent::SComponent(Etype Type, int Subtype, int Val)
SComponent::SComponent(const Component &c)
{
if(c.id==0 && c.subtype==4)
init(experience,0,c.val);
if(c.id==5)
init(experience,c.subtype,c.val);
else
init((Etype)c.id,c.subtype,c.val);
@ -2202,6 +2209,29 @@ void CPlayerInterface::showYesNoDialog(std::string &text, const std::vector<SCom
temp->activate();
LOCPLINT->objsToBlit.push_back(temp);
}
void CPlayerInterface::showYesNoDialog( std::string &text, const std::vector<Component*> &components, ui32 askID )
{
boost::unique_lock<boost::mutex> un(*pim);
curint->deactivate(); //dezaktywacja starego interfejsu
std::vector<SComponent*> intComps;
for(int i=0;i<components.size();i++)
intComps.push_back(new SComponent(*components[i])); //will be deleted by CSelWindow::close
std::vector<std::pair<std::string,CFunctionList<void()> > > pom;
pom.push_back(std::pair<std::string,CFunctionList<void()> >("IOKAY.DEF",0));
pom.push_back(std::pair<std::string,CFunctionList<void()> >("ICANCEL.DEF",0));
CInfoWindow * temp = new CInfoWindow(text,playerID,32,intComps,pom);
temp->buttons[0]->callback += boost::bind(&IActivable::activate,curint);
temp->buttons[1]->callback += boost::bind(&IActivable::activate,curint);
temp->buttons[0]->callback += boost::bind(&CCallback::selectionMade,cb,0,askID);
temp->buttons[1]->callback += boost::bind(&CCallback::selectionMade,cb,1,askID);
temp->delComps = true;
temp->activate();
LOCPLINT->objsToBlit.push_back(temp);
}
void CPlayerInterface::removeObjToBlit(IShowable* obj)
{
objsToBlit.erase