From be913eac86d8c39ff4d00af4b3a0e22c9e90d68b Mon Sep 17 00:00:00 2001 From: shagu Date: Thu, 1 Nov 2018 15:37:04 +0100 Subject: [PATCH] libcast: update documentation --- libs/libcast.lua | 49 ++++++++++++++++++++++++++++++++-------------- libs/libdebuff.lua | 4 +++- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/libs/libcast.lua b/libs/libcast.lua index a8a3cb8b..da4e205d 100644 --- a/libs/libcast.lua +++ b/libs/libcast.lua @@ -3,27 +3,46 @@ setfenv(1, pfUI:GetEnvironment()) --[[ libcast ]]-- -- A pfUI library that detects and saves all ongoing castbars of players, NPCs and enemies. --- This also includes spells that usually don't have a castbar like Multi-Shot and Aimed Shot. +-- The library also includes spells that usually don't have a castbar like Multi-Shot and Aimed Shot. +-- This is exclusivly used for vanilla in order to provide UnitChannelInfo and UnitCastingInfo functions. -- --- libcast:GetCastInfo(unit) --- Returns all ongoing casts of a unit (name) --- cast, start, casttime, icon, delay, channel +-- External functions: +-- UnitChannelInfo(unit) +-- Returns information on the spell currently cast by the specified unit. +-- Returns nil if no spell is being cast. -- --- libcast:RegisterEventFunc(func, frame) --- Triggers the given function `func` with `frame` as arg1, --- whenever a new cast-event was detected +-- cast[String] - The name of the spell, or nil if no spell is being cast. +-- nameSubtext[String] - (DUMMY) The string describing the rank of the spell, e.g. "Rank 1". +-- text[String] - The name to be displayed. +-- texture[String] - The texture path associated with the spell. +-- startTime[Number] - Specifies when casting has begun, in milliseconds. +-- endTime[Number] - Specifies when casting will end, in milliseconds. +-- isTradeSkill[Boolean] - (DUMMY) Specifies if the cast is a tradeskill -- --- libcast:TriggerEvents() --- Triggers all registered event functions. +-- UnitCastingInfo(unit) +-- Returns information on the spell currently channeled by the specified unit. +-- Returns nil if no spell is being channeled. -- --- libcast:AddAction(mob, spell, channel) --- Adds a spell to the database by using pfUI's spell database --- to obtain durations and icons +-- cast[String] - The name of the spell, or nil if no spell is being cast. +-- nameSubtext[String] - (DUMMY) The string describing the rank of the spell, e.g. "Rank 1". +-- text[String] - The name to be displayed. +-- texture[String] - The texture path associated with the spell. +-- startTime[Number] - Specifies when casting has begun, in milliseconds. +-- endTime[Number] - Specifies when casting will end, in milliseconds. +-- isTradeSkill[Boolean] - (DUMMY) Specifies if the cast is a tradeskill -- --- libcast:RemoveAction(mob, spell) --- Removes the castbar of a given mob, if `spell` is an interrupt. --- spell can be set to "INTERRUPT" to force remove an action. +-- Internal functions: +-- libcast:AddAction(mob, spell, channel) +-- Adds a spell to the database by using pfUI's spell database +-- to obtain durations and icons -- +-- libcast:RemoveAction(mob, spell) +-- Removes the castbar of a given mob, if `spell` is an interrupt. +-- spell can be set to "INTERRUPT" to force remove an action. +-- + +-- return instantly if we're not on a vanilla client +if pfUI.client > 11200 then return end -- return instantly when another libcast is already active if pfUI.api.libcast then return end diff --git a/libs/libdebuff.lua b/libs/libdebuff.lua index 8302ce09..6c891bbc 100644 --- a/libs/libdebuff.lua +++ b/libs/libdebuff.lua @@ -10,9 +10,11 @@ setfenv(1, pfUI:GetEnvironment()) -- Returns debuff informations on the given effect of the specified unit. -- name, rank, texture, stacks, dtype, duration, timeleft +-- return instantly if we're not on a vanilla client +if pfUI.client > 11200 then return end + -- return instantly when another libdebuff is already active if pfUI.api.libdebuff then return end -if pfUI.client >= 20000 then return end local libdebuff = CreateFrame("Frame", "pfdebuffsScanner", UIParent) local scanner = libtipscan:GetScanner("libdebuff")