1
0
Fork 0
Commit graph

180 commits

Author SHA1 Message Date
mfranz
51712052e1 this file is broken by design. Fixing the Nasal error apparently
overstrains it, so here's the error back. Have fun!  :-|
2007-01-13 22:37:38 +00:00
mfranz
4690b3c2c3 totally pointless mini-optimization 2007-01-13 21:46:07 +00:00
mfranz
f58fcdd492 make sure the property doesn't only exist, but is actually initialized 2007-01-13 18:35:22 +00:00
mfranz
7b6205d37b add props.Node.getAttribute() and props.Node.setAttribute() methods.
Examples:
  var tied = foo.getAttribute("TIED");
  foo.setAttribute("USERARCHIVE", 1);

Both methods accept attribute strings "READ", "WRITE", "ARCHIVE",
"TRACE_READ", "TRACE_WRITE", and "USERARCHIVE". getAttribute() does
additionally accept "TIED" (although this isn't an SGPropertyNode::Attribute).
Attribute "REMOVED" is not supported.
2007-01-12 18:06:50 +00:00
mfranz
41a756a6ba light class: make the first time-value always "on", even for odd numbered
light pattern. This is more robust and doesn't need the reinit listener.
2006-12-13 16:15:27 +00:00
mfranz
923f2b7299 - fix index and restart loop on reinit
- cosmetics
2006-12-12 22:42:52 +00:00
mfranz
30ce4f68c2 - make register() method more tolerant
- cosmetics
2006-12-11 18:37:10 +00:00
mfranz
ddc4b4c8e5 fix lookat() method (didn't consider unmanaged view "goals") 2006-12-10 23:09:42 +00:00
mfranz
bfacf76538 change per-aircraft configuration to a single function object that is
registered with dynamic_view.register() and is called in the main loop,
replacing the default plane/helicopter function. This has access to
all class functions/members and sets me.heading_offset, me.pitch_offset,
and me.roll_offset, which are then used as new view offsets.
The function can also do other things, such as call the lookat() method
to temporarily set heading and pitch. See the bo105 for an example.

While further minor changes are to be expected, the configuration method
seems to be the way to go.
2006-12-10 21:50:59 +00:00
mfranz
0529f66842 - first stab at making dynamic view parameters configurable on a per-aircraft
basis; see bo105.nas for an example; expect some changes, though
- move "lookat" feature here from bo105.nas (used by "flaps up" bindings)
2006-12-09 22:42:13 +00:00
mfranz
354a0f59ff make if-branch for helicopters (bo105 settings) and for everything else;
this *really* needs to be made configurable and less hackish
2006-12-07 22:38:07 +00:00
mfranz
28323bcec8 new light.new() arguments with light pattern array; error message for old
style args
2006-12-06 15:58:03 +00:00
mfranz
cb9361b067 showHelpDialog: automatically split the contents of a <line> block at
newlines
2006-12-06 00:24:48 +00:00
mfranz
a5aae32cc1 whoops; fix return value 2006-12-05 19:32:44 +00:00
mfranz
2cb4354814 - fix switch() method
- optimization (and code obfuscation ;-)
2006-12-05 19:17:17 +00:00
mfranz
eff0eecb8f lowpass: add set() method to set current average
light: - only trigger switch action if switch state actually changed
       - simplify loop
2006-12-04 10:42:05 +00:00
mfranz
c5ac5639a0 reset view after reinit (slowly, because the lowpass filters need to catch up) 2006-12-03 23:59:50 +00:00
mfranz
89710547ec Use a listener to watch the aircraft.light switch. This is slightly more
efficient and there's no more potential 0.5 s delay.
2006-12-03 22:20:16 +00:00
mfranz
4ae3ab11df don't silently fix bad user input -- complain loudly 2006-11-04 11:33:08 +00:00
mfranz
2145558999 documentation fix 2006-11-03 19:39:08 +00:00
mfranz
dabf3f300c - aircraft.nas: add variable-interval EWMA lowpass filter class
- dynamic_view.nas: use aircraft.lowpass() class

This makes the dynamic view independent of the frame rate. Currently,
each filter instance reads out dt on its own, which is a bit inefficient.
I'll change that to just one read for all instances later (when Nasal
implemented predictable module loading order. :-)
2006-11-03 17:38:32 +00:00
mfranz
0ff3f5da2b boring cleanup 2006-11-02 21:06:36 +00:00
mfranz
07e3e2b05b - minor fix
- add info/debug messages
2006-10-31 13:59:50 +00:00
mfranz
ae1df38643 better atc-message repetition (Remember: '+'-key) 2006-10-31 12:19:42 +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
frohlich
9c52cbf4ac Modified Files:
preferences.xml gui/menubar.xml gui/dialogs/rendering.xml
Added Files:
	Nasal/multiplayer.nas gui/dialogs/chat.xml
	gui/dialogs/chat_full.xml:
	the data part of Stuarts multiplayer/chat patch
2006-10-10 05:23:38 +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
d27df588a6 reduce slip effect speed (harrier VTOL) 2006-08-24 20:55:18 +00:00
mfranz
b5863d9cad use gui.Dialog() class instead of gui.loadXMLDialog() function (which has
been removed)
2006-08-24 16:32:58 +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
11dc7c5bcd - let Input class use Lowpass class
- preparation for configurability
- documentation/cleanup
2006-08-22 10:06:46 +00:00
mfranz
f3d14c408a - only allow dynamic view on some fdms, and disable menu entry on others
- decrease heading-due-to-sideslip
2006-08-21 09:45:48 +00:00
mfranz
8ecfdb2a96 add HUD manager class. The old and new HUD code is a bit tedious to handle
in keyboard.xml. Better concentrate that on one place.
2006-08-21 08:35:53 +00:00
curt
a6ebef1d0a Make lead aircraft behavior more uniform/predictable/repeatable. 2006-08-20 00:54:53 +00:00
mfranz
07f5dd24f3 use sideslip for heading offset in-air, and heading change rate on-ground.
Unfortunately, this is quite jittery on some aircraft, so it uses a slower
lowpass filter. I'd like to fix that, but don't even know what causes it.
Considering /sim/time/delta-realtime-sec didn't help.  :-/
2006-08-19 22:24:24 +00:00
mfranz
28a7b8cb6b - initialize a few properties that can be nil at startup
- start script at settimer(..., 0)
- fix heading mistake
- cleanup
2006-08-18 17:00:16 +00:00
mfranz
3f9bdb62ab fix property name (I had changed that in the environment files, and
apparently missed this instance when I searched for its use)
2006-08-18 15:50:53 +00:00
mfranz
8a31fbaae4 simpler & faster 2006-08-17 22:58:06 +00:00
mfranz
4099269ab3 using printlog() wasn't a good idea, as we don't know if globals.nas was
already initialized. Commenting the messages out.
2006-08-17 18:56:22 +00:00
mfranz
94835bb4e4 move the listener settings into the timer, as we don't know at that time
if globals.nas was already loaded
2006-08-17 18:53:44 +00:00
mfranz
8b77679c06 - don't update view as long as mouse button 0 is pressed (otherwise closing
the A-10 canopy is a bit difficult :-)
- reduce pitch-due-to-z-accel a bit
2006-08-17 16:42:00 +00:00
andy
591c72f5b4 Comments about -lbs and -gal_us were mixed up. Pounds are the
writable property.  Gallons are a read-only convenience.
2006-08-17 16:32:41 +00:00