Quantcast
Download
(7 Kb)
Download
Updated: 05/20/19 08:28 AM
Compatibility:
Elsweyr (5.0.5)
Updated:05/20/19 08:28 AM
Created:01/27/18 09:16 AM
Monthly downloads:7,227
Total downloads:18,099
Favorites:31
MD5:
5.0.5
LibFoodDrinkBuff  Popular! (More than 5000 hits)
Version: 8
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.

Supported Addons
  • FCO Starve Stop
  • Scootworks HUD
  • Grubmaster
  • Group Buffs
Functions
You need to create an instance of this lib with:
Lua Code:
  1. local lib = LIB_FOOD_DRINK_BUFF



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.
v8 - Scootworks:
- use global LIB_FOOD_DRINK_BUFF to call the addon
- api update
v7 - Scootworks:
- fixed two buffs
- tiny code changes
v6 - Scootworks:
- New AddOn structure (removed subfolder)
v5 - Baertram:
- Fixed optional LibAsync call via LibStub (no error message anymore if library is missing).
- Fixed APIVersion in manifest txt file
v4 - Scootworks:
- Recoded standalone.lua -> if LibAsync is available, then use it for dump food/drink abilities.
- Changed DEBUG_ACTIVE_BUFFS() slightly
v3 - Scootworks:
- Added UnRegisterAbilityIdsFilterOnEventEffectChanged()
- Corrected one recipe to food instead drink buff
v2 - Scootworks::
- Added 2 more foods for api 100023 (4.0 summerset)
Optional Files (0)


Archived Files (7)
File Name
Version
Size
Uploader
Date
7
7kB
Scootworks
04/20/19 03:50 PM
6
7kB
Scootworks
03/10/19 01:10 PM
5
8kB
Baertram
11/12/18 03:18 PM
4
7kB
Scootworks
11/05/18 11:49 AM
3
7kB
Scootworks
05/23/18 06:46 PM
2
7kB
Scootworks
04/26/18 09:25 AM
1
6kB
Scootworks
01/27/18 09:16 AM


Post A Reply Comment Options
Unread 03/11/19, 05:14 PM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2166
File comments: 2366
Uploads: 57
IsAbilityADrinkBuff(abilitdId)
Returns true if abilityId is a drink buff
Returns false if abilityId is a food buff,

or returns nil if not a food or drink buff
Report comment to moderator  
Reply With Quote
Unread 03/11/19, 03:11 PM  
Sordrak
 
Sordrak's Avatar
AddOn Author - Click to view AddOns

Forum posts: 33
File comments: 110
Uploads: 3
Re: Re: IS_FOOD_BUFF / IS_DRINK_BUFF

Originally Posted by Scootworks
Originally Posted by Sordrak
Did you remove IS_FOOD_BUFF, IS_DRINK_BUFF?

Would you mind adding them back again please? I used to directly access them and now it seems not to be possible anymore (at least not with further work). thx
yes because the idea of this global was just for the standalone.lua in the past. what’s the idea behind a direct access to those table? maybe you can use this function instead:
IsAbilityADrinkBuff(abilityId)
Should work, thanks for pointing this out. I initially preferred to directly access the table, but this works fine (just didn't saw the function o_O)
Report comment to moderator  
Reply With Quote
Unread 03/11/19, 01:39 PM  
Scootworks
 
Scootworks's Avatar
AddOn Author - Click to view AddOns

Forum posts: 235
File comments: 141
Uploads: 24
Re: IS_FOOD_BUFF / IS_DRINK_BUFF

Originally Posted by Sordrak
Did you remove IS_FOOD_BUFF, IS_DRINK_BUFF?

Would you mind adding them back again please? I used to directly access them and now it seems not to be possible anymore (at least not with further work). thx
yes because the idea of this global was just for the standalone.lua in the past. what’s the idea behind a direct access to those table? maybe you can use this function instead:
IsAbilityADrinkBuff(abilityId)
__________________
EU Server - SŁĄuGhTerHØuSe
Report comment to moderator  
Reply With Quote
Unread 03/11/19, 01:31 PM  
Sordrak
 
Sordrak's Avatar
AddOn Author - Click to view AddOns

Forum posts: 33
File comments: 110
Uploads: 3
IS_FOOD_BUFF / IS_DRINK_BUFF

Did you remove IS_FOOD_BUFF, IS_DRINK_BUFF?

Would you mind adding them back again please? I used to directly access them and now it seems not to be possible anymore (at least not with further work). thx
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: