// this file holds all the actions that only this specific vehicle can perform
// ===========================================================================
// the non self-descriptive fields are:
// "onChange":   code to run when the controller position changes     (applies to: buttons, keys, pov hat, axes)
// "onDown":     code to run when the controller becomes pressed down (applies to: buttons, keys, pov hat)
// "onUp":       code to run when the controller is lifted up         (applies to: buttons, keys, pov hat)
// "onRelative": code to run when the controller position changes     (applies to: mouse axis when holding right mouse button)
// "ctx" (defaults to 'vlua'): where the code above ^ must be run. it can be:
//    - vlua for vehicle lua async
//    - elua for engine  lua async
//    - tlua for engine  lua  sync
//    - ui for javascript    async
//    - ts for torquescript   sync
// "isBasic" (defaults to true): whether the binding must show always (true), or only when 'advanced bindings' checkbox is marked (false)
// "isCentered" (defaults to false): whether the axis values will be reported from -1 to +1 (true) or from 0 to +1 (false)
// "order":      helps set the display order in the Controls menu
{
//"toggle_discharge_chute":{"order":  1, "onUp":"electrics.values.discharge_chute = 1-(electrics.values.discharge_chute or 0)", "title": "Discharge chute", "desc": "Opens/closes the rear cement discharge chute" },
//"toggle_doors":{"order":  2,  "onUp":"electrics.values.doorR = 1-(electrics.values.doorR or 0); electrics.values.doorL = electrics.values.doorR", "title": "Cargo doors", "desc": "Opens/closes the two cargo doors" },
//"toggle_doorL":{"order":  3,  "onUp":"electrics.values.doorL = 1-(electrics.values.doorL or 0)", "title": "Left cargo door", "desc": "Opens/closes the left cargo door" },
//"toggle_doorR":{"order":  4,  "onUp":"electrics.values.doorR = 1-(electrics.values.doorR or 0)", "title": "Right cargo door", "desc": "Opens/closes the left cargo door" },
"unload":{"order":  1, "onUp":"electrics.values.unload = 1-(electrics.values.unload or 0)", "title": "Unloading position", "desc": "Toggles first unloading position of installed upfit" },
"unload2":{"order":  2, "onUp":"electrics.values.unload2 = 1-(electrics.values.unload2 or 0)", "title": "Unloading position 2", "desc": "Toggles second unloading position of installed upfit" },

"turn_on":{"order":  3, "onUp":"electrics.values.turn_on = 1-(electrics.values.turn_on or 0)", "title": "Turn on/off", "desc": "Turns upfit function on/off (ex. mixer)" },


"cranesupport_extend"   :{"order":  17, "onChange":"electrics.values.cranesupport_input =  0.1 * VALUE", "title": "Extend Support Legs", "desc": "Extends Crane Support Legs" },
"cranesupport_retract"	:{"order":  18, "onChange":"electrics.values.cranesupport_input = -0.1 * VALUE", "title": "Retract Support Legs", "desc": "Retracts Crane Support Legs" },
"unfold_cranesupport":{"order":  19, "onUp":"electrics.values.unfold_cranesupport = 1-(electrics.values.unfold_cranesupport or 0)", "title": "Support Legs Unfold", "desc": "Folds/unfolds the crane support legs" },
"push_cranesupport":{"order":  20, "onUp":"electrics.values.push_cranesupport = 1-(electrics.values.push_cranesupport or 0)", "title": "Support Legs Push", "desc": "Extends/retracts the crane support legs" },

"increase_rideHeight":{"order":  5,  "onDown":"controller.getControllerSafe('airbags').setBeamMomentaryIncrease({'rearAxle'}, true)", "onUp":"controller.getControllerSafe('airbags').setBeamMomentaryIncrease({'rearAxle'}, false)", "title": "Increase height", "desc": "Sets the default ride height for the vehicle" },
"decrease_rideHeight":{"order":  6,  "onDown":"controller.getControllerSafe('airbags').setBeamMomentaryDecrease({'rearAxle'}, true)", "onUp":"controller.getControllerSafe('airbags').setBeamMomentaryDecrease({'rearAxle'}, false)", "title": "Decrease height", "desc": "Sets the default ride height for the vehicle" },

"toggle_cablight":{"order":  7, "onUp":"electrics.values.cablight = 1-(electrics.values.cablight or 0)", "title": "Toggle cabin lights", "desc": "Toggles cabin lights" },
//"toggle_beacons":{"order":  8, "onUp":"electrics.values.beacons = 1-(electrics.values.beacons or 0)", "title": "Toggle beacon lights", "desc": "Toggles beacon lights" },


"crane_rotate_l"   :{"order":  9, "onChange":"electrics.values.crane_rotate_input =  0.1 * VALUE", "title": "Crane Rotate Left", "desc": "Rotates the crane left" },
"crane_rotate_r"	:{"order":  10, "onChange":"electrics.values.crane_rotate_input = -0.1 * VALUE", "title": "Crane Rotate Right", "desc": "Rotates the crane right" },
"crane_lift_up"   :{"order":  11, "onChange":"electrics.values.crane_lift_input =  0.3 * VALUE", "title": "Crane Lift Up", "desc": "Lifts the crane up" },
"crane_lift_down"	:{"order":  12, "onChange":"electrics.values.crane_lift_input = -0.3 * VALUE", "title": "Crane Lower Down", "desc": "Lowers the crane down" },
"crane_hook_lift"   :{"order":  13, "onChange":"electrics.values.crane_hook_input =  0.3 * VALUE", "title": "Crane Hook/Jib Lift Up", "desc": "Lifts the crane hook or jib up" },
"crane_hook_lower"	:{"order":  14, "onChange":"electrics.values.crane_hook_input = -0.3 * VALUE", "title": "Crane Hook/Jib Lower Down", "desc": "Lowers the crane hook or jib down" },
"crane_extend"   :{"order":  15, "onChange":"electrics.values.crane_extend_input =  0.1 * VALUE", "title": "Crane Boom Extend", "desc": "Extends the crane boom" },
"crane_retract"	:{"order":  16, "onChange":"electrics.values.crane_extend_input = -0.1 * VALUE", "title": "Crane Boom Retract", "desc": "Retracts the crane boom" },

"load_rotate_l"   :{"order":  21, "onDown":"electrics.values.load_rotate_l = 1", "onUp":"electrics.values.load_rotate_l = 0","title": "Crane Load Rotate Left", "desc": "Rotates crane load left" },
"load_rotate_r"	:{"order":  22, "onDown":"electrics.values.load_rotate_r = 1", "onUp":"electrics.values.load_rotate_r = 0","title": "Crane Load Rotate Right", "desc": "Rotates crane load right" },
}
