VE Lua Documentation

Press F to search!

toggleDefaultDiffs

Definition


-- @/lua/vehicle/powertrain.lua:874

local function toggleDefaultDiffs()
  for _, v in pairs(powertrainDevices) do
    if v.type == "differential" and v.defaultToggle then
      toggleDeviceMode(v.name)
    end
  end
end

Callers

@/lua/vehicle/controller/4wd.lua
    --input action calls this method if a 4wd controller is found, if not it directly call the powertrain API
    powertrain.toggleDefaultDiffs()
  end
@/ui/ui-vue/mockdata/inputBindings.js
                "title": "ui.inputActions.vehicle.toggleDiffMode.title",
                "onDown": "if #controller.getControllersByType('4wd') > 0 then for _,v in pairs(controller.getControllersByType('4wd')) do v.toggleDiffs() return end else powertrain.toggleDefaultDiffs() end",
                "order": 30.1,