Initial commit
Signed-off-by: fly <merspieler@alwaysdata.com>
This commit is contained in:
commit
31038b280e
4 changed files with 65 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*.swp
|
||||
*.swo
|
15
fov-persistance/addon-config.xml
Normal file
15
fov-persistance/addon-config.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
<sim>
|
||||
<addons>
|
||||
<tile-printer>
|
||||
<name>fov-persistance</name>
|
||||
<version type= "double">0.1</version>
|
||||
<authors>merspieler</authors>
|
||||
<description>Maintains a given fov for a given resolution</description>
|
||||
<changelog>Initial commit</changelog>
|
||||
</tile-printer>
|
||||
</addons>
|
||||
</sim>
|
||||
</PropertyList>
|
32
fov-persistance/addon-main.nas
Normal file
32
fov-persistance/addon-main.nas
Normal file
|
@ -0,0 +1,32 @@
|
|||
last_tile = "";
|
||||
|
||||
var updateFOV = func()
|
||||
{
|
||||
if (getprop("/sim/gui/canvas/size[0]") == 5760)
|
||||
{
|
||||
setprop("/sim/current-view/field-of-view", 120);
|
||||
}
|
||||
else
|
||||
{
|
||||
setprop("/sim/current-view/field-of-view", getprop("/sim/current-view/config/default-field-of-view-deg"));
|
||||
}
|
||||
};
|
||||
|
||||
var main = func (root)
|
||||
{
|
||||
var fdm_init = setlistener("/sim/signals/fdm-initialized", func
|
||||
{
|
||||
setlistener("/sim/gui/canvas/size[0]", func
|
||||
{
|
||||
updateFOV();
|
||||
}, 0, 0);
|
||||
setlistener("/sim/current-view/name", func
|
||||
{
|
||||
updateFOV();
|
||||
}, 0, 0);
|
||||
setlistener("/sim/current-view/config/default-field-of-view-deg", func
|
||||
{
|
||||
updateFOV();
|
||||
}, 0, 0);
|
||||
});
|
||||
};
|
16
fov-persistance/addon-metadata.xml
Normal file
16
fov-persistance/addon-metadata.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<PropertyList>
|
||||
<meta>
|
||||
<file-type type="string">FlightGear add-on metadata</file-type>
|
||||
<format-version type="int">1</format-version>
|
||||
</meta>
|
||||
|
||||
<addon>
|
||||
<identifier type="string">org.flightgear.addons.fov-persistance</identifier>
|
||||
<name type="string">fov-persistance</name>
|
||||
<version type="string">0.1.0</version>
|
||||
<platform>all</platform>
|
||||
<summary lang="en">fov-persistance</summary>
|
||||
<description lang="en">fov-persistance</description>
|
||||
</addon>
|
||||
</PropertyList>
|
Loading…
Reference in a new issue