From e520f12663f97a3ca7e609d0d6f6bf91dc88e675 Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 6 Nov 2008 00:10:46 +0000 Subject: - IsNumericChar/... and other character class type functions moved to UUnicodeUtils.pas - UCS4 to UTF8 converters added. Nice for changing single characters (e.g. MyString[i] := 'de') - Player names are now UTF8 - DeleteLastLetter is UTF8 now git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1504 b956fd51-792f-4845-bead-9b4dfca2ff2c --- unicode/src/screens/UScreenCredits.pas | 16 ++++++++-------- unicode/src/screens/UScreenEditHeader.pas | 2 +- unicode/src/screens/UScreenName.pas | 22 +++++++++++++++++----- unicode/src/screens/UScreenOpen.pas | 2 +- unicode/src/screens/UScreenPartyPlayer.pas | 2 +- unicode/src/screens/UScreenSongJumpto.pas | 2 +- unicode/src/screens/UScreenSongMenu.pas | 2 +- 7 files changed, 30 insertions(+), 18 deletions(-) (limited to 'unicode/src/screens') diff --git a/unicode/src/screens/UScreenCredits.pas b/unicode/src/screens/UScreenCredits.pas index 7e85c5d4..2fb73a81 100644 --- a/unicode/src/screens/UScreenCredits.pas +++ b/unicode/src/screens/UScreenCredits.pas @@ -138,17 +138,17 @@ const OUTRO_EXD_FILE = 'outro-exit-dark.png'; Timings: array[0..21] of Cardinal=( - 20, // 0 Delay vor Start + 20, // 0 Delay before Start - 149, // 1 Ende erster Intro Zoom - 155, // 2 Start 2. Action im Intro - 170, // 3 Ende Separation im Intro - 271, // 4 Anfang Zoomout im Intro + 149, // 1 End first Intro Zoom + 155, // 2 Start 2. Action in Intro + 170, // 3 End Separation in Intro + 271, // 4 beginning Zoomout in Intro 0, // 5 unused - 261, // 6 Start fade-to-white im Intro + 261, // 6 Start fade-to-white in Intro 271, // 7 Start Main Part - 280, // 8 Start On-Beat-Sternchen Main Part + 280, // 8 Start On-Beat-Star Main Part 396, // 9 Start BlindGuard 666, // 10 Start blindy @@ -162,7 +162,7 @@ const 2826, // 18 Ende Whiteshark 3096, // 19 Start FadeOut Mainscreen 3366, // 20 Ende Credits Tune - 60); // 21 start flare im intro + 60); // 21 start flare in intro implementation diff --git a/unicode/src/screens/UScreenEditHeader.pas b/unicode/src/screens/UScreenEditHeader.pas index 5ff3dde5..edced1fa 100644 --- a/unicode/src/screens/UScreenEditHeader.pas +++ b/unicode/src/screens/UScreenEditHeader.pas @@ -150,7 +150,7 @@ begin begin T := Interaction - 2 + TextTitle; if (Interaction >= 2) and (Interaction <= 13) and (Length(Text[T].Text) >= 1) then begin - Text[T].DeleteLastL; + Text[T].DeleteLastLetter; SetRoundButtons; end; end; diff --git a/unicode/src/screens/UScreenName.pas b/unicode/src/screens/UScreenName.pas index dd11b882..3debabc3 100644 --- a/unicode/src/screens/UScreenName.pas +++ b/unicode/src/screens/UScreenName.pas @@ -34,7 +34,13 @@ interface {$I switches.inc} uses - UMenu, SDL, UDisplay, UMusic, UFiles, SysUtils, UThemes; + UMenu, + UDisplay, + UMusic, + UFiles, + SDL, + SysUtils, + UThemes; type TScreenName = class(TMenu) @@ -48,7 +54,12 @@ type implementation -uses UGraphic, UMain, UIni, UTexture, UCommon; +uses + UGraphic, + UMain, + UIni, + UTexture, + UUnicodeUtils; function TScreenName.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; @@ -65,9 +76,10 @@ begin // check normal keys if (IsAlphaNumericChar(CharCode) or - {(CharCode in [' ','-','_','!',',','<','/','*','?','''','"']))} IsPunctuationChar(CharCode)) then + IsPunctuationChar(CharCode)) then begin - Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + CharCode; + Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + + UTF8Encode(CharCode); Exit; end; @@ -186,7 +198,7 @@ begin SDLK_BACKSPACE: begin - Button[Interaction].Text[0].DeleteLastL; + Button[Interaction].Text[0].DeleteLastLetter; end; SDLK_ESCAPE : diff --git a/unicode/src/screens/UScreenOpen.pas b/unicode/src/screens/UScreenOpen.pas index 116fd175..8c03ba50 100644 --- a/unicode/src/screens/UScreenOpen.pas +++ b/unicode/src/screens/UScreenOpen.pas @@ -82,7 +82,7 @@ begin begin if Interaction = 0 then begin - Text[TextN].DeleteLastL; + Text[TextN].DeleteLastLetter; end; end; diff --git a/unicode/src/screens/UScreenPartyPlayer.pas b/unicode/src/screens/UScreenPartyPlayer.pas index d38a6435..799d00e5 100644 --- a/unicode/src/screens/UScreenPartyPlayer.pas +++ b/unicode/src/screens/UScreenPartyPlayer.pas @@ -221,7 +221,7 @@ begin SDLK_BACKSPACE: begin - Button[Interaction].Text[0].DeleteLastL; + Button[Interaction].Text[0].DeleteLastLetter; end; SDLK_ESCAPE: diff --git a/unicode/src/screens/UScreenSongJumpto.pas b/unicode/src/screens/UScreenSongJumpto.pas index a8679368..17696b20 100644 --- a/unicode/src/screens/UScreenSongJumpto.pas +++ b/unicode/src/screens/UScreenSongJumpto.pas @@ -92,7 +92,7 @@ begin begin if (Interaction = 0) AND (Length(Button[0].Text[0].Text) > 0) then begin - Button[0].Text[0].DeleteLastL; + Button[0].Text[0].DeleteLastLetter; SetTextFound(CatSongs.SetFilter(Button[0].Text[0].Text, SelectType)); end; end; diff --git a/unicode/src/screens/UScreenSongMenu.pas b/unicode/src/screens/UScreenSongMenu.pas index 7aa2e498..6febdcab 100644 --- a/unicode/src/screens/UScreenSongMenu.pas +++ b/unicode/src/screens/UScreenSongMenu.pas @@ -109,7 +109,7 @@ begin case PressedKey of SDLK_BACKSPACE: begin - Button[Interaction].Text[0].DeleteLastL; + Button[Interaction].Text[0].DeleteLastLetter; exit; end; end; -- cgit v1.2.3