- refactoring to the current addon specification
- usage documentation
@ -8,34 +8,15 @@ var main = func( addon ) {
|
||||
var my_addon_id = "com.slawekmikula.flightgear.VfrNavigator";
|
||||
var my_version = getprop("/addons/by-id/" ~ my_addon_id ~ "/version");
|
||||
var my_root_path = getprop("/addons/by-id/" ~ my_addon_id ~ "/path");
|
||||
var my_settings_root_path = "/addons/by-id/" ~ my_addon_id ~ "/addon-devel/";
|
||||
|
||||
var dialogs = ["vfrmap-settings", "vfrmap", "vfrstarter", "vfrtable"];
|
||||
|
||||
forindex (var i; dialogs) {
|
||||
gui.Dialog.new("/sim/gui/dialogs/" ~ dialogs[i] ~ "/dialog", my_root_path ~ "/gui/" ~ dialogs[i] ~ ".xml");
|
||||
}
|
||||
|
||||
var data = {
|
||||
label : "VFR Starter",
|
||||
name : "vfrstarter",
|
||||
binding : { command : "dialog-show", "dialog-name" : "vfrstarter" },
|
||||
enabled : "true",
|
||||
};
|
||||
|
||||
foreach(var item; props.getNode("/sim/menubar/default/menu[2]").getChildren("item")) {
|
||||
if (item.getValue("name") == "vfrstarter") {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
props.globals.getNode("/sim/menubar/default/menu[2]").addChild("item").setValues(data);
|
||||
|
||||
fgcommand("gui-redraw");
|
||||
# persistent save of enable flag
|
||||
props.globals.getNode(my_settings_root_path ~ "/showvfrstarter", 1).setAttribute("userarchive", "y");
|
||||
|
||||
var fdm_init_listener = _setlistener("/sim/signals/fdm-initialized", func {
|
||||
removelistener(fdm_init_listener);
|
||||
|
||||
if (getprop("/addons/by-id/" ~ my_addon_id ~ "/showvfrstarter") == 1) {
|
||||
if (getprop(my_settings_root_path ~ "/showvfrstarter") == 1) {
|
||||
gui.showDialog("vfrstarter");
|
||||
}
|
||||
});
|
||||
@ -43,7 +24,7 @@ var main = func( addon ) {
|
||||
var reinit_listener = _setlistener("/sim/signals/reinit", func {
|
||||
removelistener(reinit_listener);
|
||||
|
||||
if (getprop("/addons/by-id/" ~ my_addon_id ~ "/showvfrstarter") == 1) {
|
||||
if (getprop(my_settings_root_path ~ "/showvfrstarter") == 1) {
|
||||
gui.showDialog("vfrstarter");
|
||||
}
|
||||
});
|
||||
|
22
addon-menubar-items.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<PropertyList>
|
||||
<meta>
|
||||
<file-type type="string">FlightGear add-on menu bar items</file-type>
|
||||
<format-version type="int">1</format-version>
|
||||
</meta>
|
||||
|
||||
<menubar-items>
|
||||
<menu>
|
||||
<label>Add-on</label>
|
||||
<enabled type="bool">true</enabled>
|
||||
|
||||
<item>
|
||||
<label>VFR Starter</label>
|
||||
<binding>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>vfrstarter</dialog-name>
|
||||
</binding>
|
||||
</item>
|
||||
</menu>
|
||||
</menubar-items>
|
||||
</PropertyList>
|
@ -9,7 +9,7 @@
|
||||
<addon>
|
||||
<identifier type="string">com.slawekmikula.flightgear.VfrNavigator</identifier>
|
||||
<name type="string">VFR Navigator</name>
|
||||
<version type="string">1.0.0</version>
|
||||
<version type="string">1.1.0</version>
|
||||
|
||||
<authors>
|
||||
<author>
|
||||
|
BIN
doc/screens/vfr_flightplan.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
doc/screens/vfr_mainmenu.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 1009 KiB After Width: | Height: | Size: 1009 KiB |
Before Width: | Height: | Size: 871 KiB After Width: | Height: | Size: 871 KiB |
BIN
doc/screens/vfr_quickmenu.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
doc/screens/vfr_smallmap.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
doc/screens/vfr_smallmap_settings.png
Normal file
After Width: | Height: | Size: 15 KiB |
50
doc/usage.md
Normal file
@ -0,0 +1,50 @@
|
||||
|
||||
# Add-on usage
|
||||
|
||||
![alt quickmenu](screens/vfr_overview2.png "Overview")
|
||||
|
||||
# General interface
|
||||
|
||||
![alt quickmenu](screens/vfr_mainmenu.png "Main menu ")
|
||||
|
||||
![alt quickmenu](screens/vfr_quickmenu.png "Quick Menu")
|
||||
|
||||
* **MP** - Small Map
|
||||
* **PL** - Flight Plan
|
||||
* **SW** - Stopwatch
|
||||
* **R** - Radio interface
|
||||
* **A** - ATC in range
|
||||
* **RM** - Route Manager
|
||||
* **X** -
|
||||
|
||||
* MP - map - small map in lower left corner with route navigation, access to configuration (config button), zoom settings (buttons +/-) and quick action center on the aircraft (C button). On the bottom you can see information about current waypoint name, bearing (B), distance (D), ETA and wind direction/speed (W).
|
||||
* PL - flightplan - in upper left corner
|
||||
* SW - stopwatch
|
||||
* R - radio panel
|
||||
* A - ATC in ranges search
|
||||
* RM - route manager activation
|
||||
|
||||
|
||||
# Small map
|
||||
|
||||
![alt quickmenu](screens/vfr_smallmap.png "Small map")
|
||||
|
||||
|
||||
**Waypoint | Bearing | Distance | ETA | Wind DIRECTION/STRENGHT**
|
||||
|
||||
|
||||
* **CONFIG** -
|
||||
* **-/+** -
|
||||
* **C** -
|
||||
* **X** -
|
||||
|
||||
![alt quickmenu](screens/vfr_smallmap_settings.png "Small map - settings")
|
||||
|
||||
# Flightplan
|
||||
|
||||
![alt quickmenu](screens/vfr_flightplan.png "Flight plan")
|
||||
|
||||
# Stopwatch/Radio Interface/ATC in Range/Route Manager
|
||||
|
||||
|
||||
# Support/Development
|
@ -15,11 +15,11 @@
|
||||
|
||||
<nasal>
|
||||
<open>
|
||||
setprop("/addons/by-id/com.slawekmikula.flightgear.VfrNavigator/showvfrstarter", 1);
|
||||
setprop("/addons/by-id/com.slawekmikula.flightgear.VfrNavigator/addon-devel/showvfrstarter", 1);
|
||||
</open>
|
||||
|
||||
<close>
|
||||
setprop("/addons/by-id/com.slawekmikula.flightgear.VfrNavigator/showvfrstarter", 0);
|
||||
setprop("/addons/by-id/com.slawekmikula.flightgear.VfrNavigator/addon-devel/showvfrstarter", 0);
|
||||
</close>
|
||||
</nasal>
|
||||
|
32
readme.md
@ -1,37 +1,37 @@
|
||||
# About
|
||||
|
||||
Flightgear VFR flight helper. Mostly helps with VFR flights offering map, route manager interface and helpers to get quickly to most common settings
|
||||
Flightgear VFR flight helper. Helps with VFR flights by offering simplified map,
|
||||
route manager interface and helpers to get quickly to most common settings.
|
||||
|
||||
# Running
|
||||
|
||||
- extract zip (if downloaded as a zip) to a given location. For example let's say we have /myfolder/addons/vfrnavigator with contents of the navigator addon.
|
||||
- run flightgear with --addon directive. WARNING this is not "additional settings" window in the launcher ! you have to modify windows shortcut or linux startup script for example to looks like this (in linux):
|
||||
* extract zip (if downloaded as a zip) to a given location. For example
|
||||
let's say we have /myfolder/addons/vfrnavigator with contents of the navigator
|
||||
addon.
|
||||
* run flightgear with --addon directive as in the example below or use Launcher
|
||||
and go to "Add-Ons" section. There add this addon folder to Add-Ons and enable
|
||||
it (checkbox at the line of the addon).
|
||||
|
||||
Code:
|
||||
```
|
||||
./fgbin/bin/fgfs --fg-root=./fgdata --launcher --prop:/sim/fg-home=/myfolder/flightgear/fghome --addon="/myfolder/addons/vfrnavigator"
|
||||
fgfs --fg-root=./fgdata --launcher --prop:/sim/fg-home=/myfolder/flightgear/fghome --addon="/myfolder/addons/vfrnavigator"
|
||||
```
|
||||
|
||||
# Running
|
||||
|
||||
In main menu Position -> VFR Starter. When activated small window will appear in the upper right corner with links to most common used functions:
|
||||
|
||||
* MP - map - small map in lower left corner with route navigation, access to configuration (config button), zoom settings (buttons +/-) and quick action center on the aircraft (C button). On the bottom you can see information about current waypoint name, bearing (B), distance (D), ETA and wind direction/speed (W).
|
||||
* PL - flightplan - in upper left corner
|
||||
* SW - stopwatch
|
||||
* R - radio panel
|
||||
* A - ATC in ranges search
|
||||
* RM - route manager activation
|
||||
|
||||
In main menu Position -> VFR Starter. When activated small window will appear
|
||||
in the upper right corner with links to most common used functions. More info
|
||||
in the document `usage` in the doc folder.
|
||||
|
||||
# History
|
||||
|
||||
- 1.0.0 - first public version on github
|
||||
|
||||
* 1.0.0 - first public version on github
|
||||
* 1.1.0 - structure and initialization changes according to add-ons API manual,
|
||||
usage documentation
|
||||
|
||||
# Authors
|
||||
|
||||
- Slawek Mikula - source code
|
||||
* Slawek Mikula - source code
|
||||
|
||||
# Links
|
||||
|
||||
|