Fix sign save/topic regex.
This commit is contained in:
parent
12c471f257
commit
b2045b0a7f
@ -927,7 +927,7 @@ void Renderer::DrawSigns()
|
|||||||
sim->signs[i].pos(text, x, y, w, h);
|
sim->signs[i].pos(text, x, y, w, h);
|
||||||
clearrect(x, y, w+1, h);
|
clearrect(x, y, w+1, h);
|
||||||
drawrect(x, y, w+1, h, 192, 192, 192, 255);
|
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);
|
drawtext(x+3, y+3, text, 255, 255, 255, 255);
|
||||||
else
|
else
|
||||||
drawtext(x+3, y+3, text, 0, 191, 255, 255);
|
drawtext(x+3, y+3, text, 0, 191, 255, 255);
|
||||||
|
@ -571,7 +571,7 @@ bool GameController::MouseUp(int x, int y, unsigned button)
|
|||||||
(*iter).pos((*iter).getText(sim), signx, signy, signw, signh);
|
(*iter).pos((*iter).getText(sim), signx, signy, signw, signh);
|
||||||
if (x>=signx && x<=signx+signw && y>=signy && y<=signy+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();
|
const char * signText = (*iter).text.c_str();
|
||||||
char buff[256];
|
char buff[256];
|
||||||
|
@ -183,7 +183,7 @@ void SignWindow::DoDraw()
|
|||||||
currentSign.pos(text, x, y, w, h);
|
currentSign.pos(text, x, y, w, h);
|
||||||
g->clearrect(x, y, w+1, h);
|
g->clearrect(x, y, w+1, h);
|
||||||
g->drawrect(x, y, w+1, h, 192, 192, 192, 255);
|
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);
|
g->drawtext(x+3, y+3, text, 255, 255, 255, 255);
|
||||||
else
|
else
|
||||||
g->drawtext(x+3, y+3, text, 0, 191, 255, 255);
|
g->drawtext(x+3, y+3, text, 0, 191, 255, 255);
|
||||||
|
@ -31,7 +31,7 @@ std::string sign::getText(Simulation *sim)
|
|||||||
else
|
else
|
||||||
sprintf(buff, "Temp: 0.00"); //...temperature
|
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;
|
int sldr, startm;
|
||||||
memset(buff, 0, sizeof(buff));
|
memset(buff, 0, sizeof(buff));
|
||||||
|
Loading…
Reference in New Issue
Block a user