If the property has a valid value already, then the given value is ignored.
var x = props.initNode("/foo", 10);
var y = props.initNode("/bar", 1, "BOOL");
debug.dump([a, b]) for that, but debug.dump(a, b) is more obvious)
- change output colors: variable names are no longer bold, all property
attributes are now blue, not just the property type)
- drop redundant braces & other cosmetics
and path strings into a list of props.Nodes. It also digests lists of
properties, or lists of lists of properties etc., thus allowing things
like props.nodeList(arg), props.nodeList(n.getChildren("foo")). This is
meant for functions like aircraft.data.add() or screen.display.add().
- remove some redundant braces
- fix comment
- don't use screen.window, but let it do its own dialog handling. Thereby
- make it faster (update every frame by default)
- prevent collisions with the menu
- allow to move the dialog away (only the left edge is draggable!)
- try color white (better color suggestions welcome :-)
- new parameter naming (left/right instead of min/max; signs are ignored)
- fix wrap-around skips
- use regular constructor so as not to confuse people ;-)
If a <view> contains a <limits> block, then a view handler gets attached to
it, which limits head turns to a given range, whereby headings beyond a given
threshold cause an additional sideways movement. This is turned off by default
for now.
livery_update class and add an optional third argument to its constructor:
a callback function that's called whenever the class noticed a livery
change
- Update redout level every frame
- Replace reading of properties every iteration with listeners
- move -onset and -complete properties into a parameters subtree
are set in controls.nas since ages)
controls.nas: avoid repeated querying of /sim/input/selected/engine[*]
properties; this isn't supposed to change at runtime and is a rather
costly process, especially in axis handlers
- rename prop-key-handler.nas to prop_key_handler.nas (the hyphens were
intentional, exactly to *make* using it as namespace less inviting,
but times change ...)
- add property browser binding to the '/'-key for when the property key handler
is turned off (/sim/input/property-key-handler=0). If it's on, use /: or
/<property>: to open the browser.
- run keyboard event listener only when property key handler is active
I hope that the '/' key can keep this binding even after a keyboard review.
The '/' is just the most natural key for dealing with properties, and it's
far less prominent on non-US-keyboards (e.g. Shift-7 on German keyboards),
so it's not really very well suited for important aircraft functions, anyway.
But I don't insist. :-)
These are then skipped with view.stepView(n), unless the second, optional
argument is set to 1: view.stepView(n, 1);
Whether a view is enabled or not, is saved in $FG_ROOT/.fgfs/autosave.xml
(system views) or $FG_ROOT/.fgfs/aircraft-data/<aircraft>.xml
I tried it the nice way, but it didn't work. Why is it important to
reserve indices for fgfs? Because someone has otherwise to go through
all aircraft in CVS and move aircraft specific views out of the way,
every time a system view gets added. Been there, done that.
- allow turning on/off extra widgets for developers (HUD dialog: colors,
rendering dialog: visualization of shadow edges), and to turn on/off new
- property key handler ('/'-key)
Both features are off by default, and their state is saved to autosave.xml.
the property attribute string, as in:
(NONE, L1, #8345)
... for a node of type "NONE", with one listener attached, and 8345 instances
of the shared pointer around.
- use more "var" keywords and named args
- popupTip(): add optional third hash argument that is merged with the
dialog properies hash. This can be used to select different font or
dialog colors, etc.
/sim/current-view/dynamic-view. There are additionally <dynamic-view>
settings per view, but those only enable it for that view if it's
globally turned on.
it and the description doesn't match any more. :-}
Number of frames makes more sense than seconds (default = 1):
debug.proptrace([<property> [, <number_of_frames>]]);
writes (not directly written tied ones), all node additions and removal.
Frames are separated with a line. Turn off ANSI coloring if you want to
pipe the results into a file: --prop:sim/startup/terminal-ansi-colors=0
a regular function argument for that. Note the "n" in this example:
setlistener("/sim/current-view/view-number", func(n) {
setprop("/sim/hud/visibility", !n.getValue());
}, 1);
code that is called from outside. It will be removed from the global namespace
once it has done its job. For now it only selects a proper runway for wind
directions reported by METAR, but only, of course, if an airport was chosen,
but no runway and no heading, and if the aircraft is actually on ground.
from its property tree. The node remains accessible as long as references
to it are kept. Example:
var cow_chain = func {
var cow = geo.put_model("Models/Fauna/cow.ac", geo.aircraft_position());
settimer(func { cow.remove() }, 10);
settimer(cow_chain, 2);
}
cow_chain();
the $FG_ROOT/Nasal/*.nas ones are done. This allows to use props.Node etc.
immediately, without requirement for settimer(func{}, 0) constructions.
Rationale:
- clean separation of local additions (and hacks :-) from standard files
- users might not have write permission to $FG_ROOT/Nasal/ or shouldn't
have to su to root for writing Nasal code
- Page up/down changes the selected throttles one step up/down, i.e.
if the original throttle settings were x steps apart they remain
steps apart (unless the boundary is reached).
- Mouse + MMB drag changes the selected throttles by the delta amount
(length of drag).
- The throttleAxis() wrapper for joysticks sets the selected
throttles to correspond to the joystick's axis position. I.e. all
selected engines will get the same throttle setting. Since most
joystick throttles are positional devices I think this behaviour
is more logical than using a relative adjustment in this case. """
mf: slightly modified, added var etc. (more such changes in controls.nas
to come)
- move "fire starter" from SPACE-key to s-key
- move "open property browser" from Shift-SPACE to Shift-Enter (Shift-Return)
- implement PTT on SPACE/Shift-SPACE (with the other six SPACE/modifier
combinations unused, apart from a popup)
- add controls.ptt(v) wrapper function (v can be 1 or 2 for on, and 0 for off)
Easter-Egg:
- pressing the t-key for at least one second resets the warp delta.
This is an experimental feature that most people won't notice. It's meant
for investigating if suchlike "unorthodox" key use is acceptable. While
modifier-keys are the norm on computer keyboards, modifier-times aren't,
although we are used to them from other devices, such as alarm clocks etc.)
May later get removed without warning.