aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-09 10:53:39 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-09 10:53:39 +0000
commite475f77c0010bcbf20c77986e6e45cc27d3a6414 (patch)
tree36d003dd01c85a10ed2d1ea7a2f11ed7bb3c3d83 /Game/Code
parentd4df85930a195250d3f4a3d315921e265f6295c2 (diff)
downloadusdx-e475f77c0010bcbf20c77986e6e45cc27d3a6414.tar.gz
usdx-e475f77c0010bcbf20c77986e6e45cc27d3a6414.tar.xz
usdx-e475f77c0010bcbf20c77986e6e45cc27d3a6414.zip
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
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UFiles.pas26
1 files changed, 20 insertions, 6 deletions
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