Quantcast
Channel: ESOUI - AddOns by Phinix
Viewing all articles
Browse latest Browse all 548

LibPhinixFunctions (16)

$
0
0
Change Log:
--------------------
Version 16:
- Updated API for Waking Flame update.

Version 15:
- Updated API and version number to Blackwood.
- Removed unnecessary language format code (duplicate of ZOS function).
- Minor code maintenance.

Version 14:
- Updated API for Flames of Ambition.

Version 13:
- Updated API for Stonethorn.

Version 12:
- Slightly modified extended ASCII looking to account for the game treating non-standard ASCII as punctuation and thus stripping letter from non-English clients when using LUA string functions like gsub('%p','') etc.

Version 11:
- Added new function 'SubExtendedASCII' which will accept an input string and return it with extended ASCII accented characters replaced with standard ASCII non-accented equivalents.
- Updated API version for Greymoor.

Version 10:
- Incremented version to avoid possible issues with other versions floating around.

Version 9:
- Updated API for Harrowstorm.
- Properly converted library to not require LibStub.
- Removed deprecated functions & did some maintenance.

Version 8:
- Updated API for Dragonhold.

Version 7:
- Updated API for Scalebreaker.

Version 6:
- API bump for Elsweyr and properly classified as library in manifest.

Version 5:
- Added support for both LibAddonMenu { r=r, g=g, b=b, a=a } colopicker or { =r, =g, =b, =a } saved variable table input format to RGB2Hex function.

Version 4:
- Minor corrections to the time function.
- Modified RGB2Hex to account for out-of-order rgba table input.

Version 3:
- Added new option to sort by custom LUA table.sort function to GetSorted.

Version 2:
- Changed function notation to avoid potential value mismatches.
- Updated safety checks for nil values and other precautions.
- Updated comments to correct typos and better describe usage scenarios.
- Added current status of debug option to no-option /pfdebug command.

Version 1:
- Initial release.

Description:
--------------------
LibPhinixFunctions

This simple library consolidates various useful tricks and techniques I have picked up over my years of LUA coding and used in various of my addon projects. New functions will be included as needed/requested.

To use the library first add it to your addon manifest:
## DependsOn: LibPhinixFunctions>=9

Then define it somewhere in your addon where you want to use it:
local PF = LibPhinixFunctions

Functions can them be called like so:
(Here 'color' and 'text' would be value you pass the function. See below for more info.)
PF.TColor(color, text)


Chat commands:

/pfdebug on -Enables debug text output.

/pfdebug off -Disables debug text output (default ).



CURRENT AVAILABLE FUNCTIONS:


PF.SubExtendedASCII(iString) --Convert accented letters to standard ASCII equivalent using extended ASCII lookup table.



iString = Input string to convert accented characters from.

local oString (output string) = PF.SubExtendedASCII(iString)

Can also do:
aString = PF.SubExtendedASCII(aString)
PF.Hex2RGB(hex) --Gets { r=r, g=g, b=b, a=a } table for LibAddonMenu colopicker from hex color value.

Gets the RGB value needed for LibAddonMenu color picker settings from a hex format variable used in text string coloring.
For example, you have a saved variable such as Addon.ASV.textColor = "ffffff" you use to set text labels: Label:SetText("|c"..Addon.ASV.textColor..SomeText.."|r")
If you want to allow users to pick the color used through LibAddonMenu colorpicker you can make the GetFunc Hex2RGB(textColor):
getFunc = function()
return PF.Hex2RGB(Addon.ASV.textColor)
en...

Viewing all articles
Browse latest Browse all 548

Trending Articles