Preserve character case when editing with joystick; bug #0180

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3539 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2010-05-22 19:14:57 +00:00
parent e354e5e481
commit fb828d599c
2 changed files with 12 additions and 2 deletions
+1
View File
@@ -1,4 +1,5 @@
Changes towards version 0.7: Changes towards version 0.7:
- Preserve character case when editing with joystick (bug #1080) - Alex
- Fixed misaligned cargo count (bug #1092) - Coredev - Fixed misaligned cargo count (bug #1092) - Coredev
- Fixed the network SuperMelee team configuration protocol - SvdB - Fixed the network SuperMelee team configuration protocol - SvdB
- Fixed fuel reserve bounds checks - SvdB - Fixed fuel reserve bounds checks - SvdB
+11 -2
View File
@@ -313,13 +313,22 @@ DoTextEntry (TEXTENTRY_STATE *pTES)
joy_char_t newch; joy_char_t newch;
joy_char_t cmpch; joy_char_t cmpch;
int i; int i;
BOOLEAN curCharUpper;
pTES->JoystickMode = TRUE; pTES->JoystickMode = TRUE;
if (len) if (len)
{ // changing an existing character
ReadOneChar (&ch, pStr); ReadOneChar (&ch, pStr);
curCharUpper = !JoyCharIsLower (&ch, pTES);
}
else else
{ // adding a new character
ch = pTES->JoyAlpha[0]; ch = pTES->JoyAlpha[0];
// new characters will have case determined by the
// currently selected register
curCharUpper = pTES->UpperRegister;
}
newch = ch; newch = ch;
JoyCharToUpper (&cmpch, &ch, pTES); JoyCharToUpper (&cmpch, &ch, pTES);
@@ -347,7 +356,7 @@ DoTextEntry (TEXTENTRY_STATE *pTES)
{ {
if (len) if (len)
{ // single char change { // single char change
if (JoyCharIsLower (&newch, pTES)) if (!curCharUpper)
JoyCharToUpper (&newch, &newch, pTES); JoyCharToUpper (&newch, &newch, pTES);
else else
JoyCharToLower (&newch, &newch, pTES); JoyCharToLower (&newch, &newch, pTES);
@@ -359,7 +368,7 @@ DoTextEntry (TEXTENTRY_STATE *pTES)
} }
else else
{ // check register { // check register
if (pTES->UpperRegister) if (curCharUpper)
JoyCharToUpper (&newch, &newch, pTES); JoyCharToUpper (&newch, &newch, pTES);
else else
JoyCharToLower (&newch, &newch, pTES); JoyCharToLower (&newch, &newch, pTES);