From 7d61a98f807803a337fd12342c29eb0f5f69fc76 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 20 Dec 2007 03:33:14 +0000 Subject: made USDX function when file paths differ from previous expectations.. ( most of the software was still using hard coded paths ) also added ability to have multiple song directories. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@735 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/USongs.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Game/Code/Classes/USongs.pas') diff --git a/Game/Code/Classes/USongs.pas b/Game/Code/Classes/USongs.pas index 3ac32dda..31db883d 100644 --- a/Game/Code/Classes/USongs.pas +++ b/Game/Code/Classes/USongs.pas @@ -265,7 +265,10 @@ begin BrowsePos := 0; // browse directories BrowseDir(SongPath); - + + if UserSongPath <> SongPath then + BrowseDir(UserSongPath); + //Set Correct SongArray Length SetLength(Song, BrowsePos); @@ -306,6 +309,7 @@ var i : Integer; Files : TDirectoryEntryArray; begin + Files := Platform.DirectoryFindFiles( Dir, '.txt', true); for i := 0 to Length(Files)-1 do begin @@ -318,7 +322,8 @@ begin SLen := BrowsePos; Song[SLen].Path := Dir; - Song[SLen].Folder := Copy(Dir, Length(SongPath)+1, 10000); +// Song[SLen].Folder := Copy(Dir, Length(SongPath)+1, 10000); + Song[SLen].Folder := Copy(Dir, Length(Dir)+1, 10000); Song[SLen].Folder := Copy(Song[SLen].Folder, 1, Pos( PathDelim , Song[SLen].Folder)-1); Song[SLen].FileName := Files[i].Name; -- cgit v1.2.3