1
0
Fork 0
Commit graph

169 commits

Author SHA1 Message Date
mfranz
a1c1018aa2 Anders GIDENSTAM: adapt for unified tank level property (and do it right :-) 2009-02-06 23:14:49 +00:00
sydadams
22b9c908a9 Update jsb aircraft to use the changed tank/level-lbs property 2009-02-06 22:56:00 +00:00
mfranz
c31ab0ea96 showHelpDialog(): leave some margin for resizing 2009-01-12 12:27:41 +00:00
mfranz
1fc7581f77 add symbols for new cursors 2009-01-11 15:04:55 +00:00
mfranz
e96322b351 OverlaySelector: don't choke if there are no options 2009-01-11 02:42:33 +00:00
mfranz
198d1cb60f make dialog resizable with Ctrl-dragging 2009-01-10 22:31:30 +00:00
mfranz
291ba987d3 fuel dialog: add tank checkbox only if the "selected" property is actually
writable. This omits the box: <selected type="bool" write="n">1</selected>
2008-12-04 11:34:05 +00:00
mfranz
521954116c only enable precipitation if it's enabled in the gui
(/sim/rendering/precipitation-gui-enabled) *and* if the aircraft wants it
(/sim/rendering/precipitation-aircraft-enabled). Some aircraft model rain
on the windshield and want to turn rain off for interior views.
2008-11-23 09:53:46 +00:00
mfranz
2b77665c22 setCursor: complain and show options if wrong cursor name was given 2008-11-20 23:03:24 +00:00
mfranz
c74d6ee75e - make props.initNode a props.Node method
- props.nas: some minor improvements
2008-11-20 19:45:40 +00:00
mfranz
9976b71472 init: make sure /sim/tutorials actually exists 2008-11-15 19:40:28 +00:00
mfranz
78d1a6e631 OverlaySelector: check callback function explicitly for nil 2008-11-12 11:43:26 +00:00
mfranz
d1fd61c728 gui.nas: use nasal-dir-initialized signal for INIT func, so that it's
earlier available. (The settimer/1 was a workaround for another
    problem that should be fixed by now.)
globals.nas: load $FG_HOME/Nasal/ files as first settimer(0) function,
    so that it always comes after all nasal-dir-initialized callbacks

This should fix the glide_slope_tunnel/popupTip bug and makes the
startup order clearer and cleaner.
2008-11-11 14:54:51 +00:00
mfranz
2f76461c8c io.nas/stat: drop use of broken bits library
gui.nas/OverlaySelector: me.data is no longer a node; only sort once
2008-10-21 21:37:41 +00:00
mfranz
c5fe446f58 overlay-select.xml, gui.nas: fix overlay-dialog close(); add relpath() func
aircraft.nas: remove redundant data.add()
2008-10-19 12:34:09 +00:00
mfranz
32bf0f7265 gui.nas: remove trailing slashes in nameprop/sortprop
aircraft.nas: add generic overlay_update function, and make livery_update
         a wrapper for it
