View Single Post
04-30-11, 06:22 PM   #12
Aprikot
A Frostmaul Preserver
 
Aprikot's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2010
Posts: 284
Originally Posted by Lily.Petal View Post
I may not be a pro at coding/programming at all, but I can at least look at code and understand what it does to an extent, then change it to what I need. But changing a frame completely dependent on a different frame is a different matter and only meant to make the Author's, not the 'hacker's', life easier.

Especially when said frame is something along the lines of:
height*-(hpheight-.95) -- Taken from FreeB

Which from a glance (from my PoV) is meant to change the frame incase the independent frame is changed so that dependent frame changes along with it so he didn't have to go change every little thing.

But to me, I just groan 'cause I have no idea what I will mess up if I change it to just a straight number.

Wish there was a layout that let me change every variable in the LUA relatively easily instead of trying to hack one and figuring what the heck is being multiplied/subtracted/added etc etc xD
Say at the top, all the Frames Variables are there so you can change what you want for the new people trying to get into oUF, then all the main script loading (or w/e you call it, hooking?) those variables.
Don't be discouraged! In the oUF_Freeb example it's just away of saying what percentage of the frame will be used for health (with the remainder being used for power: ".50" is half, "100" is all, etc.). As the "hacker", you have the freedom to use whatever values you want:

lua Code:
  1. -- from freeb.lua:
  2. local height, width = 22, 220 -- total height is 22 pixels
  3. local hpheight = .85 -- the "percent" allocated for health
  4. -- later on (after doing a find next on "hpheight"):
  5. hp:SetHeight(height*hpheight) -- 22*.85
  6. -- can become:
  7. hp:SetHeight(18.7) -- whatever value you want

Your text editor's "find" feature becomes invaluable when searching for variables. Anyway, the community here is amazingly helpful, and the oUF & Lua forums are there for your questions (and don't think of it as programming...it's just one little tweak after another). You certainly don't need years of Lua experience to hack an oUF layout to your liking!
  Reply With Quote