|
From: Melchior F. <mf...@ao...> - 2006-06-24 12:32:18
|
* Melchior FRANZ -- Saturday 24 June 2006 10:14:
> I've now added a general gun-trigger wrapper function to controls.nas,
> which should be used by all armed aircraft: controls.trigger(bool)
I've just added a second interface function for selecting weapons:
controls.weaponSelect(int)
All input devices should use it as
controls.weaponSelect(1) and
controls.weaponSelect(-1)
to switch to the next/previous weapon. This function does by default
only increase/decrease the integer value /controls/armament/selected.
Aircraft who offer more than one weapon should use this interface, by
either reading the value from /controls/armament/selected, or by
redefining controls.weaponSelect(). If the former is done, then it
may be advisable to apply a modulo[0] operation to the "selected"
value.
m.
[0] mod = func(a, b) { a - int(a / b) * b }
|