2008-10-19 11:52:56 +00:00
mfranz
da7d1ded71 aircraft.nas: make aircraft.livery a wrapper for gui.OverlaySelector
gui.nas: add file name to stored data (needed for MP-livery)
2008-10-16 15:26:19 +00:00
mfranz
a021ab0af0 - aircraft.nas: remove formation class (Deprecated only three hours ago.
Is this fast development, or what?! :-)
- gui.nas: remove debug message
2008-10-15 18:14:54 +00:00
mfranz
181dbba72c OverlaySelector: more robust path handling 2008-10-15 16:48:24 +00:00
mfranz
8c7e7cb994 OverlaySelector: add callback func arg; only store the file paths 2008-10-15 16:13:10 +00:00
mfranz
5d576f0e3d - gui.OverlaySelector: add optional sort criterion, add selection by index,
add next(), and previous() methods.
- aircraft.nas: deprecate formation class
2008-10-15 15:27:56 +00:00
mfranz
6a72126327 OverlaySelector: don't autosave choice. That's easy enough to do "by hand". 2008-10-14 18:48:54 +00:00
mfranz
4341781968 add overlay selector dialog class (similar to the livery selector) 2008-10-14 18:41:19 +00:00
mfranz
996fd73c0c - let F12 pop up radio settings dialog (used to be Ctrl-r)
- disable "reload global preferences", which is semi-broken
2008-10-08 21:59:31 +00:00
mfranz
ce0504cfd4 - move development functions from function keys to :Y (multikey)
- move replay from 'r' to 'Ctrl-r' where it is less dangerous
2008-10-07 20:13:34 +00:00
mfranz
e561c08c04 - gui.nas: make fuel&payload warning closable with Esc
- multikey.nas: minor clarification in the help output
2008-10-02 15:19:47 +00:00
mfranz
a289958717 improve help message 2008-08-16 15:37:54 +00:00
mfranz
b360c2ad62 use <enabled>false</enabled> flag for widgets that shouldn't be drawn
instead of <hide>true</hide>. This is consistent with other places
in fgfs, like menu entries, hud elements, subsystem switches, etc.
2008-08-05 05:28:27 +00:00
mfranz
2040b96b4f s/show_widgets/enable_widgets/ (the function doesn't show anything) 2008-08-03 15:37:43 +00:00
mfranz
463105bca5 add show_widgets() function 2008-08-03 13:41:07 +00:00
mfranz
00475e2d5c - set "archive" flags on all /sim/presets/ children on saving flight, and
- run "presets-commit" after loading
2008-07-29 00:07:18 +00:00
mfranz
abdc416f32 - remove "load flight"/"save flight" dialogs, and
- use a file selector instead
- file-select.xml: handle non-existing files correctly
2008-07-11 20:57:52 +00:00
mfranz
3be5c6956b io: use default attribs rather than a hard-coded number for globals identification
gui/tutorial/aircraft: use io.read_properties()/io.write_properties()
2008-07-11 09:37:33 +00:00
mfranz
ee44cdf0db Anders GIDENSTAM: enable fuel&payload dialog for JSBSim
mf: minor modifications & adding several instances of "var"
2008-07-10 20:13:58 +00:00
mfranz
11d7de3e85 enable the Multiplayer menu if any of txport and rxport is set 2008-06-11 20:05:46 +00:00
mfranz
55670ccb35 enable multiplayer menu only in MP mode 2008-06-11 18:46:54 +00:00
mfranz
b055de3528 add setCursor() wrapper function for the "set-cursor" fgcommand 2008-05-08 10:15:18 +00:00
mfranz
e37bd9d12f add new key defs 2007-12-09 22:58:51 +00:00
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
mfranz
fa37af573c - let menuEnable() consider all <name>s
- always disable tutorial-stop; enable tutorial-start if tutorial available
- don't call the tutorial selector "Wizard 1/2". There is only one tutorial
  selector, the next dialog is already part of the tutorial. Also, the dialogs
  don't guide you through multi-dialog setup, which is what "wizards" normally
  stand for.
- use tutorial name as dialog title
- set button shortcuts (default == return, esc)
- make esc go back to select dialog
- beautify sliders & some other tweaks
2006-02-24 11:11:09 +00:00
mfranz
d9bbddfe3d - make menuEnable() operate on all menus/items with that name (don't stop
when the first was found)
- disable tutorial entries if no tutorial is available
2006-02-23 18:52:32 +00:00
mfranz
ceeb9503f8 Stuart BUCHANAN:
Nasal/XML based tutorial system
2006-02-22 17:03:42 +00:00
mfranz
6462caf7a4 help dialogs: add '+' keydef (let ATC repeat last message) 2006-02-11 10:33:16 +00:00
mfranz
525abca88d use setlistener()'s 3rd argument to open the fps display initially 2006-02-02 18:04:59 +00:00
mfranz
1ee5cea2f9 revert for now: there's one nasal interpreter problem left to solve first 2006-01-30 15:35:00 +00:00
mfranz
40621a028f use optional setlistener() arg 2006-01-30 15:04:42 +00:00
mfranz
a1746e9f77 re-position FPS display on window resizing 2006-01-28 11:17:04 +00:00
mfranz
e6ba63050e open fps dialog initially 2005-12-21 10:41:22 +00:00
mfranz
523b81e317 globals.nas: add _setlistener wrapper (needs to be used in INIT style
functions when used in $FG_ROOT/Nasal/*.nas, because it
             depends on props.nas being available; no restrictions in
             aircraft files, where it will proof most useful

gui.nas:     replace inefficient FPS display polling loop with listener
             callback
2005-12-16 19:15:08 +00:00
mfranz
df6d7171a6 - fps.xml: revive the traditional font color (a bit brighter than pure red)
- gui.nas: use 4-space indents like the rest of the file; waste slightly less
           cycles: checking for the property shouldn't be done in a loop at
           all, it only serves as a temporary solution
2005-12-16 12:14:43 +00:00
mfranz
fbd735408d implement frame rate display as transparent & draggable dialog
(ordered by Curt as Christmas present :-)
2005-12-15 22:00:31 +00:00