1
0
Fork 0

Merge branch 'master' of gitorious.org:fg/fgdata

This commit is contained in:
BARANGER Emmanuel 2013-10-07 10:53:29 +02:00
commit aa1f98a2f9
2 changed files with 14 additions and 24 deletions

View file

@ -159,8 +159,8 @@
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>transponder-sqwak</tooltip-id>
<label>Sqwak: %s</label>
<tooltip-id>transponder-squawk</tooltip-id>
<label>Squawk: %s</label>
<property>instrumentation/transponder/id-code</property>
<mapping>nasal</mapping>
<script>
@ -225,8 +225,8 @@
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>transponder-sqwak</tooltip-id>
<label>Sqwak: %s</label>
<tooltip-id>transponder-squawk</tooltip-id>
<label>Squawk: %s</label>
<property>instrumentation/transponder/id-code</property>
<mapping>nasal</mapping>
<script>
@ -291,8 +291,8 @@
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>transponder-sqwak</tooltip-id>
<label>Sqwak: %s</label>
<tooltip-id>transponder-squawk</tooltip-id>
<label>Squawk: %s</label>
<property>instrumentation/transponder/id-code</property>
<mapping>nasal</mapping>
<script>
@ -357,8 +357,8 @@
<hovered>
<binding>
<command>set-tooltip</command>
<tooltip-id>transponder-sqwak</tooltip-id>
<label>Sqwak: %s</label>
<tooltip-id>transponder-squawk</tooltip-id>
<label>Squawk: %s</label>
<property>instrumentation/transponder/id-code</property>
<mapping>nasal</mapping>
<script>

View file

@ -14,6 +14,12 @@ var parsesvg = func(group, path, options = nil)
if( typeof(options) != "hash" )
die("Options need to be of type hash!");
# resolve paths using standard SimGear logic
var file_path = resolvepath(path);
if (file_path == "")
die("File not found: "~path);
path = file_path;
var custom_font_mapper = options['font-mapper'];
var font_mapper = func(family, weight)
{
@ -573,22 +579,6 @@ var parsesvg = func(group, path, options = nil)
}
};
# check path relative to standard locations
foreach(
var p;
[ "", # absolute path
getprop("/sim/aircraft-dir") ~ "/", # current aircraft path
getprop("/sim/fg-root") ~ "/" # fgdata
])
{
var tmp_path = p ~ path;
if( io.stat(tmp_path) != nil )
{
path = tmp_path;
break;
}
}
call(func parsexml(path, start, end, data), nil, var err = []);
if( size(err) )
{