Library: Zasurus' Useful Functions (LibZasUsefulFuncs)

This library is a few useful functions that most AddOns could use at one point or another. I use them in lots of my AddOns and to keep the newest version in all my AddOns I decided to make this library and if it exists it may as well get published for others to use! ;)

So far the functions that exist are:

function TableCount(tableToCount) -- Counts table members

function TableMax(tableToGetMax) -- Pulls back the maximum number (index) for the table specified (Like TableCount() but works when all the table entrys are not in sequencial or contain none Numbers

function TblLowCheck(TestTable, TestValue) -- Checks a table to see if the key is the "TestValue" in any case

function CopyTable(src) -- Copies a table (instead of just pointing to it)

function StrFirstUpper(str) -- Returns the string with the first letter in upper case and the rest in lower case

function ReturnChatFrame(ChatFrameNumber) -- Given a number this returns the ChatFrame for that number. e.g. if 1 is given it will return ChatFrame1

function Round(Number, DecimalPlaces, Type) -- Round to # decimal places and convert to number

function GetAddonVersion(AddonName) -- Takes an addon's Name as a string (the toc file name) and returns the version and whether it's an ALPHA, BETA or RELEASE. It assumes the toc field "## Version: " is filled in and it's in the form "V1.0.1 BETA" or something like that.

function SetRotation(Texture, Angle, bMirror, bInvertRotation) -- Rotates the given texture to the angle given. NOTE: Not BY the angle given but TO the angle given. Positive numbers move it Counter Clock Wise. So 90 will move a picture of a vertical line going from the centre of the image to the top of the image point from the centre to the left (3 o'clock)

Also when loaded "/rl" from the console reloads the UI...

I will update these function to make them more efficient and add functionality as and when I can. If you have suggestions then feel free to discuses it in the forum and then post a ticket.

Facts

Date created
Dec 14, 2010
Categories
Last update
Jul 16, 2012
Development stage
Beta
License
All Rights Reserved
Curse link
Library: Zasurus' Useful Functions (LibZasUsefulFuncs)
Downloads
2,335
Recent files
  • B: V0.1-10 BETA for 4.2 Jul 16, 2012
  • A: r34 for 4.2 Jul 16, 2012
  • A: r33 for 4.2 Jul 16, 2012
  • A: r32 for 4.2 Apr 02, 2012
  • A: r31 for 4.2 Feb 06, 2012

Authors

Relationships

Embedded library
LibStub