From d808dde8310ecfd659d36bfe1ba77e76ea43b6c0 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 20 Dec 2007 22:53:06 +0000 Subject: added -localpaths command line switch so we dont always have to use the packaged locations. ( profox ) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@737 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UCommandLine.pas | 5 ++++- Game/Code/Classes/UPlatformLinux.pas | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Classes/UCommandLine.pas b/Game/Code/Classes/UCommandLine.pas index e99ee37a..86f822a4 100644 --- a/Game/Code/Classes/UCommandLine.pas +++ b/Game/Code/Classes/UCommandLine.pas @@ -56,6 +56,7 @@ var const cHelp = 'help'; cMediaInterfaces = 'showinterfaces'; + cUseLocalPaths = 'localpaths'; implementation @@ -93,7 +94,9 @@ begin writeln( '' ); writeln( ' '+s( 'Switch' ) +' : Purpose' ); writeln( ' ----------------------------------------------------------' ); - writeln( ' '+s( cMediaInterfaces ) + ' : Show in-use media interfaces' ); + writeln( ' '+s( cMediaInterfaces ) + #9 + ' : Show in-use media interfaces' ); + writeln( ' '+s( cUseLocalPaths ) + #9 + ' : Use relative paths' ); + writeln( '' ); halt; diff --git a/Game/Code/Classes/UPlatformLinux.pas b/Game/Code/Classes/UPlatformLinux.pas index 03e04560..0098baee 100644 --- a/Game/Code/Classes/UPlatformLinux.pas +++ b/Game/Code/Classes/UPlatformLinux.pas @@ -27,6 +27,7 @@ implementation uses libc, + uCommandLine, {$IFNDEF FPC_V220} oldlinux, {$ELSE} @@ -123,17 +124,26 @@ end; function TPlatformLinux.GetLogPath : WideString; begin - result := '/var/log/UltraStarDeluxe/'; + if FindCmdLineSwitch( cUseLocalPaths ) then + result := inherited + else + result := '/var/log/UltraStarDeluxe/'; end; function TPlatformLinux.GetGameSharedPath : WideString; begin - result := '/usr/share/UltraStarDeluxe/'; + if FindCmdLineSwitch( cUseLocalPaths ) then + result := inherited + else + result := '/usr/share/UltraStarDeluxe/'; end; function TPlatformLinux.GetGameUserPath : WideString; begin - result := get_homedir()+'/.UltraStarDeluxe/'; + if FindCmdLineSwitch( cUseLocalPaths ) then + result := inherited + else + result := get_homedir()+'/.UltraStarDeluxe/'; end; function TPlatformLinux.get_homedir(): string; -- cgit v1.2.3