Playing failure sounds when entering text consistently; bug #884
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2348 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -207,14 +207,20 @@ DoTextEntry (PTEXTENTRY_STATE pTES)
|
||||
pTES->JoystickMode = FALSE;
|
||||
|
||||
chsize = getStringFromChar (chbuf, sizeof (chbuf), ch);
|
||||
if (isWidePrintChar (ch) && chsize > 0
|
||||
&& (pStr + len - pTES->BaseStr + chsize < pTES->MaxSize))
|
||||
{ // insert character
|
||||
memmove (pStr + chsize, pStr, len + 1);
|
||||
memcpy (pStr, chbuf, chsize);
|
||||
pStr += chsize;
|
||||
++pTES->CursorPos;
|
||||
changed = TRUE;
|
||||
if (isWidePrintChar (ch) && chsize > 0)
|
||||
{
|
||||
if (pStr + len - pTES->BaseStr + chsize < pTES->MaxSize)
|
||||
{ // insert character, when fits
|
||||
memmove (pStr + chsize, pStr, len + 1);
|
||||
memcpy (pStr, chbuf, chsize);
|
||||
pStr += chsize;
|
||||
++pTES->CursorPos;
|
||||
changed = TRUE;
|
||||
}
|
||||
else
|
||||
{ // does not fit
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
}
|
||||
ch = GetNextCharacter ();
|
||||
}
|
||||
@@ -378,6 +384,10 @@ DoTextEntry (PTEXTENTRY_STATE pTES)
|
||||
len += newch.len;
|
||||
changed = TRUE;
|
||||
}
|
||||
else
|
||||
{ // does not fit
|
||||
PlayMenuSound (MENU_SOUND_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user