mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
-Fixed some problems with russian letters in IMP page (by ViSoR)
-Added 2 letters for French (Ligatures Æ, æ, Œ, œ). Now we have support for all French alphabet -Converted French text to UTF-8 for simple use in ather OS Language git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4877 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+78
-10
@@ -114,6 +114,9 @@ void RenderGender( void );
|
||||
void DecrementTextEnterMode( void );
|
||||
void Print8CharacterOnlyString( void );
|
||||
BOOLEAN CheckCharacterInputForEgg( void );
|
||||
UINT32 GetCyrillicUnicodeChar( UINT32 uiKey );
|
||||
UINT32 TranslateKey( UINT32 uiKey, unsigned char* translationTable );
|
||||
BOOLEAN CheckIsKeyValid( UINT32 uiKey );
|
||||
|
||||
// mouse region callbacks
|
||||
void SelectFullNameRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
@@ -586,18 +589,29 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
|
||||
break;
|
||||
default:
|
||||
//Heinz (18.01.2009): Russian layout
|
||||
// ViSoR (07.01.2012) : Russian and Belarussian layouts
|
||||
//
|
||||
#if defined(RUSSIAN)
|
||||
if( ( (DWORD)GetKeyboardLayout(0) & 0xFFFF ) == 0x419)
|
||||
#if defined(RUSSIAN) || defined(BELARUSSIAN)
|
||||
if( ( (DWORD)GetKeyboardLayout(0) & 0xFFFF ) == 0x419) // Russian
|
||||
{
|
||||
unsigned char RussianTranslationTable[] =
|
||||
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ##ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨";
|
||||
if(uiKey >= ' ' && uiKey <= '~') uiKey = RussianTranslationTable[uiKey-' '];
|
||||
else uiKey = '#';
|
||||
unsigned char TranslationTable[] =
|
||||
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ##ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨";
|
||||
|
||||
uiKey = TranslateKey( uiKey, TranslationTable );
|
||||
uiKey = GetCyrillicUnicodeChar( uiKey );
|
||||
}
|
||||
else if( !(uiKey >= 'A' && uiKey <= 'Z' || uiKey >= 'a' && uiKey <= 'z' || uiKey >= '0' && uiKey <= '9' ||
|
||||
uiKey == '_' || uiKey == '.' || uiKey == ' ') ) uiKey = '#';
|
||||
if(uiKey != '#')
|
||||
else if ( ( (DWORD)GetKeyboardLayout(0) & 0xFFFF ) == 0x423) // Belarussian
|
||||
{
|
||||
unsigned char TranslationTable[] =
|
||||
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ##Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨";
|
||||
|
||||
uiKey = TranslateKey( uiKey, TranslationTable );
|
||||
uiKey = GetCyrillicUnicodeChar( uiKey );
|
||||
}
|
||||
else if( !CheckIsKeyValid( uiKey ) )
|
||||
uiKey = '#';
|
||||
|
||||
if( uiKey != '#')
|
||||
#else
|
||||
#ifndef USE_CODE_PAGE
|
||||
if( uiKey >= 'A' && uiKey <= 'Z' ||
|
||||
@@ -688,10 +702,64 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
|
||||
return;
|
||||
}
|
||||
|
||||
UINT32 GetCyrillicUnicodeChar( UINT32 uiKey )
|
||||
{
|
||||
// À - ÿ
|
||||
if (uiKey >= 192 && uiKey <= 255)
|
||||
uiKey += 0x0350;
|
||||
|
||||
// ¨
|
||||
if (uiKey == 168)
|
||||
uiKey = 0x0401;
|
||||
|
||||
// ¸
|
||||
if (uiKey == 184)
|
||||
uiKey = 0x0451;
|
||||
|
||||
// ¡
|
||||
if (uiKey == 161)
|
||||
uiKey = 0x040E;
|
||||
|
||||
// ¢
|
||||
if (uiKey == 162)
|
||||
uiKey = 0x045E;
|
||||
|
||||
// ²
|
||||
if (uiKey == 178)
|
||||
uiKey = 0x0406;
|
||||
|
||||
// ³
|
||||
if (uiKey == 179)
|
||||
uiKey = 0x0456;
|
||||
|
||||
return uiKey;
|
||||
}
|
||||
|
||||
BOOLEAN CheckIsKeyValid( UINT32 uiKey )
|
||||
{
|
||||
if( uiKey >= 'A' && uiKey <= 'Z' ||
|
||||
uiKey >= 'a' && uiKey <= 'z' ||
|
||||
uiKey >= '0' && uiKey <= '9' ||
|
||||
uiKey == '_' ||
|
||||
uiKey == '.' ||
|
||||
uiKey == ' ')
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
UINT32 TranslateKey( UINT32 uiKey, unsigned char* translationTable )
|
||||
{
|
||||
if( uiKey >= ' ' && uiKey <= '~' )
|
||||
uiKey = translationTable[uiKey-' '];
|
||||
else
|
||||
uiKey = '#';
|
||||
|
||||
return uiKey;
|
||||
}
|
||||
|
||||
void DisplayFullNameStringCursor( void )
|
||||
{
|
||||
{
|
||||
// this procdure will draw the activation string cursor on the screen at position cursorx cursory
|
||||
UINT32 uiDestPitchBYTES;
|
||||
static UINT32 uiBaseTime = 0;
|
||||
|
||||
Reference in New Issue
Block a user