1
0
Fork 0
Commit graph

81 commits

Author SHA1 Message Date
mfranz
0183e43b38 allow to open several property browsers with one command line argument
(comma separated paths):

  --prop:browser=position,orientation,sim/model
2007-11-28 22:22:29 +00:00
mfranz
14a5f38be2 make gui.property_browser() not only digest property paths, but
also props.Node class hashes
2007-11-14 20:13:35 +00:00
mfranz
5481c73b20 - fix bug that made gui.popupTip() ignore the optional delay argument
- 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.
2007-11-09 13:00:05 +00:00
mfranz
2bcddab9b6 setlistener(): accessing the node via cmdarg() is now depreciated. Use
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);
2007-10-15 18:27:42 +00:00
mfranz
0d3c7cec6f - setlistener(): add wrapper function to turn ghost arguments into props.Nodes
- "modernization": use more named function arguments and "var" keywords
2007-10-15 16:30:37 +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
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
cfd9c1b48f pointless spelling fixes 2007-06-22 18:49:38 +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
fa820545b7 livery: need to set name for standard dialogs separately 2007-06-18 15:34:36 +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
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
a1fd54cfdf aircraft.nas, gui.nas: adapt loadxml for absolute paths, drop second fgcommand arg
debug.nas, tutorial.nas: adapt for abs. paths
fuel.nas: cleanup
screen.nas: don't remove listeners -- that's done automatically by removind
    the node in NasalSys.cxx
xml.nas: minor documentation fix
2007-06-12 16:20:55 +00:00
mfranz
6cb769ebf7 in addition to aircraft dialogs from arbitrary paths also allow gui.Dialog
to handle regular dialogs from $FG_ROOT/gui/dialogs/.
Example:   var fps = gui.Dialog.new("fps"); fps.open(); fps.close();
2007-06-04 12:42:29 +00:00
andy
3bcb193cb9 Fix symbol lookup issue via a caller() hack. Not sure what the
underlying problem is, but this allows fpsDisplay() to be called both
as a command handler and as a function.
2007-03-29 19:32:59 +00:00
mfranz
de80a63ae6 don't rely on the existence of an "arg" pointer 2007-03-29 18:39:10 +00:00
mfranz
88b81056e1 - make fuel checkbox/slider "live"
- add two dialog helper functions dialog_apply() and dialog_update()
2007-03-29 14:50:27 +00:00
mfranz
44bb7bb192 reload XML dialogs on gui-reinit 2007-03-28 20:35:12 +00:00
mfranz
bcb244be92 use <hrule/> without dummy children 2007-03-26 15:26:23 +00:00
mfranz
c09c7ac5c6 When loading a dialog, first close it, then remove the whole branch,
then load, and finally open the dialog again if it was open at the
beginning. That way it's easy to edit and to update a Nasal-loaded
XML dialog.
2007-03-25 10:00:53 +00:00
mfranz
269396c421 - remove tutorial dialogs from gui.nas and create a new XML dialog
$FG_ROOT/gui/dialogs/tutorial.xml. It combines the former selection
  and description dialogs, which makes browsing much more pleasant.
  No more switching back and forth between the two old dialogs. Also,
  the <list> box can handle a bigger number of tutorials than the
  <combo> box could.
- remove comments from the top of tutorial.nas. The documentation is
  now $FG_ROOT/Docs/README.tutorials
2007-03-24 20:56:40 +00:00
mfranz
7f375cf76c s,/sim/tutorial,/sim/tutorials, 2007-03-24 13:32:15 +00:00
mfranz
ad8048627d add Dialog.namespace() method, which returns the XML dialog's namespace
if the dialog is open and contains embedded <nasal>, or nil otherwise.
This can be used to call dialog functions.
2007-02-26 11:00:04 +00:00
mfranz
2987f9660f let Shift-Space open property browser 2007-02-24 10:16:26 +00:00
mfranz
cb25691c03 call setWeightOpts on reset, too 2007-01-31 21:37:14 +00:00
mfranz
003ba28784 make sure that setWeightOpts isn't called before fuel.nas' init fdm listener.
This is a bit hackish and needs to be reconsidered.
2007-01-31 21:13:16 +00:00
mfranz
cb9361b067 showHelpDialog: automatically split the contents of a <line> block at
newlines
2006-12-06 00:24:48 +00:00
mfranz
76e6f5247a disable joystick info dialog if no js available 2006-10-21 10:19:24 +00:00
mfranz
82c4dd05ed - replace indentation tabs with spaces
- fix sliders: revisions 1.43/1.44 had introduced a mandatory <min-lb>;
  if that was missing, a slider without handle was generated, and a click
  on the slider lead to a crash.
  -> check for both <min-lb> and <max-lb> and set default values
     0, respectively 100

  var min = w.getNode("min-lb", 1).getValue();
  var max = w.getNode("max-lb", 1).getValue();
  slider.set("min", min != nil ? min : 0);
  slider.set("max", max != nil ? max : 100);
