aboutsummaryrefslogtreecommitdiffstats
path: root/unicode/src/screens/UScreenTop5.pas
diff options
context:
space:
mode:
Diffstat (limited to 'unicode/src/screens/UScreenTop5.pas')
-rw-r--r--unicode/src/screens/UScreenTop5.pas34
1 files changed, 21 insertions, 13 deletions
diff --git a/unicode/src/screens/UScreenTop5.pas b/unicode/src/screens/UScreenTop5.pas
index eaa90ab1..2ddca8ef 100644
--- a/unicode/src/screens/UScreenTop5.pas
+++ b/unicode/src/screens/UScreenTop5.pas
@@ -57,6 +57,7 @@ type
constructor Create; override;
function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override;
+ function ParseMouse(MouseButton: integer; BtnDown: boolean; X, Y: integer): boolean; override;
procedure onShow; override;
function Draw: boolean; override;
end;
@@ -74,7 +75,7 @@ uses
function TScreenTop5.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean;
begin
Result := true;
- if (PressedDown) then
+ if PressedDown then
begin
// check normal keys
case UCS4UpperCase(CharCode) of
@@ -92,7 +93,7 @@ begin
SDLK_RETURN:
begin
if (not Fadeout) then
- begin
+ begin
FadeTo(@ScreenSong);
Fadeout := true;
end;
@@ -105,6 +106,16 @@ begin
end;
end;
+function TScreenTop5.ParseMouse(MouseButton: integer;
+ BtnDown: boolean;
+ X, Y: integer): boolean;
+begin
+ Result := true;
+ if (MouseButton = SDL_BUTTON_LEFT) and BtnDown then
+ //left-click anywhere sends return
+ ParseInput(SDLK_RETURN, #0, true);
+end;
+
constructor TScreenTop5.Create;
var
I: integer;
@@ -113,19 +124,16 @@ begin
LoadFromTheme(Theme.Top5);
-
- TextLevel := AddText(Theme.Top5.TextLevel);
+ TextLevel := AddText(Theme.Top5.TextLevel);
TextArtistTitle := AddText(Theme.Top5.TextArtistTitle);
for I := 0 to 4 do
- StaticNumber[I+1] := AddStatic( Theme.Top5.StaticNumber[I] );
-
- for I := 0 to 4 do
- TextNumber[I+1] := AddText(Theme.Top5.TextNumber[I]);
- for I := 0 to 4 do
- TextName[I+1] := AddText(Theme.Top5.TextName[I]);
- for I := 0 to 4 do
- TextScore[I+1] := AddText(Theme.Top5.TextScore[I]);
+ begin
+ StaticNumber[I+1] := AddStatic(Theme.Top5.StaticNumber[I]);
+ TextNumber[I+1] := AddText (Theme.Top5.TextNumber[I]);
+ TextName[I+1] := AddText (Theme.Top5.TextName[I]);
+ TextScore[I+1] := AddText (Theme.Top5.TextScore[I]);
+ end;
end;
@@ -162,7 +170,7 @@ begin
Text[TextScore[I]].Text := IntToStr(CurrentSong.Score[Ini.Difficulty, I-1].Score);
end;
- for I := Length(CurrentSong.Score[Ini.Difficulty])+1 to 5 do
+ for I := Length(CurrentSong.Score[Ini.Difficulty]) + 1 to 5 do
begin
Static[StaticNumber[I]].Visible := false;
Text[TextNumber[I]].Visible := false;