[suggestion] Expanding variables in .game file
Warsow is already using ${XDG_DATA_HOME} on linux (~/.local/share/warsow-2.1/
on my computer)
Unvanquished will support that too (~/.local/share/unvanquished/
on my computer)
Also, thanks to updaters, people are able to install games within their home directory.
This is the old Quake 3 q3.game
file:
<?xml version="1.0"?>
<game
type="q3"
index="1"
name="Quake III Arena / Quake III: Team Arena"
enginepath_win32="C:/Program Files/Quake III Arena/"
enginepath_linux="/usr/local/games/quake3/"
enginepath_macos="/Applications/Quake3/"
engine_win32="quake3.exe"
engine_linux="quake3"
engine_macos="Quake3.app"
prefix=".q3a"
basegame="baseq3"
basegamename="Quake III Arena"
knowngame="missionpack"
knowngamename="Quake III: Team Arena"
unknowngamename="Custom Quake III modification"
shaderpath="scripts"
archivetypes="pk3"
texturetypes="tga jpg"
modeltypes="md3 ase lwo obj 3ds picoterrain"
maptypes="mapq3"
shaders="quake3"
entityclass="quake3"
entityclasstype="def xml"
entities="quake3"
brushtypes="quake3"
patchtypes="quake3"
/>
This the unvanquished.game
I would like to get for Unvanquished:
<?xml version="1.0" ?>
<game
type="unvanquished"
index="1"
name="Unvanquished"
enginepath_win32="%PROGRAMFILES%/Unvanquished/"
enginepath_linux="${XDG_DATA_HOME}/unvanquished/base"
enginepath_macos="/Applications/Unvanquished/"
engine_win32="daemon.exe"
engine_linux="daemon"
engine_macos="daemon.app"
homepath_win32="%CSIDL_PERSONAL%/My Games/unvanquished"
homepath_linux="${XDG_DATA_HOME}/unvanquished"
homepath_macos="/Library/Application Support/unvanquished"
basegame="pkg"
basegamename="Unvanquished"
unknowngamename="Unvanquished Mod"
shaderpath="scripts"
archivetypes="dpk"
texturetypes="tga jpg png pcx bmp"
modeltypes="md3 ase lwo obj 3ds picoterrain"
maptypes="mapq3"
shaders="quake3"
entityclass="quake3"
entityclasstype="def"
entities="quake3"
brushtypes="quake3"
patchtypes="quake3"
q3map2_type="unvanquished"
/>
<!-- forbidden_paths="unvanquished_*.dpk" -->
The idea would be to check if variable starts with %
one Windows or ${
on Linux and expand if needed (probably no need for more complex parsing).
If homepath_
is not defined for the current architecture, NetRadiant would fallback on the legacy path (the one inside Program Files on Windows, the one within ${HOME} using the legacy home
variable etc.
That's probably something I can implement, but your comments would be greatly appreciated.
The same stuff would be implementable on q3map2's side too.