aboutsummaryrefslogtreecommitdiffstats
path: root/Lua/src/screens/UScreenStatDetail.pas
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Lua/src/screens/UScreenStatDetail.pas62
1 files changed, 33 insertions, 29 deletions
diff --git a/Lua/src/screens/UScreenStatDetail.pas b/Lua/src/screens/UScreenStatDetail.pas
index 20b89b33..1638cd85 100644
--- a/Lua/src/screens/UScreenStatDetail.pas
+++ b/Lua/src/screens/UScreenStatDetail.pas
@@ -47,40 +47,40 @@ type
TScreenStatDetail = class(TMenu)
public
Typ: TStatType;
- Page: Cardinal;
- Count: Byte;
- Reversed: Boolean;
-
- TotEntrys: Cardinal;
- TotPages: Cardinal;
+ Page: cardinal;
+ Count: byte;
+ Reversed: boolean;
+ TotEntrys: cardinal;
+ TotPages: cardinal;
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;
procedure SetAnimationProgress(Progress: real); override;
procedure SetTitle;
- Procedure SetPage(NewPage: Cardinal);
+ Procedure SetPage(NewPage: cardinal);
end;
implementation
uses
- UGraphic,
- ULanguage,
Math,
Classes,
- ULog;
+ UGraphic,
+ ULanguage,
+ ULog,
+ UUnicodeUtils;
-function TScreenStatDetail.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
+function TScreenStatDetail.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean;
begin
Result := true;
- If (PressedDown) Then
+ if (PressedDown) then
begin // Key Down
// check normal keys
- case WideCharUpperCase(CharCode)[1] of
- 'Q':
+ case UCS4UpperCase(CharCode) of
+ Ord('Q'):
begin
Result := false;
Exit;
@@ -97,24 +97,28 @@ begin
end;
SDLK_RETURN:
begin
- if Interaction = 0 then begin
+ if Interaction = 0 then
+ begin
//Next Page
SetPage(Page+1);
end;
- if Interaction = 1 then begin
+ if Interaction = 1 then
+ begin
//Previous Page
if (Page > 0) then
SetPage(Page-1);
end;
- if Interaction = 2 then begin
+ if Interaction = 2 then
+ begin
//Reverse Order
Reversed := not Reversed;
SetPage(Page);
end;
- if Interaction = 3 then begin
+ if Interaction = 3 then
+ begin
AudioPlayback.PlaySound(SoundLib.Back);
FadeTo(@ScreenStatMain);
end;
@@ -175,7 +179,7 @@ begin
Typ := TStatType(0);
end;
-procedure TScreenStatDetail.onShow;
+procedure TScreenStatDetail.OnShow;
begin
inherited;
@@ -187,7 +191,7 @@ begin
SetTitle;
//Show First Page
- Reversed := False;
+ Reversed := false;
SetPage(0);
end;
@@ -199,12 +203,12 @@ begin
Text[Count].Text := Theme.StatDetail.Description[Ord(Typ)];
end;
-procedure TScreenStatDetail.SetPage(NewPage: Cardinal);
+procedure TScreenStatDetail.SetPage(NewPage: cardinal);
var
StatList: TList;
- I: Integer;
- FormatStr: String;
- PerPage: Byte;
+ I: integer;
+ FormatStr: string;
+ PerPage: byte;
begin
// fetch statistics
StatList := Database.GetStats(Typ, Count, NewPage, Reversed);
@@ -230,7 +234,7 @@ begin
if (Score > 0) then
begin
Text[I].Text := Format(FormatStr,
- [Singer, Score, Theme.ILevel[Difficulty], SongArtist, SongTitle]);
+ [Singer, Score, Theme.ILevel[Difficulty], SongArtist, SongTitle, Date]);
end;
end;
end;
@@ -288,9 +292,9 @@ begin
Database.FreeStats(StatList);
end;
-
procedure TScreenStatDetail.SetAnimationProgress(Progress: real);
-var I: Integer;
+var
+ I: integer;
begin
for I := 0 to High(Button) do
Button[I].Texture.ScaleW := Progress;