VE Lua Documentation

Press F to search!

clearTypeNodeDebugText

Definition


-- @/lua/vehicle/bdebugImpl.lua:2702

-- Removes a specific text group
-- "type" is the text group
local function clearTypeNodeDebugText(type)
  local id = M.state.vehicle.nodeDebugTextTypeToID[type]
  if id then
    table.remove(M.state.vehicle.nodeDebugTextModes, id)

    -- Subtract one from mode to keep same mode selected
    if M.state.vehicle.nodeDebugTextMode >= id then
      M.state.vehicle.nodeDebugTextMode = M.state.vehicle.nodeDebugTextMode - 1
    end
    M.state.vehicle.nodeDebugTextTypeToID[type] = nil

    -- Update type to ID lookups as the ids have been shifted down
    for i = id, #M.state.vehicle.nodeDebugTextModes do
      local currType = M.state.vehicle.nodeDebugTextModes[i].name
      M.state.vehicle.nodeDebugTextTypeToID[currType] = M.state.vehicle.nodeDebugTextTypeToID[currType] - 1
    end
  end
  updateDebugDrawAndSendState()
end

Callers

@/lua/vehicle/powertrain/combustionEngine.lua
local function updateSoundNodeDebug(device)
  bdebug.clearTypeNodeDebugText("CombustionEngine " .. device.name)
  for _, soundData in pairs(device.soundLocations) do
@/lua/vehicle/bdebug.lua
-- "type" is the text group
local function clearTypeNodeDebugText(type)
  local id = _state.vehicle.nodeDebugTextTypeToID[type]