mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +02:00
3a66dc2b7c
* better handling disposed/predefined heroes * blocked scrolling adventure map with mouse when left ctrl is pressed * scholar will be accessible from the top * partially done tavern and hero recruitment * fixed bug with formation button in hero window * unified hero initialization code * minor changes For 0.63c dev release
67 lines
1.4 KiB
C++
67 lines
1.4 KiB
C++
#include "../stdafx.h"
|
|
#include "CGeneralTextHandler.h"
|
|
#include "../CGameInfo.h"
|
|
#include "CLodHandler.h"
|
|
#include <fstream>
|
|
|
|
void CGeneralTextHandler::load()
|
|
{
|
|
std::string buf = CGI->bitmaph->getTextFile("GENRLTXT.TXT"), tmp;
|
|
int andame = buf.size();
|
|
int i=0; //buf iterator
|
|
for(i; i<andame; ++i)
|
|
{
|
|
if(buf[i]=='\r')
|
|
break;
|
|
}
|
|
|
|
i+=2;
|
|
std::string buflet;
|
|
for(int jj=0; jj<764; ++jj)
|
|
{
|
|
loadToIt(buflet, buf, i, 2);
|
|
if(buflet[0] == '"' && buflet[buflet.size()-1] == '"')
|
|
buflet = buflet.substr(1,buflet.size()-2);
|
|
allTexts.push_back(buflet);
|
|
}
|
|
|
|
std::string strs = CGI->bitmaph->getTextFile("ARRAYTXT.TXT");
|
|
|
|
int itr=0;
|
|
while(itr<strs.length()-1)
|
|
{
|
|
loadToIt(tmp, strs, itr, 3);
|
|
arraytxt.push_back(tmp);
|
|
}
|
|
|
|
itr = 0;
|
|
std::string strin = CGI->bitmaph->getTextFile("PRISKILL.TXT");
|
|
for(int hh=0; hh<4; ++hh)
|
|
{
|
|
loadToIt(tmp, strin, itr, 3);
|
|
primarySkillNames.push_back(tmp);
|
|
}
|
|
|
|
itr = 0;
|
|
std::string strin2 = CGI->bitmaph->getTextFile("JKTEXT.TXT");
|
|
for(int hh=0; hh<45; ++hh)
|
|
{
|
|
loadToIt(tmp, strin2, itr, 3);
|
|
jktexts.push_back(tmp);
|
|
}
|
|
|
|
itr = 0;
|
|
std::string strin3 = CGI->bitmaph->getTextFile("HEROSCRN.TXT");
|
|
for(int hh=0; hh<33; ++hh)
|
|
{
|
|
loadToIt(tmp, strin3, itr, 3);
|
|
heroscrn.push_back(tmp);
|
|
}
|
|
|
|
strin3 = CGI->bitmaph->getTextFile("ARTEVENT.TXT");
|
|
for(itr = 0; itr<strin3.size();itr++)
|
|
{
|
|
loadToIt(tmp, strin3, itr, 3);
|
|
artifEvents.push_back(tmp);
|
|
}
|
|
} |