2006-10-17 19:22:36 +00:00
mfranz
aad61698ff fix property_browser() 2006-08-27 19:27:21 +00:00
andy
d9ff131805 Oops, wrong sense of create predicte. Melchior was peeved. 2006-08-27 16:45:54 +00:00
andy
e2de2b4093 Melchior discovered an interpreter bug that is fixed (or seems to be
-- I need to verify) in current Nasal CVS.  Commit a workaround for
now.  Basically: don't return a tail call from a foreach.
2006-08-27 16:22:06 +00:00
mfranz
1f57ea72b4 a global symbol must not only *contain* __dlg:property_browser, but
start with it. ("__dlg:" is the namespace prefix for Nasal embedded
in XML dialogs. Subsequent property browsers get a random number added.)
2006-08-26 13:23:06 +00:00
mfranz
74b5436cde call Dialog.load() from the new() constructor already 2006-08-25 20:13:58 +00:00
andy
b6fb9d031a Further augment the weight subsystem so that weights can be tagged with
tank indices, so that changing drop tanks automatically modifies the
corresponding FDM tank capacity (and load, if it is too high).

Add the new tank stuff to the harrier config, along with a few new
items (e.g. AMRAAMs on the outboard pylons) that aren't in the 3D
model yet, but correspond to actual usage.
2006-08-25 19:59:05 +00:00
andy
3e268e394c [Yes, Andy's writing code again. The world is ending.]
An IRC discussion about shavlir's (really nice) harrier model showed
that it had its own version of something like the Fuel & Weight
dialog, developed because the existing subsystem only supported
sliders and not "combo box" style selection for specific external
stores.  That seemed sub-optimal, so I spent a few hours extending the
F&W dialog to do this and forward-ported the harrier to use it.

Check the harrier-set.xml file for an example.  Basically, the weight
dialog reads a list of options for each weight listed under
/sim/weight[n] and manages a "selected" proprty telling us which one
is in use.  The FDM code can then read out the weight-lb property as
before, and the model animations can use the selected option to
predicate drawing the appropriate 3D content.  It seems to work pretty
well.
2006-08-24 22:29:16 +00:00
mfranz
8aa5947e7a - move bo105's Dialog class here; replaces gui.loadXMLDialog()
- fix indentation
2006-08-24 16:32:09 +00:00
mfranz
d583bbcb4f - add property browser opening function
- open browser for each /browser[] property
- add Widget.setBinding() function to simplify dialog generation, and
  convert the dialogs to use it
2006-08-24 12:44:14 +00:00
mfranz
ae6108de80 add n/N key binding (is it really called "finer" and "coarser"?) 2006-08-09 14:01:53 +00:00
mfranz
0246507821 fix indentation 2006-07-20 17:52:55 +00:00
mfranz
ac2225a65f add function that loads dialogs from XML files
(aircraft may prefer to use such dialogs to Nasal-generated ones)
2006-07-14 16:03:43 +00:00
mfranz
1c7e2b404a remove workaround for broken continue 2006-07-03 05:59:24 +00:00
mfranz
249dbd3303 the harrier triggers a Nasal bug: "continue" doesn't execute the "for"
loop's reinitialization part. We have to do that manually for now, or
get caught in an endless loop, until fgfs has mercy and segfaults.
2006-05-25 18:31:00 +00:00
mfranz
af04d04e79 fix rarely occurring bug: if the node isn't initialized, then cap is nil
and can't be compared with a scalar, but only with nil itself
2006-05-12 06:54:16 +00:00
mfranz
35f76bab96 delay menu disabling a bit for props.nas to be able to catch up (?)
(sometimes the AP menu entry didn't get enabled when it should)
2006-04-06 09:49:49 +00:00
mfranz
357dfb3934 move gui styles from /sim/gui[n] to /sim/gui/style[n] to make /sim/gui
free for other gui related properties
2006-03-09 23:05:08 +00:00
mfranz
3e98f8353c cosmetics 2006-02-24 15:54:45 +00:00