Пользовательские дополнения

На главную


device.GetUsableDeviceInfo( usableDeviceId )

Возвращает информацию об устройстве. Например, корабельные устройства (управление, пушки и т.д.).

-- система:
GameState

-- библиотека:
device

-- объявление:
function GetUsableDeviceInfo( usableDeviceId )

-- параметры:
usableDeviceId: ObjectId (not nil) - идентификатор устройства

-- возвращаемое значение:
table or nil: таблица с информацией об устройстве или nil, если ошибка, поля таблицы:
 id: ObjectId - Id объекта устройства
 type: number (enum USDEV_*) - тип устройства
 name: WString - название устройства
 hasCrosshair: boolean - true, если надо показывать прицел при использовании этого устройства
 actionsCount: number (int) - количество действий у устройства

-- пример:
local info = device.GetUsableDeviceInfo( usableDeviceId )

if info and info.actionsCount > 0 then
  LogInfo( "Action list: )
  local actions = device.GetUsableDeviceActionsInfo( usableDeviceId )

  for i = 0, info.actionsCount do
    LogInfo( actions[i].name )
  end
else
  LogInfo( "No actions" )
end

Связанные страницы: "CategoryLuaApi" "CategoryDevice"

EnumTurnReason
EnumUsedev
EventBeamCannonShotStarted
EventCannonShotFinished
EventCannonShotPreparationStarted
EventCannonShotStarted
EventChestLooterChanged
EventDeviceActionEffectivenessChanged
EventDeviceActiveActionChanged
EventDeviceCooldownFinished
EventDeviceCooldownsEnableChanged
EventDeviceCooldownStarted
EventDeviceDamageReceived
EventDeviceDeadChanged
EventDeviceOfflineChanged
EventDeviceOfflineReason
EventDeviceRelatedQuestsChanged
EventDevicesChanged
EventDeviceZeroSpeed
EventNavigationScanerHubPveInfo
EventNavigationScanerHubPvpInfo
EventNavigationScanerHubStarted
EventNavigationScanerHubTrailsInfo
EventNavigatorFollowedChanged
EventNavigatorTargetChestsChanged
EventShieldRegenInProgressChanged
EventShieldStrengthChanged
EventUsableDevicesChanged
FunctionAvatarGetActiveUsableDevice
FunctionDeviceCanUse
FunctionDeviceGetCannonTarget
FunctionDeviceGetCooldown
FunctionDeviceGetItemInstalled
FunctionDeviceGetMass
FunctionDeviceGetNavigatorTargetChests
FunctionDeviceGetRelatedQuestObjectives
FunctionDeviceGetShieldStrength
FunctionDeviceGetShipSlotInfo
FunctionDeviceGetTitle
FunctionDeviceGetTransport
FunctionDeviceGetUsableDeviceActionInfo
FunctionDeviceGetUsableDeviceActionsInfo
FunctionDeviceGetUsableDeviceInfo
FunctionDeviceGetUsableDeviceType
FunctionDeviceHasNavigatorFollowedMarker
FunctionDeviceHasRelatedQuestObjectives
FunctionDeviceIsInUse
FunctionDeviceIsOffline
FunctionDeviceIsShieldRegenInProgress
FunctionDeviceIsUsable
FunctionDeviceNavigatorGetTarget
FunctionDeviceNavigatorGetZoomedObject
FunctionDeviceNavigatorSetTarget
FunctionDeviceNavigatorZoom
FunctionTransportGetDevices


CategoryLuaApi CategoryFunction CategoryDevice

На главную