aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/USongs.pas25
1 files changed, 19 insertions, 6 deletions
diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas
index a1ab86f9..fb423ff7 100644
--- a/Game/Code/Classes/USongs.pas
+++ b/Game/Code/Classes/USongs.pas
@@ -696,22 +696,35 @@ begin
end;
//Wrong song selected when tabs on bug End
+(**
+ * Returns the number of visible songs.
+ *)
function TCatSongs.VisibleSongs: integer;
var
- S: integer; // song
+ SongIndex: integer;
begin
Result := 0;
- for S := 0 to high(CatSongs.Song) do
- if CatSongs.Song[S].Visible = true then Inc(Result);
+ for SongIndex := 0 to High(CatSongs.Song) do
+ begin
+ if (CatSongs.Song[SongIndex].Visible) then
+ Inc(Result);
+ end;
end;
+(**
+ * Returns the index of a song in the subset of all visible songs.
+ * If all songs are visible, the result will be equal to the Index parameter.
+ *)
function TCatSongs.VisibleIndex(Index: integer): integer;
var
- S: integer; // song
+ SongIndex: integer;
begin
Result := 0;
- for S := 0 to Index-1 do
- if CatSongs.Song[S].Visible = true then Inc(Result);
+ for SongIndex := 0 to Index-1 do
+ begin
+ if (CatSongs.Song[SongIndex].Visible) then
+ Inc(Result);
+ end;
end;
function TCatSongs.SetFilter(FilterStr: string; const fType: Byte): Cardinal;