add interface function for selecting weapons
This commit is contained in:
parent
631a06b924
commit
f491fd5291
1 changed files with 6 additions and 0 deletions
|
@ -356,4 +356,10 @@ applyParkingBrake = func(v) {
|
|||
# Weapon handling.
|
||||
#
|
||||
trigger = func(b) { setprop("/controls/armament/trigger", b); }
|
||||
weaponSelect = func(d) {
|
||||
var ws = props.globals.getNode("/controls/armament/selected", 1);
|
||||
var n = ws.getValue();
|
||||
if (n == nil) { n = 0; }
|
||||
ws.setIntValue(n + d);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue