From 2e66e4bb6719e92c53bcbf40c82bf5d7644719cb Mon Sep 17 00:00:00 2001 From: tobigun Date: Mon, 12 Jan 2009 16:55:45 +0000 Subject: CharCode parameter of ParseInput changed from WideChar to UCS4Char (as some chars might reguire two WideChar). git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1565 b956fd51-792f-4845-bead-9b4dfca2ff2c --- unicode/src/screens/UScreenPartyPlayer.pas | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'unicode/src/screens/UScreenPartyPlayer.pas') diff --git a/unicode/src/screens/UScreenPartyPlayer.pas b/unicode/src/screens/UScreenPartyPlayer.pas index 799d00e5..3e453058 100644 --- a/unicode/src/screens/UScreenPartyPlayer.pas +++ b/unicode/src/screens/UScreenPartyPlayer.pas @@ -64,16 +64,22 @@ type Player12Name: Cardinal; constructor Create; override; - function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override; + function ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; PressedDown: Boolean): Boolean; override; procedure onShow; override; procedure SetAnimationProgress(Progress: real); override; end; implementation -uses UGraphic, UMain, UIni, UTexture, UParty; - -function TScreenPartyPlayer.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; +uses + UGraphic, + UMain, + UIni, + UTexture, + UParty, + UUnicodeUtils; + +function TScreenPartyPlayer.ParseInput(PressedKey: Cardinal; CharCode: UCS4Char; PressedDown: Boolean): Boolean; var SDL_ModState: Word; procedure IntNext; @@ -100,9 +106,14 @@ begin begin // Key Down // check normal keys case CharCode of - '0'..'9', 'a'..'z', 'A'..'Z', ' ', '-', '_', '!', ',', '<', '/', '*', '?', '''', '"': + Ord('0')..Ord('9'), + Ord('a')..Ord('z'), + Ord('A')..Ord('Z'), + Ord(' '), Ord('-'), Ord('_'), Ord('!'), Ord(','), Ord('<'), Ord('/'), + Ord('*'), Ord('?'), Ord(''''), Ord('"'): begin - Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + CharCode; + Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + + UCS4ToUTF8String(CharCode); Exit; end; end; -- cgit v1.2.3