aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-11-20 13:02:32 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-11-20 13:02:32 +0000
commit9792c8c1af8dc0733e3851a2f094897590b25605 (patch)
treeff0bee074b8dd9af8bb36ef6e54abdb317a5d7e8 /Game
parentfffb5a40133622131d7077f1d8842c2c6b7b51ad (diff)
downloadusdx-9792c8c1af8dc0733e3851a2f094897590b25605.tar.gz
usdx-9792c8c1af8dc0733e3851a2f094897590b25605.tar.xz
usdx-9792c8c1af8dc0733e3851a2f094897590b25605.zip
added sorting by year (decade)
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2744 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game')
-rw-r--r--Game/Code/Classes/UFiles.pas16
-rw-r--r--Game/Code/Classes/UIni.pas3
-rw-r--r--Game/Code/Classes/USongs.pas50
-rw-r--r--Game/Code/UltraStar.dpr2
-rw-r--r--Game/Output/Changelog.german.txt8
-rw-r--r--Game/Output/Changelog.txt8
6 files changed, 74 insertions, 13 deletions
diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas
index d6ec4254..382f39ff 100644
--- a/Game/Code/Classes/UFiles.pas
+++ b/Game/Code/Classes/UFiles.pas
@@ -153,7 +153,7 @@ begin
SetLength(Song.Edition, 1);
Song.Edition[0] := 'Unknown';
Song.Language := 'Unknown'; //Language Patch
- Song.Year := '';
+ Song.Year := -1;
//Required Information
Song.Mp3 := '';
@@ -404,7 +404,15 @@ begin
//Year Sorting
else if (Identifier = 'YEAR') then
begin
- Song.Year := Value;
+ Len := -1;
+ if (Length(Value)<>4) then
+ Log.LogError('YEAR-tag does not has 4 Digits in Song: ' + Song.Path + Song.FileName)
+ else if (not TryStrtoInt(Value, Len)) then
+ Log.LogError('YEAR-tag is not a Number in Song: ' + Song.Path + Song.FileName)
+ else if (Len<1000) or (Len>9999) then
+ Log.LogError('YEAR-tag is too low or too high in Song: ' + Song.Path + Song.FileName)
+ else
+ Song.Year := Len;
end
// Song Start
@@ -499,7 +507,7 @@ begin
if lWarnIfTagsNotFound then
begin
- Log.LogError('File Incomplete or not Ultrastar TxT: ' + Song.FileName);
+ Log.LogError('File Incomplete or not Ultrastar TxT: ' + Song.Path + Song.FileName);
end;
break;
@@ -1216,7 +1224,7 @@ begin
for C := 0 to Length(Song.Genre) - 1 do
if Song.Genre[C] <> 'Unknown' then WriteLn(SongFile, '#GENRE:' + Song.Genre[C]);
- if Song.Year <> '' then WriteLn(SongFile, '#YEAR:' + Song.Year);
+ if (Song.Year <> -1) then WriteLn(SongFile, '#YEAR:' + IntToStr(Song.Year));
diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas
index 56306ba2..8323345b 100644
--- a/Game/Code/Classes/UIni.pas
+++ b/Game/Code/Classes/UIni.pas
@@ -118,7 +118,7 @@ const
IDifficulty: array[0..2] of string = ('Easy', 'Medium', 'Hard');
ITabs: array[0..1] of string = ('Off', 'On');
- ISorting: array[0..8] of string = ('Edition', 'Genre', 'Language', 'Folder', 'Title', 'Artist', 'Title2', 'Artist2', 'Random');
+ ISorting: array[0..9] of string = ('Edition', 'Genre', 'Language', 'Folder', 'Title', 'Artist', 'Title2', 'Artist2', 'Random', 'Year');
sEdition = 0;
sGenre = 1;
sLanguage = 2;
@@ -128,6 +128,7 @@ const
sTitle2 = 6;
sArtist2 = 7;
sRandom = 8;
+ sYear = 9;
IShuffleTime: array[0..10] of string = ('Off',
'15 Sec',
diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas
index 330b8a9e..f21deb69 100644
--- a/Game/Code/Classes/USongs.pas
+++ b/Game/Code/Classes/USongs.pas
@@ -55,7 +55,7 @@ type
Genre: array of string;
Edition: array of string;
Language: string; // 0.5.0: new
- Year: string;
+ Year: integer;
Title: string;
Artist: string;
@@ -180,6 +180,10 @@ begin
sRandom:
if (Random(2) = 0) then
Result := true;
+
+ sYear: //by Year
+ Result := (TempSongArr[TempIndex].Year <= Songs.SongSort[SourceIndex].Year);
+
end; // case
end;
@@ -343,13 +347,7 @@ end;
procedure TSongs.Sort(Order: integer);
var
- S: integer;
- S2: integer;
-
- I: integer;
- //TempSong: TSong;
MergeSort: TMergeSorter;
- //TempSongArr: array of TSong;
begin
@@ -385,6 +383,7 @@ var
Order: integer; // number used for ordernum
Letter2: char; //
CatNumber:integer; // Number of Song in Category
+ tempstr: string;
procedure CheckEdition(SongNr: integer);
var
@@ -511,6 +510,12 @@ begin
begin
Songs.Sort(sRandom);
end;
+ sYear:
+ begin
+ Songs.Sort(sTitle);
+ Songs.Sort(sArtist);
+ Songs.Sort(sYear);
+ end;
end; // case
Log.BenchmarkEnd(3);
@@ -767,6 +772,37 @@ begin
end;
CatSongs.Song[CatLen].Visible := true;
+ end else if (Ini.Sorting = sYear) then
+ begin
+ I := Songs.SongSort[S].Year;
+ if (I <> -1) then
+ tempstr := IntToStr(Round(I/10)*10) + '-' + IntToStr(Round(I/10)*10+9)
+ else
+ tempstr := 'undefined';
+
+ if (tempstr <> SS) then
+ begin
+ Inc(Order);
+ SS := tempstr;
+ CatLen := Length(CatSongs.Song);
+ SetLength(CatSongs.Song, CatLen+1);
+ CatSongs.Song[CatLen].Artist := SS;
+ CatSongs.Song[CatLen].Main := true;
+ CatSongs.Song[CatLen].OrderTyp := 0;
+ CatSongs.Song[CatLen].OrderNum := Order;
+
+ CatSongs.Song[CatLen].Cover := CatCovers.GetCover(Ini.Sorting, SS);
+
+ //CatNumber Patch
+ if (SS <> '') 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;
end;
diff --git a/Game/Code/UltraStar.dpr b/Game/Code/UltraStar.dpr
index 260bba40..d046d939 100644
--- a/Game/Code/UltraStar.dpr
+++ b/Game/Code/UltraStar.dpr
@@ -122,7 +122,7 @@ uses
UVideo in 'Classes\UVideo.pas';
const
- Version = 'UltraStar Deluxe Challenge, Medley & Duet Edition r9 RC7.2';
+ Version = 'UltraStar Deluxe Challenge, Medley & Duet Edition r9 RC8';
var
WndTitle: string;
diff --git a/Game/Output/Changelog.german.txt b/Game/Output/Changelog.german.txt
index 76219eb6..cf246351 100644
--- a/Game/Output/Changelog.german.txt
+++ b/Game/Output/Changelog.german.txt
@@ -1,3 +1,11 @@
+Ultrastar Deluxe Challenge, Medley & Duet Edition r9 RC8 vom 20.11.2010
+-----------------------------
+New: (Allgemein) Mehrere Song-Ordner werden unterstützt (wie bei der 1.1).
+New: (Allgemein) Die Anzahl der Spieler kann bei der Namenseingabe mit Shift+Hoch/Runter angepasst werden.
+New: (Allgemein) Sortierung nach Jahr (pro Dekade).
+Upd: (Allgemein) Mit N kann man nun auch die Lyrics ausblenden.
+Upd: (Editor) Man kann nun zwischen zwei Spuren bei Duetten hin- und herkopieren (wenn es passt).
+
Ultrastar Deluxe Challenge, Medley & Duet Edition r9 RC7.2 vom 07.11.2010
-----------------------------
New: (Allgemein) DUETT-Support! Song-Syntax wie von hawkear vorgeschlagen, allerdings auf 2 Stimmen begrenzt. Im Editor können die Lieder erstellt/geändert werden.
diff --git a/Game/Output/Changelog.txt b/Game/Output/Changelog.txt
index 438531ac..c061de00 100644
--- a/Game/Output/Changelog.txt
+++ b/Game/Output/Changelog.txt
@@ -1,3 +1,11 @@
+Ultrastar Deluxe Challenge, Medley & Duet Edition r9 RC8 (20.11.2010)
+-----------------------------
+New: (General) Support for more than one song folder (like in 1.1).
+New: (General) Adjust number of players in name screen with SHIFT+UP/DOWN.
+New: (General) Sort by Year (by decade).
+Upd: (General) Disable lyrics with "N".
+Upd: (Editor) Copy or move lines between duet tracks.
+
Ultrastar Deluxe Challenge, Medley & Duet Edition r9 RC7.2 (07.11.2010)
-----------------------------
New: (General) DUET support! Song syntax as proposed by hawkear, however, limited to 2 parts. Duet songs can be created and edited in the editor.