Quantcast
Download
(7 Kb)
Download
Updated: 05/23/18 06:46 PM
Compatibility:
Wolfhunter (4.1)
Summerset (4.0)
Updated:05/23/18 06:46 PM
Created:01/27/18 09:16 AM
Monthly downloads:406
Total downloads:1,190
Favorites:9
MD5:
4.1
LibFoodDrinkBuff
Version: 3
by: Scootworks, Baertram
For Players
This Library is only for use by Add-on Developers

For Developers
This Library includes a list of all current food and drinks buff along with their type (food or drink, special food, etc.).
It includes functions to get information about group member's and/or player food statuses.
The Library can be used by itself or packaged in an Add-on without the standalone.lua file.

Structure
Code:
LibFoodDrinkBuff
|_LibFoodDrinkBuff.txt
|_standalone.lua
|_LibStub
| |_LibStub.lua
|_LibFoodDrinkBuff
  |_LibFoodDrinkBuff.lua
If you want to package LibFoodDrinkBuff with your addon, you only need to use the last folder with LibFoodDrinkBuff.lua inside.

Functions
standalone version
This file includes a function to generate the food buff or drink tables.

You are able to use the following chat commands within the standalone version:
/dump all - full list
/dump new - only buffs that are not in the table yet

main version
You need to create an instance of this library via LibStub like this:
Lua Code:
  1. --libFoodDrinkBuff
  2. local lib = LibStub("LibFoodDrinkBuff")
Use the variable lib to call the following functions then:

lua Code:
  1. function lib:GetTimeLeftInSeconds(timeInMilliseconds)
Parameter: number timeInMilliseconds - any number in milliseconds
Returns: time in seconds rounded up

lua Code:
  1. function lib:GetFoodBuffInfos(unitTag)
Parameter: string unitTag - any unitTag (http://wiki.esoui.com/UnitTag)
Returns: number buffType, bool isDrink, number abilityId, string buffName, number timeStarted, number timeEnds, textureString iconTexture

lua Code:
  1. function lib:IsFoodBuffActive(unitTag)
Parameter: string unitTag - any unitTag (http://wiki.esoui.com/UnitTag)
Returns: bool isBuffActive

lua Code:
  1. function lib:IsFoodBuffActiveAndGetTimeLeft(unitTag)
Parameter: string unitTag - any unitTag (http://wiki.esoui.com/UnitTag)
Returns: bool isBuffActive, number timeLeftInSeconds , number abilityId

lua Code:
  1. function lib:IsAbilityADrinkBuff(abilityId)
Parameter: number abilityId - any valid ability in the game
Returns: nilable:bool isAbilityADrinkBuff, or nil if not a food or drink buff

lua Code:
  1. function lib:RegisterAbilityIdsFilterOnEventEffectChanged(addonEventNameSpace, callbackFunc, filterType, filterParameter)
Parameters: addonEventNameSpace - prefered to insert your addon name. if you want to call this function twice, make sure the second/third/... addonEventNameSpace has anotehr name. example `addonName.."_01"`, `addonName.."_02"`
callbackFunc - any global function you want to run when the event is firing
filterType - choose any filter type from here: http://wiki.esoui.com/AddFilterForEvent
filterParameter - choose any filter parameter from here: http://wiki.esoui.com/AddFilterForEvent

lua Code:
  1. function lib:UnRegisterAbilityIdsFilterOnEventEffectChanged()
To Unregister the function above.
v3 - added UnRegisterAbilityIdsFilterOnEventEffectChanged(), corrected one recipe to food instead drink buff
v2 - added 2 more foods for api 100023 (4.0 summerset)
Optional Files (0)


Archived Files (2)
File Name
Version
Size
Author
Date
2
7kB
Scootworks
04/26/18 09:25 AM
1
6kB
Scootworks
01/27/18 09:16 AM


There have been no comments posted to this file.
Be the first to add one.



Category Jump: