Game Development Community

dev|Pro Game Development Curriculum

Chatting for Korean game players

by game4Rest · 08/17/2006 (11:58 am) · 3 comments

First of all, I'm not a native speaker of English. Please, excuse my poor English.

As you all know, Torque 1.4 supports unicode even though it is not complete.
The problem is it does not provide unicode chatting, which is indispensable
in Korean Market. So, I had to find my own.

After spending quite a lot time, I found everything is ready for us to use for
unicode chatting. So, here it goes!

Disclaimer: As Torque 1.4 began to support unicode, my code only works with it.
This solution is not perfect. It has minor problem, which seems not so difficult
to find the solution. I hope other people will come up with it.

First, we need Korean fonts. Please see this link to include additional fonts.

http://tdn.garagegames.com/wiki/GUI/Fonts/New_Fonts

You have to see the fonts like gulim16(ansi).uft, which is generated automatically when you
done properly.

Now, find the line new GuiControlProfile ("ChatHudMessageProfile") located in the
client/ui/defaultGameProfile.cs. Change the font type as you like. I changed it like this.
fontType = "gulim";

After that, we need to change and add some code.

In the winWindow.cc, find the function "platform::disableKeyboardTranslation(void)".
Comment out the function ImmAssociateContext( winState.appWindow, NULL );
As, it sets hIMC null, IME cannot be used. I chose to comment it out, which is quite
temporarily.

Next, find the line "case WM_IME_CHAR:".
Comment out the "processCharMessage( wParam, lParam );".

And finally, find the line beginning with "if ( !mgr || !mgr->isKeyboardActive() )".
We have to change the whole IF sentence. So,

if ( !mgr || !mgr->isKeyboardActive() )
      {
         switch ( message )
         {
            case WM_KEYUP:
            case WM_SYSKEYUP:
            case WM_KEYDOWN:
            case WM_SYSKEYDOWN:
               processKeyMessage(message, wParam, lParam);
               break;
         }
      }

have to changed to
if ( !mgr || !mgr->isKeyboardActive() )
      {
         switch ( message )
         {
		 case WM_CHAR:
			 processCharMessage(wParam,lParam);
			 break;

            case WM_KEYUP:
            case WM_SYSKEYUP:
            case WM_KEYDOWN:
            case WM_SYSKEYDOWN:
				switch(wParam)
				{
				case VK_ESCAPE:
				case VK_RETURN:
				case VK_LEFT:
				case VK_RIGHT:
				case VK_DELETE:
				case VK_BACK:
					processKeyMessage(message, wParam, lParam);
					break;
				}
				break;
         }
      }

Now, make a clean build. And enjoy it.
Here is a screen shot.

P.S.: Usually, players activates the input window by hitting "Enter" key. So, if you want it, please see
the default.bind.cs under your mod directory. Currently "u" key is used to activate the input window.
We'll have to change it to "return" key. So it will look like this.
moveMap.bind(keyboard, "Enter", toggleMessageHud );
Please, make sure to delete the config.cs file located in the MOD/client directory. It will be generated again with new binds automatically when you fire up your game.

#1
07/24/2007 (12:54 am)
I'm wondering if anyone is watching this resource. But I need to add some comment to this.
First, uft is generated AFTER we define it in the script.
So,
1. copy the font to use into the common/ui/cache folder.
2.define fontType as you like.
3. execute the game.
Then, you'll see the uft font there.

Secondly, as it deals with backspace again, it deletes two characters at once when you hit the backspace key. For example, in guiTextEditCtrl when you hit back space key, it deletes two character, which is nonesense.
So, please comment out "case VK_BACK:" line.

edit: I tested this with TGE 1.5.2.

Hope this helps someone.
#2
05/13/2009 (12:59 am)
TGB 1.7.2 korean help me~~~
#3
05/13/2009 (1:40 am)
@Sung-Sik,
Will you drop me an e-mail to zzleggam @ paran dot com ?