mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
Basic Text Indices Working
This commit is contained in:
parent
0715f9b6ab
commit
859ac1153e
3 changed files with 33 additions and 0 deletions
|
@ -33,6 +33,32 @@ namespace MWRender{
|
||||||
animate = loops;
|
animate = loops;
|
||||||
time = startTime;
|
time = startTime;
|
||||||
}
|
}
|
||||||
|
else if(textmappings){
|
||||||
|
std::string startName = groupname + ": start";
|
||||||
|
std::string stopName = groupname + ": stop";
|
||||||
|
std::cout << "StartName:" << startName << "\n";
|
||||||
|
bool first = false;
|
||||||
|
for(std::map<std::string, float>::iterator iter = textmappings->begin(); iter != textmappings->end(); iter++){
|
||||||
|
|
||||||
|
std::string current = iter->first.substr(0, startName.size());
|
||||||
|
std::transform(current.begin(), current.end(), current.begin(), ::tolower);
|
||||||
|
std::string current2 = iter->first.substr(0, stopName.size());
|
||||||
|
std::transform(current2.begin(), current2.end(), current2.begin(), ::tolower);
|
||||||
|
|
||||||
|
if(current == startName){
|
||||||
|
startTime = iter->second;
|
||||||
|
animate = loops;
|
||||||
|
time = startTime;
|
||||||
|
first = true;
|
||||||
|
}
|
||||||
|
if(current2 == stopName){
|
||||||
|
stopTime = iter->second;
|
||||||
|
if(first)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
void Animation::stopScript(){
|
void Animation::stopScript(){
|
||||||
|
|
|
@ -10,6 +10,11 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <openengine/bullet/physic.hpp>
|
#include <openengine/bullet/physic.hpp>
|
||||||
|
|
||||||
|
using namespace boost::algorithm;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace MWRender{
|
namespace MWRender{
|
||||||
|
|
||||||
class Animation{
|
class Animation{
|
||||||
|
|
|
@ -1006,6 +1006,8 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
|
||||||
replace(text.begin(), text.end(), '\n', '/');
|
replace(text.begin(), text.end(), '\n', '/');
|
||||||
|
|
||||||
text.erase(std::remove(text.begin(), text.end(), '\r'), text.end());
|
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";
|
file << "Time: " << textiter->time << "|" << text << "\n";
|
||||||
|
|
||||||
textmappings[text] = textiter->time;
|
textmappings[text] = textiter->time;
|
||||||
|
|
Loading…
Reference in a new issue