From b2045b0a7fadbee87ecf52fe14699819b58e7667 Mon Sep 17 00:00:00 2001 From: Saveliy Skresanov Date: Thu, 22 Aug 2013 18:43:46 +0700 Subject: [PATCH] Fix sign save/topic regex. --- src/graphics/Renderer.cpp | 2 +- src/gui/game/GameController.cpp | 2 +- src/gui/game/SignTool.cpp | 2 +- src/simulation/Sign.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index d47b1bae9..833cec2bc 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -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); diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 488d30a7b..8b58b48ce 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -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]; diff --git a/src/gui/game/SignTool.cpp b/src/gui/game/SignTool.cpp index 5e7eb0ab4..87ed59e96 100644 --- a/src/gui/game/SignTool.cpp +++ b/src/gui/game/SignTool.cpp @@ -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); diff --git a/src/simulation/Sign.cpp b/src/simulation/Sign.cpp index 57d98bcd2..7ba94afda 100644 --- a/src/simulation/Sign.cpp +++ b/src/simulation/Sign.cpp @@ -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));