(svn r17920) -Codechange: add a 'filter' for numbers+spaces and use it for the NewGRF parameter list

This commit is contained in:
rubidium
2009-10-31 14:06:16 +00:00
parent 70ebe13ee8
commit a5d005dd53
3 changed files with 6 additions and 4 deletions

View File

@@ -194,9 +194,10 @@ void strtolower(char *str)
bool IsValidChar(WChar key, CharSetFilter afilter)
{
switch (afilter) {
case CS_ALPHANUMERAL: return IsPrintable(key);
case CS_NUMERAL: return (key >= '0' && key <= '9');
case CS_ALPHA: return IsPrintable(key) && !(key >= '0' && key <= '9');
case CS_ALPHANUMERAL: return IsPrintable(key);
case CS_NUMERAL: return (key >= '0' && key <= '9');
case CS_NUMERAL_SPACE: return (key >= '0' && key <= '9') || key == ' ';
case CS_ALPHA: return IsPrintable(key) && !(key >= '0' && key <= '9');
}
return false;