From e475f77c0010bcbf20c77986e6e45cc27d3a6414 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Tue, 9 Oct 2007 10:53:39 +0000 Subject: modified the unit responisble for parsing TXT files. if it encounters files called "readme.txt" or "licence.txt" then it will not produce errors / warnings, if they do not contain the required tags. this satisfies jira#USDX-130 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.01@483 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UFiles.pas | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'Game') diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas index e6982a1a..d2883cba 100644 --- a/Game/Code/Classes/UFiles.pas +++ b/Game/Code/Classes/UFiles.pas @@ -2,7 +2,10 @@ unit UFiles; interface -uses USongs, SysUtils, ULog, UMusic; +uses USongs, + SysUtils, + ULog, + UMusic; procedure InitializePaths; //Function sets All Absolute Paths eg. for Songs function ReadTXTHeader(var Song: TSong): boolean; //Reads Standard TXT Header @@ -129,12 +132,17 @@ end; //-------------------- function ReadTXTHeader(var Song: TSong): boolean; var -Line, Identifier, Value: String; -Temp: word; -Done: byte; + Line, Identifier, Value: String; + Temp: word; + Done: byte; + lWarnIfTagsNotFound : Boolean; begin Result := true; + lWarnIfTagsNotFound := ( lowercase( Song.Filename ) <> 'license.txt' ) AND + ( lowercase( Song.Filename ) <> 'readme.txt' ) ; + + //Read first Line ReadLn (SongFile, Line); @@ -324,7 +332,12 @@ begin else begin Result := False; - Log.LogError('File Incomplete or not Ultrastar TxT: ' + Song.FileName); + + if lWarnIfTagsNotFound then + begin + Log.LogError('File Incomplete or not Ultrastar TxT: ' + Song.FileName); + end; + break; end; @@ -334,7 +347,8 @@ begin end; //Check if all Required Values are given - if (Done <> 15) then + if (Done <> 15) AND + lWarnIfTagsNotFound then begin Result := False; if (Done and 8) = 0 then //No BPM Flag -- cgit v1.2.3