Fix sign save/topic regex.

This commit is contained in:
Saveliy Skresanov 2013-08-22 18:43:46 +07:00
parent 12c471f257
commit b2045b0a7f
4 changed files with 4 additions and 4 deletions

View File

@ -927,7 +927,7 @@ void Renderer::DrawSigns()
sim->signs[i].pos(text, x, y, w, h);
clearrect(x, y, w+1, h);
drawrect(x, y, w+1, h, 192, 192, 192, 255);
if (sregexp(signs[i].text.c_str(), "^{[c|t]:[0-9]*|.*}$"))
if (sregexp(signs[i].text.c_str(), "^{[ct]:[0-9]*|.*}$"))
drawtext(x+3, y+3, text, 255, 255, 255, 255);
else
drawtext(x+3, y+3, text, 0, 191, 255, 255);

View File

@ -571,7 +571,7 @@ bool GameController::MouseUp(int x, int y, unsigned button)
(*iter).pos((*iter).getText(sim), signx, signy, signw, signh);
if (x>=signx && x<=signx+signw && y>=signy && y<=signy+signh)
{
if (sregexp((*iter).text.c_str(), "^{[c|t]:[0-9]*|.*}$")==0)
if (sregexp((*iter).text.c_str(), "^{[ct]:[0-9]*|.*}$")==0)
{
const char * signText = (*iter).text.c_str();
char buff[256];

View File

@ -183,7 +183,7 @@ void SignWindow::DoDraw()
currentSign.pos(text, x, y, w, h);
g->clearrect(x, y, w+1, h);
g->drawrect(x, y, w+1, h, 192, 192, 192, 255);
if (sregexp(currentSign.text.c_str(), "^{[c|t]:[0-9]*|.*}$"))
if (sregexp(currentSign.text.c_str(), "^{[ct]:[0-9]*|.*}$"))
g->drawtext(x+3, y+3, text, 255, 255, 255, 255);
else
g->drawtext(x+3, y+3, text, 0, 191, 255, 255);

View File

@ -31,7 +31,7 @@ std::string sign::getText(Simulation *sim)
else
sprintf(buff, "Temp: 0.00"); //...temperature
}
else if (sregexp(signText, "^{[c|t]:[0-9]*|.*}$")==0)
else if (sregexp(signText, "^{[ct]:[0-9]*|.*}$")==0)
{
int sldr, startm;
memset(buff, 0, sizeof(buff));