GE Lua Documentation

Press F to search!

unregisterValueChangeNotification

Definition


-- @/lua/ge/extensions/core/vehicleBridge.lua:87

local function unregisterValueChangeNotification(veh, electricsKey)
  if not veh then
    log("E","","Tried unregisterValueChangeNotification without a vehicle!")
    return
  end
  local vehicleId = veh:getId()
  if not M.vehicleData[vehicleId] then
    return
  end
  local id = M.vehicleData[vehicleId].registeredCallbacks[electricsKey]
  if id then
    local cmd = string.format("extensions.gameplayInterface.unregisterValueChangeNotification(0,%d,'%s')", id, electricsKey)
    log("D","","Unregistering for value change notification: " .. cmd)
    M.logCommand(veh, cmd)
    veh:queueLuaCommand(cmd)
    M.vehicleData[vehicleId].registeredCallbacks[electricsKey] = nil
  end
end

Callers

@/lua/ge/extensions/flowgraph/nodes/vehicle/getElectricsValue.lua
    if veh then
      core_vehicleBridge.unregisterValueChangeNotification(veh, self._setupData.key)
    end
@/lua/ge/extensions/scenario/scenarios.lua
        data.crashedWaitTimer = 0
        core_vehicleBridge.unregisterValueChangeNotification(vehicle, "throttle")
      else
@/lua/vehicle/extensions/gameplayInterface.lua

local function unregisterValueChangeNotification(callbackId, electricsKey)
  local indexToRemove
@/lua/ge/extensions/core/vehicleBridge.lua
  if id then
    local cmd = string.format("extensions.gameplayInterface.unregisterValueChangeNotification(0,%d,'%s')", id, electricsKey)
    log("D","","Unregistering for value change notification: " .. cmd)