From fffb5a40133622131d7077f1d8842c2c6b7b51ad Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Sat, 20 Nov 2010 10:40:00 +0000 Subject: - hide lyrics also by pressing N - support for more than one song folder - added track number in error.log for duet songs - fixed sorting by title and artist: sort by artist or title first - added more text messages in editor - copy and move lines between tracks in duet songs is possible again - adjust player number in screenname - don't show possible scores in party modes (collidates with some plugins) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2743 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UIni.pas | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'Game/Code/Classes/UIni.pas') diff --git a/Game/Code/Classes/UIni.pas b/Game/Code/Classes/UIni.pas index d3f912d9..56306ba2 100644 --- a/Game/Code/Classes/UIni.pas +++ b/Game/Code/Classes/UIni.pas @@ -214,6 +214,8 @@ var Modes: PPSDL_Rect; SR: TSearchRec; //Skin List Patch found: boolean; + txt: string; + num: integer; function GetFileName (S: String):String; begin @@ -668,9 +670,29 @@ begin // SongPath if (Params.SongPath <> '') then - SongPath := IncludeTrailingPathDelimiter(Params.SongPath) + SongPaths[0] := IncludeTrailingPathDelimiter(Params.SongPath) else - SongPath := IncludeTrailingPathDelimiter(IniFile.ReadString('Path', 'Songs', SongPath)); + begin + txt := IniFile.ReadString('Path', 'Songs', ' '); + if (DirectoryExists(txt)) then + begin + num := Length(SongPaths); + SetLength(SongPaths, num+1); + SongPaths[num] := IncludeTrailingPathDelimiter(txt); + end; + + I := 1; + repeat + txt := IniFile.ReadString('Directories', 'SongDir'+IntToStr(I), ' '); + if (DirectoryExists(txt)) then + begin + num := Length(SongPaths); + SetLength(SongPaths, num+1); + SongPaths[num] := IncludeTrailingPathDelimiter(txt); + Inc(I); + end; + until (not DirectoryExists(txt)); + end; Filename := IniFile.FileName; IniFile.Free; @@ -928,6 +950,12 @@ begin Tekst := ILogSession[Ini.LogSession]; IniFile.WriteString('Advanced', 'LogSession', Tekst); + // Directories (add a template if section is missing, from 1.1) + if (not IniFile.SectionExists('Path')) then + IniFile.WriteString('Path', 'Songs', ' '); + if (not IniFile.SectionExists('Directories')) then + IniFile.WriteString('Directories', 'SongDir1', ' '); + IniFile.Free; end; end; -- cgit v1.2.3