forked from teamnwah/openmw-tes3coop
Better Text Indices; Better file output
This commit is contained in:
parent
859ac1153e
commit
295eb27c2d
2 changed files with 25 additions and 4 deletions
|
@ -34,8 +34,14 @@ namespace MWRender{
|
|||
time = startTime;
|
||||
}
|
||||
else if(textmappings){
|
||||
|
||||
std::string startName = groupname + ": start";
|
||||
std::string stopName = groupname + ": stop";
|
||||
|
||||
if(loops > 1){
|
||||
startName = groupname + ": loop start";
|
||||
std::string stopName = groupname + ": loop stop";
|
||||
}
|
||||
std::cout << "StartName:" << startName << "\n";
|
||||
bool first = false;
|
||||
for(std::map<std::string, float>::iterator iter = textmappings->begin(); iter != textmappings->end(); iter++){
|
||||
|
|
|
@ -1006,11 +1006,26 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
|
|||
replace(text.begin(), text.end(), '\n', '/');
|
||||
|
||||
text.erase(std::remove(text.begin(), text.end(), '\r'), text.end());
|
||||
if(text.at(0) == '/')
|
||||
text.erase(0, 1);
|
||||
file << "Time: " << textiter->time << "|" << text << "\n";
|
||||
int i = 0;
|
||||
while(i < text.length()){
|
||||
while(i < text.length() && text.at(i) == '/' ){
|
||||
i++;
|
||||
}
|
||||
int first = i;
|
||||
int length = 0;
|
||||
while(i < text.length() && text.at(i) != '/' ){
|
||||
i++;
|
||||
length++;
|
||||
}
|
||||
if(first < text.length()){
|
||||
//length = text.length() - first;
|
||||
std::string sub = text.substr(first, length);
|
||||
|
||||
textmappings[text] = textiter->time;
|
||||
file << "Time: " << textiter->time << "|" << sub << "\n";
|
||||
|
||||
textmappings[sub] = textiter->time;
|
||||
}
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue