- Changed profile, preset, locations and radar cache path to the user directory (fixes #50)

This commit is contained in:
2009-12-09 00:19:45 +01:00
parent 1759e0763c
commit 3df7b446f5
6 changed files with 320 additions and 306 deletions

View File

@@ -275,6 +275,7 @@ type
protected
{ Members }
FAppDir: String;
FConfigDir: String;
FX: Integer;
FY: Integer;
FDrawDistance: Integer;
@@ -821,6 +822,8 @@ var
searchRec: TSearchRec;
begin
FAppDir := IncludeTrailingPathDelimiter(ExtractFilePath(Application.ExeName));
FConfigDir := GetAppConfigDir(False);
ForceDirectories(FConfigDir);
FLandscape := ResMan.Landscape;
FLandscape.OnChange := @OnLandscapeChanged;
@@ -850,7 +853,7 @@ begin
vstChat.NodeDataSize := SizeOf(TChatInfo);
pnlChatHeader.AnchorSide[akBottom].Control := pnlBottom;
FLocationsFile := FAppDir + 'Locations.dat';
FLocationsFile := FConfigDir + 'Locations.dat';
vstLocations.NodeDataSize := SizeOf(TLocationInfo);
try
if FileExists(FLocationsFile) then
@@ -879,7 +882,7 @@ begin
FVirtualTiles := TWorldItemList.Create(True);
FUndoList := TPacketList.Create(True);
FRandomPresetLocation := FAppDir + 'RandomPresets' + PathDelim;
FRandomPresetLocation := FConfigDir + 'RandomPresets' + PathDelim;
if not DirectoryExists(FRandomPresetLocation) then
CreateDir(FRandomPresetLocation);