Если вы полагаетесь на то, что библиотека устанавливается отдельно и не внедряете ее, то вы должны включить эту строку в манифест аддона :
В любом случае, LibStub гарантирует, что в память будет загружена только одна копия библиотеки (самая последняя версия).## DependsOn: LibMapPins-1.0
Как использовать:
Получить ссылку на библиотеку из LibStub:
Аргументы, используемые большинством функций:local lib = LibStub ( "LibMapPins-1.0" )
Добавить пользовательский тип контакта (группа контактов):pinType: either pinTypeId or pinTypeString, you can use both
pinTypeString: unique string name of your choice (it will be used as a name
for global variable)
pinTypeId: unique number code for your pin type, return value from lib:AddPinType
( local pinTypeId = _G[pinTypeString] )
pinLayoutdаta: table which can contain the following keys:
level = number > 2, pins with higher level are drawn on the top of pins
with lower level.
Examples: Points of interest 50, quests 110, group members 130,
wayshrine 140, player 160.
texture = string or function(pin). Function can return just one texture
or overlay, pulse and glow textures.
size = texture will be resized to size*size, if not specified size is 20.
tint = ZO_ColorDef object or function(pin) which returns this object.
If defined, color of background texture is set to this color.
grayscale = true/false, could be function(pin). If defined and not false,
background texure will be converted to grayscale (http://en.wikipedia.org/wiki/Colorfulness)
insetX = size of transparent texture border, used to handle mouse clicks
insetY = dtto
minSize = if not specified, default value is 18
minAreaSize = used for area pins
showsPinAndArea = true/false
isAnimated = true/false
lib:AddPinType(pinTypeString, pinTypeAddCallback, pinTypeonresizeCallback, pinLayoutData, pinTooltipCreator)
-- returns: pinTypeId
--
-- pinTypeString: string
-- pinTypeAddCallback: function(pinManager), will be called every time when map
-- is changed. It should create pins on the current map using the
-- lib:CreatePin(...) function.
-- pinTypeonresizeCallback: (nilable) function(pinManager, mapWidth, mapHeight),
-- is called when map is resized (zoomed).
-- pinLayoutdаta: (nilable) table, details above
-- pinTooltipCreator: (nilable) etiher string to display or table with the
-- following keys:
-- creator = function(pin) that creates tooltip - or I should say function
-- that will be called when mouse is over the pin, it does not
-- need to create tooltip.
-- tooltip = (nilable) tooltip mode, number between 1 and 4. It is
-- defined in WorldMap.lua as follows:
-- local TOOLTIP_MODE = {
-- INFORMATION = 1,
-- KEEP = 2,
-- MAP_LOCATION = 3,
-- IMPERIAL_CITY = 4,
-- }
-- hasTooltip = (optional), function(pin) which returns true/false to
-- enable/disable tooltip.
-- gamepadCategory = (nilable) string
-- gamepadCategoryId = (nilable) number, right now it uses one of:
-- local GAMEPAD_PIN_ORDERS = {
-- DESTINATIONS = 10,
-- AVA_KEEP = 20,
-- AVA_OUTPOST = 21,
-- AVA_RESOURCE = 22,
-- AVA_GATE = 23,
-- AVA_ARTIFACT = 24,
-- AVA_IMPERIAL_CITY = 25,
-- AVA_FORWARD_CAMP = 26,
-- CRAFTING = 30,
-- QUESTS = 40,
-- PLAYERS = 50,
-- }
-- gamepadCategoryIcon = (nilable) texture path
-- gamepadEntryName = (nilable) string
-- gamepadSpacing = (nilable) boolean
Информация