1
0
Fork 0
Commit graph

354 commits

Author SHA1 Message Date
mfranz
693bebcd43 this module is meant for pure startup code. It shall not contain any library
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.
2007-10-07 19:44:58 +00:00
mfranz
095e3e717e agl: need to check for nil 2007-10-07 17:09:13 +00:00
mfranz
dfd21c722d - add more "var" keywords, fix indentation, drop some parentheses,
fix comments, consistency fixes, ...
- aircraft.nas: angular_lowpass -> minor speedup
2007-10-07 15:12:05 +00:00
mfranz
ef22d3f5a3 only report ATC/runway near ground & cleanup 2007-10-07 11:34:53 +00:00
mfranz
b7ddc05287 rwy info isn't always available 2007-10-04 22:07:37 +00:00
mfranz
321fbbbcab friendly ATC tells us on which runway we are, without sound.
Please complain if you find it, nevertheless, annoying.
2007-10-04 18:23:36 +00:00
mfranz
a895da0247 can't use props.getNode() on the top level ... 2007-10-03 19:14:04 +00:00
mfranz
eafc9c3a1d rename index() to indexof() 2007-10-03 19:01:01 +00:00
mfranz
63dca5051a add index() function which returns view index by name. Identifying views
by name is safer and especially useful for aircraft specific views, where
the XML index doesn't match the view number.
2007-10-03 18:15:50 +00:00
mfranz
0f69bc55ef enable dynamic view not only for view[0], but for all views with set
"config/dynamic-view" bool
2007-10-03 17:33:42 +00:00
mfranz
fd20d330ba props.Node: add remove() method that removes the node it was calleed on
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();
2007-08-07 11:30:30 +00:00
mfranz
bf050c012f load and execute all ~/.fgfs/Nasal/*.nas files in alphabetic order after
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
2007-08-06 22:50:06 +00:00
mfranz
109f38812b don't reset viewPosition on view.resetView(). This would break
"seat adjustment" view MMB-dragging.
2007-08-01 21:28:58 +00:00
mfranz
3132b5c962 Fix mouse MMB+LMB: this reset to view[0] parameters independent of the
current view, so it was only usable in cockpit view, and messed up every
other view.
2007-08-01 21:10:04 +00:00
mfranz
e092ee9abc - we prefer hyphens in property names to underscores
- save /sim/multiplayer/chat-display to autosave.xml
- remove trailing spaces
2007-08-01 19:37:51 +00:00
mfranz
7c2a88a98a Anders GIDENSTAM:
- 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)
2007-07-19 16:18:39 +00:00
mfranz
3ec61cdd5f key help: property browser: Shift-Enter -> Ctrl-Space 2007-07-19 10:51:24 +00:00
mfranz
b6b39def59 nextStyle: switch to next available style, allowing the index range to
have holes. That way people can start their private styles with e.g. 100
and can be sure that the system doesn't mess with them.
2007-07-17 10:05:14 +00:00
mfranz
886af1b68d fly-by: more variation of view points in air, with some limits on ground to
avoid irritating taxiing through the viewer or down view on the aircraft
2007-07-16 14:42:48 +00:00
mfranz
3c08f34027 - move "swap panels" from s-key to S-key
- 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.
2007-07-13 13:46:09 +00:00
mfranz
96a8a9657f - drop redundant aircraft namespace
- use getprop() instead of props.Node.getValue() here because it's faster
2007-07-06 21:28:07 +00:00
mfranz
d6ff854aa5 add class for variable inverval lowpass filtering of angles. (If there's
a better method or name for it, please tell me.) This is primarily for
smoothing view heading angles.
2007-07-06 20:31:14 +00:00
mfranz
bece57dfc8 output ghosts in a readable form 2007-07-02 20:58:30 +00:00
mfranz
54c28ced16 what I do best: cosmetics 2007-07-01 18:54:32 +00:00
mfranz
faf9ea862d implement writexml() function for writing non-standard XML files
(that is: such that don't use PropertyList as root element and have
data hidden in attributes)
2007-07-01 15:05:16 +00:00
mfranz
122423aa2b - make io.readxml() a lot faster
- documentation update
2007-06-30 11:06:36 +00:00
mfranz
7b1ac37678 add readxml function that reads an XML file and returns it as property tree 2007-06-29 15:49:08 +00:00
mfranz
968c517a71 bye ... we have a Nasal interface to the built-in EasyXML parser now 2007-06-29 15:44:15 +00:00
mfranz
2e9c693e67 use geodinfo() function to retrieve the terrain elevation for a coordinate 2007-06-23 15:28:08 +00:00
mfranz
43d6e707bb minus can't be delimiter in a [] range 2007-06-22 20:41:00 +00:00
mfranz
cfd9c1b48f pointless spelling fixes 2007-06-22 18:49:38 +00:00
mfranz
248d4fcf60 - fix behavior for broken input
- more documentation
2007-06-22 17:52:37 +00:00
mfranz
f827653668 - create new Nasal module string.nas with simple shell style pattern matching
algorithm (needed for the file selector and useful for other purposes, like
  assembling lists of livery or screenshot files etc.)
- io.nas: move fixpath to string.nas (it's not only useful for file paths
  but can also be used for property paths)
- screen.nas: move trim to string.nas (used by screen.nas and nasal-console.xml)
- gui.nas: add pattern matching to FileSelctor
- ufo.nas: use patterm matching (only *.ac and *.xml files shall be listed)
2007-06-22 14:13:30 +00:00
mfranz
44cbca565d add ghost(type) output, just like nasal/lib/debug.nas :-) 2007-06-21 20:00:21 +00:00
mfranz
ce356a350e don't multiply with nil 2007-06-20 15:16:29 +00:00
mfranz
fa820545b7 livery: need to set name for standard dialogs separately 2007-06-18 15:34:36 +00:00
mfranz
b96c113765 always the same module dependency problems ... sigh 2007-06-18 15:15:16 +00:00
mfranz
ce70468d73 - fix Coord.latlon() method (output degree instead of radian to be consistent
with Coord.lat() and Coord.lon(), and because this is the preferable unit
  in script space)
- add put_model(<path>, <coord> [, <hdg> [, <pitch> [, <roll>]]]) variant,
  which takes a Coord instead of <lon>/<lat>/<alt>). Here's some inspiration:

  setlistener("/sim/signals/click", func {
      geo.put_model("Models/Fauna/cow.ac", geo.click_position(), 360 * rand());
  });
2007-06-18 11:06:10 +00:00
mfranz
870830b4a7 - import asin/acos/mod from the new math.nas
- drop parentheses where not necessary (looks cleaner :-)
2007-06-18 10:33:37 +00:00
mfranz
b2750d8a05 adapt for geo.nas changes (swapping lon & lat) 2007-06-18 10:23:14 +00:00
mfranz
32616f42a0 swap lon & lat everywhere. lat/lon is illogical, but unortunately a kind of
standard.  :-(
2007-06-18 10:22:17 +00:00
mfranz
31eff644c1 - add setters to the gui.FileSelector, so that title/button text/dir/file/
dotfile flag can be set later (and take effect after the next open())
- add Alt-".." binding: change to $PWD (which is the default starting dir)
2007-06-17 22:56:22 +00:00
mfranz
10ca74fc83 - make dir entry an input field
- make title & button text separately settable
- sequential numbers for clones rather than random numbers
2007-06-17 15:27:33 +00:00
mfranz
e91115e328 Maik JUSTUS: use geodtocart() and carttogeod() functions, rather than
simplified conversion based on a spheroidal Earth
2007-06-16 18:26:06 +00:00
mfranz
59c303bcc1 add printerror() function that prints error vectors as set by call() 2007-06-16 08:21:39 +00:00
mfranz
75a2b57a83 - move dialog registration to the Dialog class
- fix documentation
2007-06-15 16:22:13 +00:00
mfranz
57b8debf7e - Dialog: add optional third arg: dialog name (by default taken from the
dialog's <name> entry)
- FileSelctor: new class derived from Dialog. It clones the file-select
  dialog and reports chosen files/dirs via callback function.
2007-06-14 23:19:43 +00:00
mfranz
183672f8a2 - don't prepend slash on relative paths or archaic paths with drive letters
- documentation updates
2007-06-14 11:26:16 +00:00
mfranz
0fed31d7b7 - fixpath: don't need to remove leading/trailing slashes "manually"; that's
a side effect of the stack loop already
- replace all backslashes by slashes, to avoid security problems on UNIX
  (if support for them is desirable on MS Windows, then we'd need an OS
  property)
2007-06-13 20:31:09 +00:00
mfranz
120d09b5e6 Andy ROSS: functions to check for stat()[2] flags, such as isdir()
mf: fixpath(): function to normalize file paths (doesn't handle escaped
    characters yet)
2007-06-13 16:46:41 +00:00