{t:15100|text} to open a forum thread (will try to add more shortcuts later)
This commit is contained in:
parent
7c0ba094b8
commit
71db872e64
@ -536,7 +536,7 @@ bool GameController::MouseUp(int x, int y, unsigned button)
|
|||||||
(*iter).pos(signx, signy, signw, signh);
|
(*iter).pos(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:[0-9]*|.*}$")==0)
|
if (sregexp((*iter).text.c_str(), "^{[c|t]:[0-9]*|.*}$")==0)
|
||||||
{
|
{
|
||||||
const char * signText = (*iter).text.c_str();
|
const char * signText = (*iter).text.c_str();
|
||||||
char buff[256];
|
char buff[256];
|
||||||
@ -550,8 +550,17 @@ bool GameController::MouseUp(int x, int y, unsigned button)
|
|||||||
buff[sldr-3] = '\0';
|
buff[sldr-3] = '\0';
|
||||||
|
|
||||||
int tempSaveID = format::StringToNumber<int>(std::string(buff));
|
int tempSaveID = format::StringToNumber<int>(std::string(buff));
|
||||||
if(tempSaveID)
|
if (tempSaveID)
|
||||||
OpenSavePreview(tempSaveID, 0);
|
{
|
||||||
|
if ((*iter).text.c_str()[1] == 'c')
|
||||||
|
OpenSavePreview(tempSaveID, 0);
|
||||||
|
else if ((*iter).text.c_str()[1] == 't')
|
||||||
|
{
|
||||||
|
char url[256];
|
||||||
|
sprintf(url, "http://powdertoy.co.uk/Discussions/Thread/View.html?Thread=%i", tempSaveID);
|
||||||
|
OpenURI(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ void SignWindow::DoDraw()
|
|||||||
sprintf(buff, "Temp: 0.00"); //...temperature
|
sprintf(buff, "Temp: 0.00"); //...temperature
|
||||||
g->drawtext(x+3, y+3, buff, 255, 255, 255, 255);
|
g->drawtext(x+3, y+3, buff, 255, 255, 255, 255);
|
||||||
}
|
}
|
||||||
else if (sregexp(currentSign.text.c_str(), "^{c:[0-9]*|.*}$")==0)
|
else if (sregexp(currentSign.text.c_str(), "^{[c|t]:[0-9]*|.*}$")==0)
|
||||||
{
|
{
|
||||||
int sldr, startm;
|
int sldr, startm;
|
||||||
memset(buff, 0, sizeof(buff));
|
memset(buff, 0, sizeof(buff));
|
||||||
|
@ -848,7 +848,7 @@ void Renderer::DrawSigns()
|
|||||||
sprintf(buff, "Temp: 0.00"); //...temperature
|
sprintf(buff, "Temp: 0.00"); //...temperature
|
||||||
drawtext(x+3, y+3, buff, 255, 255, 255, 255);
|
drawtext(x+3, y+3, buff, 255, 255, 255, 255);
|
||||||
}
|
}
|
||||||
else if (sregexp(signs[i].text.c_str(), "^{c:[0-9]*|.*}$")==0)
|
else if (sregexp(signs[i].text.c_str(), "^{[c|t]:[0-9]*|.*}$")==0)
|
||||||
{
|
{
|
||||||
int sldr, startm;
|
int sldr, startm;
|
||||||
memset(buff, 0, sizeof(buff));
|
memset(buff, 0, sizeof(buff));
|
||||||
|
@ -28,7 +28,7 @@ void sign::pos(int & x0, int & y0, int & w, int & h)
|
|||||||
{
|
{
|
||||||
w = Graphics::textwidth("Temp: 0000.00");
|
w = Graphics::textwidth("Temp: 0000.00");
|
||||||
}
|
}
|
||||||
else if (sregexp(text.c_str(), "^{c:[0-9]*|.*}$")==0)
|
else if (sregexp(text.c_str(), "^{[c|t]:[0-9]*|.*}$")==0)
|
||||||
{
|
{
|
||||||
int sldr, startm;
|
int sldr, startm;
|
||||||
char buff[256];
|
char buff[256];
|
||||||
|
Reference in New Issue
Block a user