aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens/UScreenSongMenu.pas
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens/UScreenSongMenu.pas')
-rw-r--r--src/screens/UScreenSongMenu.pas39
1 files changed, 21 insertions, 18 deletions
diff --git a/src/screens/UScreenSongMenu.pas b/src/screens/UScreenSongMenu.pas
index 0af94a8f..ec893c7a 100644
--- a/src/screens/UScreenSongMenu.pas
+++ b/src/screens/UScreenSongMenu.pas
@@ -50,8 +50,8 @@ type
Visible: boolean; // whether the menu should be drawn
constructor Create; override;
- function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override;
- procedure onShow; override;
+ function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override;
+ procedure OnShow; override;
function Draw: boolean; override;
procedure MenuShow(sMenu: byte);
procedure HandleReturn;
@@ -73,7 +73,7 @@ const
SM_Party_Joker = 128 or 2;
var
- ISelections: array of string;
+ ISelections: array of UTF8String;
SelectValue: integer;
implementation
@@ -86,9 +86,10 @@ uses
ULanguage,
UParty,
UPlaylist,
- USongs;
+ USongs,
+ UUnicodeUtils;
-function TScreenSongMenu.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean;
+function TScreenSongMenu.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean;
begin
Result := true;
if (PressedDown) then
@@ -96,27 +97,29 @@ begin
if (CurMenu = SM_Playlist_New) and (Interaction=0) then
begin
// check normal keys
- case WideCharUpperCase(CharCode)[1] of
- '0'..'9', 'A'..'Z', ' ', '-', '_', '!', ',', '<', '/', '*', '?', '''', '"':
- begin
- Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text + CharCode;
- exit;
- end;
+ if IsAlphaNumericChar(CharCode) or
+ (CharCode in [Ord(' '), Ord('-'), Ord('_'), Ord('!'),
+ Ord(','), Ord('<'), Ord('/'), Ord('*'),
+ Ord('?'), Ord(''''), Ord('"')]) then
+ begin
+ Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text +
+ UCS4ToUTF8String(CharCode);
+ exit;
end;
// check special keys
case PressedKey of
SDLK_BACKSPACE:
begin
- Button[Interaction].Text[0].DeleteLastL;
+ Button[Interaction].Text[0].DeleteLastLetter;
exit;
end;
end;
end;
// check normal keys
- case WideCharUpperCase(CharCode)[1] of
- 'Q':
+ case UCS4UpperCase(CharCode) of
+ Ord('Q'):
begin
Result := false;
Exit;
@@ -223,7 +226,7 @@ begin
Result := inherited Draw;
end;
-procedure TScreenSongMenu.onShow;
+procedure TScreenSongMenu.OnShow;
begin
inherited;
end;
@@ -405,9 +408,9 @@ begin
Button[3].Visible := true;
SelectsS[0].Visible := false;
- Button[0].Text[0].Text := string(PartySession.Teams.Teaminfo[0].Name);
- Button[1].Text[0].Text := string(PartySession.Teams.Teaminfo[1].Name);
- Button[2].Text[0].Text := string(PartySession.Teams.Teaminfo[2].Name);
+ Button[0].Text[0].Text := UTF8String(PartySession.Teams.Teaminfo[0].Name);
+ Button[1].Text[0].Text := UTF8String(PartySession.Teams.Teaminfo[1].Name);
+ Button[2].Text[0].Text := UTF8String(PartySession.Teams.Teaminfo[2].Name);
Button[3].Text[0].Text := Language.Translate('SONG_MENU_CANCEL');
// set right interaction