commit 31038b280e7ebbb0ae83dee98bf01e45ddc65f38 Author: fly Date: Fri Dec 22 20:16:13 2023 +0100 Initial commit Signed-off-by: fly diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3819313 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.swp +*.swo diff --git a/fov-persistance/addon-config.xml b/fov-persistance/addon-config.xml new file mode 100644 index 0000000..12d2ac6 --- /dev/null +++ b/fov-persistance/addon-config.xml @@ -0,0 +1,15 @@ + + + + + + + fov-persistance + 0.1 + merspieler + Maintains a given fov for a given resolution + Initial commit + + + + diff --git a/fov-persistance/addon-main.nas b/fov-persistance/addon-main.nas new file mode 100644 index 0000000..fd68505 --- /dev/null +++ b/fov-persistance/addon-main.nas @@ -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); + }); +}; diff --git a/fov-persistance/addon-metadata.xml b/fov-persistance/addon-metadata.xml new file mode 100644 index 0000000..76d6c12 --- /dev/null +++ b/fov-persistance/addon-metadata.xml @@ -0,0 +1,16 @@ + + + + FlightGear add-on metadata + 1 + + + + org.flightgear.addons.fov-persistance + fov-persistance + 0.1.0 + all + fov-persistance + fov-persistance + +