// 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
// "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": "ui.inputActions.semi.toggle_discharge_chute.title", "desc": "ui.inputActions.semi.toggle_discharge_chute.description" },
    "toggle_doors":{"order":  2,  "onUp":"electrics.values.doorR = 1-(electrics.values.doorR or 0); electrics.values.doorL = electrics.values.doorR", "title": "ui.inputActions.semi.toggle_doors.title", "desc": "ui.inputActions.semi.toggle_doors.description" },
    "toggle_doorL":{"order":  3,  "onUp":"electrics.values.doorL = 1-(electrics.values.doorL or 0)", "title": "ui.inputActions.semi.toggle_doorL.title", "desc": "ui.inputActions.semi.toggle_doorL.description" },
    "toggle_doorR":{"order":  4,  "onUp":"electrics.values.doorR = 1-(electrics.values.doorR or 0)", "title": "ui.inputActions.semi.toggle_doorR.title", "desc": "ui.inputActions.semi.toggle_doorR.description" },

    "increase_rideHeight":{"order":  5,  "onDown":"controller.getControllerSafe('airbags').setBeamMomentaryIncrease({'rearAxle'}, true)", "onUp":"controller.getControllerSafe('airbags').setBeamMomentaryIncrease({'rearAxle'}, false)", "title": "ui.inputActions.semi.increase_rideHeight.title", "desc": "ui.inputActions.semi.increase_rideHeight.description" },
    "decrease_rideHeight":{"order":  6,  "onDown":"controller.getControllerSafe('airbags').setBeamMomentaryDecrease({'rearAxle'}, true)", "onUp":"controller.getControllerSafe('airbags').setBeamMomentaryDecrease({'rearAxle'}, false)", "title": "ui.inputActions.semi.decrease_rideHeight.title", "desc": "ui.inputActions.semi.decrease_rideHeight.description" },

    "tilt"     :{"order":  7, "onChange":"electrics.values.upfit_tilt = VALUE", "title": "ui.inputActions.semi.upfit_tilt.title", "desc": "ui.inputActions.semi.upfit_tilt.description", "isCentered": true },
    "tiltUp"   :{"order":  8, "onChange":"electrics.values.upfit_tilt = VALUE", "title": "ui.inputActions.semi.upfit_tiltUp.title", "desc": "ui.inputActions.semi.upfit_tiltUp.description" },
    "tiltDown": {"order":  9, "onChange":"electrics.values.upfit_tilt = -VALUE", "title": "ui.inputActions.semi.upfit_tiltDown.title", "desc": "ui.inputActions.semi.upfit_tiltDown.description" },

    "extendRetract"     :{"order":   10, "onChange":"electrics.values.upfit_extendRetract = VALUE", "title": "ui.inputActions.semi.upfit_extendRetract.title", "desc": "ui.inputActions.semi.upfit_extendRetract.description", "isCentered": true },
    "extend"   :{"order":   11, "onChange":"electrics.values.upfit_extendRetract = VALUE", "title": "ui.inputActions.semi.upfit_extend.title", "desc": "ui.inputActions.semi.upfit_extend.description" },
    "retract": {"order":   12, "onChange":"electrics.values.upfit_extendRetract = -VALUE", "title": "ui.inputActions.semi.upfit_retract.title", "desc": "ui.inputActions.semi.upfit_retract.description" },

    "extendRetractFeet"     :{"order":   13, "onChange":"electrics.values.upfit_extendRetractFeet = VALUE", "title": "ui.inputActions.semi.upfit_extendRetractFeet.title", "desc": "ui.inputActions.semi.upfit_extendRetractFeet.description", "isCentered": true },
    "extendFeet"   :{"order":   14, "onChange":"electrics.values.upfit_extendRetractFeet = VALUE", "title": "ui.inputActions.semi.upfit_extendFeet.title", "desc": "ui.inputActions.semi.upfit_extendFeet.description" },
    "retractFeet": {"order":   15, "onChange":"electrics.values.upfit_extendRetractFeet = -VALUE", "title": "ui.inputActions.semi.upfit_retractFeet.title", "desc": "ui.inputActions.semi.upfit_retractFeet.description" },
    "text":   {"order":  1, "onDown":"", "title": "Mod created by BeamNG Old School"},
}