Initial commit

Signed-off-by: fly <merspieler@alwaysdata.com>
This commit is contained in:
fly 2023-12-22 20:16:13 +01:00
commit 31038b280e
4 changed files with 65 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.swp
*.swo

View 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>

View 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);
});
};

View 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>