From dbe444f87b85da27a37f38e80bfd540178b8dde0 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Wed, 1 Sep 2010 14:09:58 +0000 Subject: - fix: position of player 3 and 4 in 4-player-mode on one screen in singscreen - fix: scorescreen for 4-player-mode on one screen - add: tag #CALCMEDLEY:Off => disable calculation of medley for that song - add: sorting RANDOM for party-modes - add: ShuffleMode FULL (play whole file) in fullscreen if video available - add: it possible to select the 2 songs left and right of the random selected song in party mode - add: num song in in party options (in the selected folder/playlist) - fix: dont change line in editor while playing only one line - removed option solmization from lyric option screen - add: play last sung song in party score screen - added some plugins (thx to MasterPhW) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2629 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/USongs.pas | 63 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) (limited to 'Game/Code/Classes/USongs.pas') diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas index 5a579474..e669edf6 100644 --- a/Game/Code/Classes/USongs.pas +++ b/Game/Code/Classes/USongs.pas @@ -44,7 +44,9 @@ type FileName: string; isDuet: boolean; + DuetNames: array of string; Medley: TMedley; + CalcMedley: boolean; PreviewStart: real; //in seconds CustomTags: array of TCustomHeaderTag; // from 1.1 @@ -53,6 +55,7 @@ type Genre: array of string; Edition: array of string; Language: string; // 0.5.0: new + Year: string; Title: string; Artist: string; @@ -118,6 +121,7 @@ type function SetFilter(FilterStr: String; const fType: Byte): Cardinal; function NumCatSongs(Cat: integer): integer; + function NumSongs(): integer; function NumVisibleCats(): integer; end; @@ -319,6 +323,21 @@ begin SongSort[S] := TempSong; end; end; + sRandom: + begin + for S2 := 0 to Length(SongSort)-1 do + begin + for S := 1 to Length(SongSort)-1 do + begin + if (Random(2) = 0) then + begin + TempSong := SongSort[S-1]; + SongSort[S-1] := SongSort[S]; + SongSort[S] := TempSong; + end; + end; + end; + end; end; // case end; @@ -441,6 +460,7 @@ begin sArtist: Songs.Sort(sArtist); sTitle2: Songs.Sort(sTitle2); // by title2 ??? sArtist2: Songs.Sort(sArtist2); // by artist2 ??? + sRandom: Songs.Sort(sRandom); end; // case @@ -670,7 +690,32 @@ begin CatSongs.Song[CatLen].Visible := true; end; - end; + end else if (Ini.Sorting = sRandom) and + (Length(Songs.SongSort[S].Artist)>=1) and + (Letter <> 'R') then + begin + // add a letter Category Button + Inc(Order); + Letter := 'R'; + CatLen := Length(CatSongs.Song); + SetLength(CatSongs.Song, CatLen+1); + CatSongs.Song[CatLen].Artist := '[RANDOM]'; + CatSongs.Song[CatLen].Main := true; + CatSongs.Song[CatLen].OrderTyp := 0; + CatSongs.Song[CatLen].OrderNum := Order; + + CatSongs.Song[CatLen].Cover := CatCovers.GetCover(Ini.Sorting, Letter); + + //CatNumber Patch + if (Letter <> ' ') then + begin + if (CatLen - CatNumber - 1>=0) then + Song[CatLen - CatNumber - 1].CatNumber := CatNumber;//Set CatNumber of Categroy + CatNumber := 0; + end; + + CatSongs.Song[CatLen].Visible := true; + end end; CatLen := Length(CatSongs.Song); @@ -757,6 +802,22 @@ begin end; end; +function TCatSongs.NumSongs(): integer; +var + I: integer; +begin + Result := 0; + for I := 0 to Length(CatSongs.Song)-1 do + begin + if (Not CatSongs.Song[I].Main) then + begin + if ((ScreenSong.Mode<>smNormal) and (not CatSongs.Song[I].isDuet)) or + (ScreenSong.Mode=smNormal) then + inc(Result); + end; + end; +end; + function TCatSongs.NumVisibleCats(): integer; var I: integer; -- cgit v1.2.3