Limit edit boxes input till numbers only (fine as this is for Rocket only but shouldn't be in regular emgui (needs flag))
This commit is contained in:
parent
a51a821fde
commit
9e355122a5
@ -1024,9 +1024,15 @@ void Emgui_editBoxXY(int x, int y, int width, int height, int bufferLength, char
|
|||||||
|
|
||||||
default :
|
default :
|
||||||
{
|
{
|
||||||
|
// Rocket hack:
|
||||||
|
// Currenty for rocket we only need 0-9 as input (for the edit field
|
||||||
|
// so we only update here if those are the keys
|
||||||
int offset = emini(bufferLength - 2, len);
|
int offset = emini(bufferLength - 2, len);
|
||||||
buffer[offset + 0] = (char)keyCode;
|
if (keyCode >= '0' && keyCode <= '9')
|
||||||
buffer[offset + 1] = 0;
|
{
|
||||||
|
buffer[offset + 0] = (char)keyCode;
|
||||||
|
buffer[offset + 1] = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user